Ticket #106: out1.diff

File out1.diff, 2.3 KB (added by Silvan Scherrer, 10 years ago)

new diff

  • netlabs-rpmbuild-all.sh

     
    5252test -n "$spec" || { echo "ERROR: You must specify a .spec file."; exit 1; }
    5353
    5454spec_name="${spec##*/}"
     55logDir='.'
    5556
    5657# Set up official netlabs.org rpmbuild environment
    5758. netlabs-rpmbuild-env.sh
    5859
     60if test -d "$logDir" ; then
     61# already around
     62else
     63  run mkdir -p "$logDir"
     64fi
     65
    5966# Override variables from the command line, if any
    6067shift
    6168while test "$1" != "" ; do
     
    7986
    8087# Generate RPMs
    8188for arch in $NETLABS_RPM_ARCH_LIST ; do
    82   echo "Creating RPMs for '$arch' target (logging to $spec_name.$arch.log)..."
    83   log_run "$spec_name.$arch.log" rpmbuild --target=$arch -bb "$spec"
     89  echo "Creating RPMs for '$arch' target (logging to $logDir/$spec_name.$arch.log)..."
     90  log_run "$logDir/$spec_name.$arch.log" rpmbuild --target=$arch -bb "$spec"
    8491done
    8592
    8693# Generate SRPM
    87 echo "Creating SRPM (logging to $spec_name.srpm.log)..."
    88 log_run "$spec_name.srpm.log" rpmbuild -bs "$spec"
     94echo "Creating SRPM (logging to $logDir/$spec_name.srpm.log)..."
     95log_run "$logDir/$spec_name.srpm.log" rpmbuild -bs "$spec"
    8996
    9097# Generate ZIP
    91 echo "Creating ZIP (logging to $spec_name.zip.log)..."
     98echo "Creating ZIP (logging to $logDir/$spec_name.zip.log)..."
    9299create_zip()
    93100{(
    94   zip=`grep "src.rpm" "$spec_name.srpm.log" | sed -e "s#^[a-zA-Z ]*: *##g" -e "s#.src.rpm##g" | tr . _`.zip
     101  zip=`grep "src.rpm" "$logDir/$spec_name.srpm.log" | sed -e "s#^[a-zA-Z ]*: *##g" -e "s#.src.rpm##g" | tr . _`.zip
    95102  zip_dir="${zip%/*}/../zip"
    96103  zip="$zip_dir/${zip##*/}"
    97104  echo "Will create '$zip'"
    98105  run mkdir -p "$zip_dir"
    99106  rm -r "@unixroot" 2> /dev/null
    100   for rpm in `grep "$zip_arch.rpm\|noarch.rpm" "$spec_name.$zip_arch.log" | sed "s#^[a-zA-Z ]*: *##g"` ; do
     107  for rpm in `grep "$zip_arch.rpm\|noarch.rpm" "$logDir/$spec_name.$zip_arch.log" | sed "s#^[a-zA-Z ]*: *##g"` ; do
    101108    echo "Unpacking $rpm..."
    102109    run rpm2cpio "$rpm" | cpio -idm
    103110  done
    104111  rm -f "$zip" 2> /dev/null
    105112  run zip -mry9 "$zip" "@unixroot"
    106113)}
    107 log_run "$spec_name.zip.log" create_zip
     114log_run "$logDir/$spec_name.zip.log" create_zip
    108115
    109116echo "All done."