Changeset 1159 for rpmbuild-bot
- Timestamp:
- Jun 6, 2017, 10:47:00 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rpmbuild-bot/rpmbuild-bot.sh
r1033 r1159 22 22 # ----- 23 23 # 24 # > rpmbuild-bot.sh SPEC[=VERSION]24 # > rpmbuild-bot.sh [-l] SPEC[=VERSION] 25 25 # > [ upload[=REPO] | test[=MODE] | clean[=test] | 26 26 # > move[=FROM_REPO=TO_REPO] | remove[=REPO] ] 27 27 # > [-f] 28 28 # 29 # MYAPPis the name of the RPM package spec file (extension is optional,29 # SPEC is the name of the RPM package spec file (extension is optional, 30 30 # .spec is assumed). The spec file is searched in the SPECS directory of the 31 31 # rpmbuild tree (usually $USER/rpmbuild/SPECS, rpmbuild --eval='%_specdir' … … 35 35 # The second argument defines the command to perform. The default command is 36 36 # "build". The following sections will describe each command. 37 # 38 # Global options: 39 # 40 # -l -- Log output of the rpmbuild command to screen in addition to putting it 41 # to a dedicated log file. 37 42 # 38 43 # Building packages … … 238 243 } 239 244 245 log() 246 { 247 echo $@ 248 } 249 240 250 log_run() 241 251 { … … 243 253 shift 244 254 rm -f "$log" 245 "$@" >"$log" 2>&1 255 if [ -n "$log_to_console" ] ; then 256 "$@" 2>&1 | tee "$log" 257 else 258 "$@" >"$log" 2>&1 259 fi 246 260 local rc=$? 247 if test $rc != 0 ; then 248 echo "ERROR: The following command failed with error code $rc:" 249 echo $@ 250 echo "You will find more information in file '$log'." 251 echo "Here are the last 10 lines of output:" 252 echo "------------------------------------------------------------------------------" 253 tail "$log" -n 10 254 echo "------------------------------------------------------------------------------" 261 if [ $rc != 0 ] ; then 262 log "ERROR: The following command failed with error code $rc:" 263 log $@ 264 log "You will find more information in file '$log'." 265 if [ -z "$log_to_console" ] ; then 266 # Note: echo instead of log to avoid putting this to the main log file. 267 echo "Here are the last 10 lines of the command output:" 268 echo "------------------------------------------------------------------------------" 269 tail "$log" -n 10 270 echo "------------------------------------------------------------------------------" 271 fi 255 272 quit $rc 256 273 fi … … 403 420 f="${f%.*}.dbg" 404 421 masks="$masks${masks:+ }'*$f'" 405 # Save the file for later inclusion into debugfiles.list (%debug_package magic in brp-strip .os2)422 # Save the file for later inclusion into debugfiles.list (%debug_package magic in brp-strip-os2) 406 423 run echo "$f" >> "$dbgfilelist" 407 424 done < "$tgt_dir.files.list" … … 841 858 case "$1" in 842 859 -*) 843 options="$*"844 while [ -n "$1" ] ; do860 if [ -z "$command" ] ; then 861 # Global options 845 862 case "$1" in 846 - f) force="-f"863 -l) log_to_console="$1" 847 864 ;; 848 865 *) usage 849 866 ;; 850 867 esac 851 shift 852 done 853 break 868 else 869 # Command's options 870 options="$*" 871 while [ -n "$1" ] ; do 872 case "$1" in 873 -f) force="$1" 874 ;; 875 -l) log_to_console="$1" 876 ;; 877 *) usage 878 ;; 879 esac 880 shift 881 done 882 break 883 fi 854 884 ;; 855 885 *)
Note:
See TracChangeset
for help on using the changeset viewer.