#!/bin/bash

set -eux

basedir=$1
specdir=${basedir}/openstack/

WORKSPACE=${WORKSPACE:-$basedir}

echo "run renderspec over specfiles from ${specdir}"
for spec in ${specdir}/**/*.spec.j2; do
    mkdir -p $WORKSPACE/logs/
    for specstyle in "suse" "fedora"; do
        echo "run ${spec} for ${specstyle}"
        renderspec --spec-style ${specstyle} ${spec} \
                   -o $WORKSPACE/logs/`basename ${spec}`.${specstyle}
    done
done

#!/bin/bash

set -eux

basedir=$1
specdir=${basedir}/openstack/

WORKSPACE=${WORKSPACE:-$basedir}

echo "run renderspec over specfiles from ${specdir}"
for spec in ${specdir}/**/*.spec.j2; do
    mkdir -p $WORKSPACE/logs/
    for specstyle in "suse" "fedora"; do
        echo "run ${spec} for ${specstyle}"
        renderspec --spec-style ${specstyle} ${spec} \
                   -o $WORKSPACE/logs/${spec##*/}.${specstyle}
    done
done

Use only bash parameter expansion
Use only bash parameter expansion

Small optimization that avoids forking a process to retrieve basename

Change-Id: I4844ba19525d4a3c7d88cfd6d2f3f3896768a113
