Browse Source

sde-reschedule-new: Finished tool to delete packages which where build before changes occurred to it

karasz/new-early
Alejandro Mery 16 years ago
parent
commit
5226c8610b
1 changed files with 24 additions and 26 deletions
  1. +24
    -26
      bin/sde-reschedule-new

+ 24
- 26
bin/sde-reschedule-new

@ -90,54 +90,52 @@ reschedule_new()
{ {
local pkg="$1" cksum1="$2" cksum2= config="$3" sandbox="$4" local pkg="$1" cksum1="$2" cksum2= config="$3" sandbox="$4"
local pkgfile="$SDEROOT/$sandbox/var/adm/packages/$pkg" local pkgfile="$SDEROOT/$sandbox/var/adm/packages/$pkg"
local dependers= x=
if [ -s "$pkgfile" ]; then if [ -s "$pkgfile" ]; then
cksum2=$( grep -R '^\(ROCK Linux\|T2\|OpenSDE\) Package Source Checksum: ' \ cksum2=$( grep -R '^\(ROCK Linux\|T2\|OpenSDE\) Package Source Checksum: ' \
"$pkgfile" | cut -d: -f2 ) "$pkgfile" | cut -d: -f2 )
if [ " $cksum1" != "$cksum2" ]; then if [ " $cksum1" != "$cksum2" ]; then
if [ "$reschedule_dependers" = "yes" ]; then
# TODO: Implement dependers detection
dependers=
fi
for x in $pkg $dependers; do
echo "$config: $x"
if [ "$reschedule_dry" != "yes" ]; then
if [ "$reschedule_soft" != "yes" ]; then
mine -rf -R "$SDEROOT/$sandbox/" "$x"
fi
rm -f "$SDEROOT/$sandbox/var/adm"/*/?-$x.* 2> /dev/null
fi
done
"$SDEROOT/bin/sde-reschedule-package" \
${reschedule_dry:+--dry-run} \
${reschedule_soft:+--soft} \
${reschedule_dependers:+--deps} \
-c "$config" "$pkg"
fi fi
fi fi
} }
# which configs? # which configs?
# #
if [ -n "$reschedule_any" ]; then
if [ "$reschedule_any" = "yes" ]; then
reschedule_configs=$( config_list ) reschedule_configs=$( config_list )
[ -n "$reschedule_configs" ] || echo_abort 1 "No config found." [ -n "$reschedule_configs" ] || echo_abort 1 "No config found."
elif [ $# -eq 0 ]; then elif [ $# -eq 0 ]; then
# try default # try default
set -- 'default'
fi
if [ -z "$reschedule_configs" ]; then
y="$( config_id default )"
if [ -z "$y" ]; then
echo_abort 1 "No config found."
elif [ -d "$SDEROOT/build/$y/" ]; then
reschedule_configs=default
else
exit 0
fi
else
for x; do for x; do
if config_exists "$x"; then
reschedule_configs="$reschedule_configs $x"
else
y=$( config_id "$x" )
if [ -z "$y" ]; then
echo_warning "$x: Invalid config." echo_warning "$x: Invalid config."
elif [ -d "$SDEROOT/build/$y/" ]; then
reschedule_configs="$reschedule_configs $x"
fi fi
done done
fi fi
[ -n "$reschedule_configs" ] || exit 0
tuples= tuples=
sandboxes= sandboxes=
for x in $reschedule_configs; do for x in $reschedule_configs; do
@ -151,11 +149,11 @@ for x in $reschedule_configs; do
done done
for pkg in $( reschedule_packages_list $sandboxes ); do for pkg in $( reschedule_packages_list $sandboxes ); do
cksum1=$( sh $SDEROOT/lib/sde-package/pkgchksum.sh \
cksum=$( sh "$SDEROOT/lib/sde-package/pkgchksum.sh" \
`package_confdir $pkg` ) `package_confdir $pkg` )
for x in $tuples; do for x in $tuples; do
( reschedule_new $pkg $cksum1 ${x/:/ } ) &
( reschedule_new $pkg $cksum ${x/:/ } ) &
done done
wait wait
done done

Loading…
Cancel
Save