Merge "Fix build-srpms-serial audit all srpms issue"
This commit is contained in:
commit
3bb3717023
@ -1231,11 +1231,23 @@ for GIT_ROOT in $GIT_LIST; do
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
AUDIT_DIR=$(mktemp -d $MY_WORKSPACE/tmp-$USER-$ME-audit-XXXXXX)
|
||||
|
||||
cleanup() {
|
||||
if [ -n "$AUDIT_DIR" -a -d "$AUDIT_DIR" ]; then
|
||||
echo "clean up $AUDIT_DIR"
|
||||
rm -rf $AUDIT_DIR
|
||||
fi
|
||||
}
|
||||
|
||||
# cleanup temp files when system exiting
|
||||
trap cleanup EXIT
|
||||
|
||||
# Try to find and clean orphaned and discontinued .src.rpm's
|
||||
if [ $ALL -eq 1 ]; then
|
||||
echo
|
||||
echo "Auditing for obsolete srpms"
|
||||
PACKAGES_CONSIDERED=""
|
||||
for GIT_ROOT in $GIT_LIST; do
|
||||
for p in $(cat $GIT_ROOT/$PKG_DIRS_FILE 2>> /dev/null); do
|
||||
src_dir="$GIT_ROOT/$p"
|
||||
@ -1245,7 +1257,7 @@ if [ $ALL -eq 1 ]; then
|
||||
for f in $(find $src_dir/${DISTRO} -name '*.spec' | sort -V); do
|
||||
NAME=$(spec_find_tag Name "$f" 2>> /dev/null)
|
||||
if [ $? -eq 0 ]; then
|
||||
PACKAGES_CONSIDERED="$PACKAGES_CONSIDERED $NAME"
|
||||
touch "$AUDIT_DIR/$NAME"
|
||||
fi
|
||||
done
|
||||
if [ -f $src_dir/$SRPM_LIST_PATH ]; then
|
||||
@ -1279,7 +1291,7 @@ if [ $ALL -eq 1 ]; then
|
||||
if [ -f $ORIG_SRPM_PATH ]; then
|
||||
NAME=$(rpm -q --queryformat '%{NAME}\n' -p $ORIG_SRPM_PATH 2>> /dev/null)
|
||||
if [ $? -eq 0 ]; then
|
||||
PACKAGES_CONSIDERED="$PACKAGES_CONSIDERED $NAME"
|
||||
touch "$AUDIT_DIR/$NAME"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@ -1314,6 +1326,8 @@ if [ $ALL -eq 1 ]; then
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "Delete $AUDIT_DIR"
|
||||
\rm -rf "$AUDIT_DIR"
|
||||
fi
|
||||
echo "Auditing for obsolete srpms done"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user