Changeset 1032 for rpmbuild-bot


Ignore:
Timestamp:
Feb 24, 2017, 11:42:01 PM (8 years ago)
Author:
dmik
Message:

rpmbuild-bot: Use -a in grep to force text file mode.

This is to protect from cases when some tool (like emxomf in verbose mode)
outputs non-printable chars during the build process which makes grep interpret
the file as binary which breaks generated RPM file detection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rpmbuild-bot/rpmbuild-bot.sh

    r990 r1032  
    467467    log_run "$log_base.$arch.log" rpmbuild.exe --target=$arch -bb "$spec_full"
    468468    print_elapsed start_time "Completed in \$e."
    469     if ! grep -q "^Wrote: \+.*\.$arch\.rpm$" "$log_base.$arch.log" ; then
    470       if ! grep -q "^Wrote: \+.*\.noarch\.rpm$" "$log_base.$arch.log" ; then
     469    if ! grep -a -q "^Wrote: \+.*\.$arch\.rpm$" "$log_base.$arch.log" ; then
     470      if ! grep -a -q "^Wrote: \+.*\.noarch\.rpm$" "$log_base.$arch.log" ; then
    471471        die "Target '$arch' did not produce any RPMs."
    472472      fi
     
    484484
    485485  # Find SRPM file name in the log.
    486   local src_rpm=`grep "^Wrote: \+.*\.src\.rpm$" "$log_base.srpm.log" | sed -e "s#^Wrote: \+##g"`
     486  local src_rpm=`grep -a "^Wrote: \+.*\.src\.rpm$" "$log_base.srpm.log" | sed -e "s#^Wrote: \+##g"`
    487487  [ -n "$src_rpm" ] || die "Cannot find .src.rpm file name in '$log_base.srpm.log'."
    488488
     
    497497
    498498  # Find all RPM packages for the base arch (note the quotes around `` - it's to preserve multi-line result).
    499   local rpms="`grep "^Wrote: \+.*\.\($base_arch\.rpm\|noarch\.rpm\)$" "$log_base.$base_arch.log" | sed -e "s#^Wrote: \+##g"`"
     499  local rpms="`grep -a "^Wrote: \+.*\.\($base_arch\.rpm\|noarch\.rpm\)$" "$log_base.$base_arch.log" | sed -e "s#^Wrote: \+##g"`"
    500500  [ -n "$rpms" ] || die "Cannot find .$base_arch.rpm/.noarch.rpm file names in '$log_base.base_arch.log'."
    501501
     
    535535  if [ -z "$noarch_only" ] ; then
    536536    for arch in ${arch_list%${base_arch}} ; do
    537       rpms="`grep "^Wrote: \+.*\.$arch\.rpm$" "$log_base.$arch.log" | sed -e "s#^Wrote: \+##g"`"
     537      rpms="`grep -a "^Wrote: \+.*\.$arch\.rpm$" "$log_base.$arch.log" | sed -e "s#^Wrote: \+##g"`"
    538538      [ -n "$rpms" ] || die "Cannot find .$arch.rpm file names in '$log_base.arch.log'."
    539539      for f in $rpms ; do
     
    591591  if [ "$command_arg" = "all" -o "$command_arg" = "pack" ] ; then
    592592    # Find all RPM packages for the base arch (note the quotes around `` - it's to preserve multi-line result).
    593     local rpms="`grep "^Wrote: \+.*\.\($base_arch\.rpm\|noarch\.rpm\)$" "$log_file" | sed -e "s#^Wrote: \+##g"`"
     593    local rpms="`grep -a "^Wrote: \+.*\.\($base_arch\.rpm\|noarch\.rpm\)$" "$log_file" | sed -e "s#^Wrote: \+##g"`"
    594594    if [ -n "$rpms" ] ; then
    595595      echo "Successfully generated the following RPMs:"
     
    729729
    730730    # Find all RPM packages for the base arch (note the quotes around `` - it's to preserve multi-line result).
    731     local rpms="`grep "^Wrote: \+.*\.\($base_arch\.rpm\|noarch\.rpm\)$" "$log_file" | sed -e "s#^Wrote: \+##g"`"
     731    local rpms="`grep -a "^Wrote: \+.*\.\($base_arch\.rpm\|noarch\.rpm\)$" "$log_file" | sed -e "s#^Wrote: \+##g"`"
    732732    if [ -n "$rpms" ] ; then
    733733      for f in $rpms; do
Note: See TracChangeset for help on using the changeset viewer.