Changeset 737 for rpmbuild-bot/rpmbuild-bot.sh
- Timestamp:
- Apr 11, 2016, 7:26:31 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rpmbuild-bot/rpmbuild-bot.sh
r736 r737 172 172 } 173 173 174 read_file_list() 175 { 176 # $1 = file list list filename 177 # $2 = var name where to save read file names (optional) 178 179 local _read_file_list_ret= 180 # Check timestamps. 181 while read l; do 182 local f="${l#*|}" 183 local t="${l%%|*}" 184 [ "$f" = "$t" ] && die "Line '$l' in '$1' does not contain timestamps." 185 local a=`stat -c '%Y' "$f"` 186 if [ "$t" != "$a" ] ; then 187 die "Recorded timestamp $t doesn't match actual timestamp $a for file '$f'." 188 fi 189 _read_file_list_ret="$_read_file_list_ret${_read_file_list_ret:+ }$f" 190 done < "$1" 191 # Return the files (if requested). 192 [ -n "$2" ] && eval "$2=\$_read_file_list_ret" 193 } 194 174 195 usage() 175 196 { … … 199 220 200 221 echo "Detected successful build in $spec_list, cleaning up due to -f option..." 201 while read f; do 222 local files= 223 read_file_list "$spec_list" files 224 for f in $files; do 202 225 echo "Removing $f..." 203 rm -f "$f" 204 done < "$spec_list" 226 run rm -f "$f" 227 done 228 unset files 205 229 206 230 echo "Removing $log_base.*.log and .list files..." … … 259 283 # Generate list of all generated packages for further reference. 260 284 echo "Creating list file ($ver_list)..." 261 echo "$src_rpm" > "$ver_list"262 echo "$zip" >> "$ver_list"285 echo `stat -c '%Y' "$src_rpm"`"|$src_rpm" > "$ver_list" 286 echo `stat -c '%Y' "$zip"`"|$zip" >> "$ver_list" 263 287 # Save base arch RPMs. 264 for f in "$rpms"; do265 echo "$f" >> "$ver_list"288 for f in $rpms ; do 289 echo `stat -c '%Y' "$f"`"|$f" >> "$ver_list" 266 290 done 267 291 # Save other arch RPMs. … … 270 294 [ -n "$rpms" ] || die "Cannot find .$arch.rpm file names in '$log_base.arch.log'." 271 295 for f in $rpms ; do 272 echo "$f" >> "$ver_list"296 echo `stat -c '%Y' "$f"`"|$f" >> "$ver_list" 273 297 done 274 298 done … … 323 347 if [ -n "$rpms" ] ; then 324 348 echo "Successfully generated the following RPMs:" 325 for f in "$rpms"; do349 for f in $rpms ; do 326 350 echo "$f" 327 351 done … … 346 370 [ -f "$spec_list" ] || die \ 347 371 "File '$spec_list' is not found. 348 You man need to build the packages using the 'build' command." 349 350 while read f; do 372 You may need to build the packages using the 'build' command." 373 374 local files= 375 read_file_list "$spec_list" files 376 for f in $files; do 351 377 case "$f" in 352 378 *.src.rpm) … … 373 399 echo "Copying $f to $d..." 374 400 run cp -p "$f" "$d" 375 done < "$spec_list"401 done 376 402 377 403 # On success, delete the uploaded packages and archive log files. 378 while read f; do404 for f in $files; do 379 405 echo "Removing $f..." 380 r m -f "$f"381 done < "$spec_list"406 run rm -f "$f" 407 done 382 408 383 409 # Note: versioned .list file will remain in archive forever (for further reference).
Note:
See TracChangeset
for help on using the changeset viewer.