Browse Source

clean up temporary files properly

r31497
tags/0.1
Colin Watson 16 years ago
parent
commit
29d98944a1
2 changed files with 6 additions and 4 deletions
  1. +5
    -4
      apt-setup
  2. +1
    -0
      generators/50cdrom

+ 5
- 4
apt-setup View File

@@ -33,9 +33,9 @@ for generator in $gendir/*; do
fi
tmp=$($chroot $ROOT tempfile)
echo > $tmp
if $generator $tmp; then
if ! apt-setup-verify $tmp $ROOT/etc/apt/sources.list.new; then
echo > $ROOT$tmp
if $generator $ROOT$tmp; then
if ! apt-setup-verify $ROOT$tmp $ROOT/etc/apt/sources.list.new; then
warning "$generator output did not verify"
fi
else
@@ -43,12 +43,13 @@ for generator in $gendir/*; do
if [ "$code" = 10 ]; then
# TODO handle backup better
log "$generator backed up"
rm -f $ROOT$tmp
db_progress STOP
exit 10
fi
warning "$generator returned error code $code; discarding output"
fi
rm -f $tmp
rm -f $ROOT$tmp
db_progress STEP 1
done
mv $ROOT/etc/apt/sources.list.new $ROOT/etc/apt/sources.list


+ 1
- 0
generators/50cdrom View File

@@ -30,3 +30,4 @@ $chroot $ROOT apt-cdrom add \
-o Acquire::gpgv::Options::=--ignore-time-conflict \
</dev/null
cat $ROOT$tmp >> $file
rm -f $ROOT$tmp $ROOT$tmp~

Loading…
Cancel
Save