Browse Source

When the security mirror cannot be reached, do not apt-setup-verify the source lines again. This saves having to wait for two DNS timeouts.

r36278
tags/0.10
Frans Pop 15 years ago
parent
commit
5836ca7bca
4 changed files with 38 additions and 12 deletions
  1. +20
    -11
      apt-setup
  2. +7
    -1
      apt-setup-verify
  3. +7
    -0
      debian/changelog
  4. +4
    -0
      generators/90security

+ 20
- 11
apt-setup View File

@@ -38,21 +38,30 @@ for generator in $gendir/*; do
tmp=$($chroot $ROOT tempfile)
echo > $ROOT$tmp
if $generator $ROOT$tmp; then

code=0
$generator $ROOT$tmp || code=$?
case $code in
0)
if ! apt-setup-verify $ROOT$tmp $ROOT/etc/apt/sources.list.new; then
warning "$generator output did not verify"
fi
else
code="$?"
if [ "$code" = 10 ]; then
# TODO handle backup better
log "$generator backed up"
rm -f $ROOT$tmp
db_progress STOP
exit 10
fi
;;
9)
apt-setup-verify --invalid $ROOT$tmp $ROOT/etc/apt/sources.list.new || true
warning "$generator output added commented out"
;;
10)
# TODO handle backup better
log "$generator backed up"
rm -f $ROOT$tmp
db_progress STOP
exit 10
;;
*)
warning "$generator returned error code $code; discarding output"
fi
;;
esac
rm -f $ROOT$tmp
db_progress STEP 1
done


+ 7
- 1
apt-setup-verify View File

@@ -2,6 +2,12 @@
# verify and optionally save out the file
set -e

NOTEST=""
if [ "$1" = "--invalid" ]; then
NOTEST=1
shift
fi

file="$1"
saveto="$2"

@@ -44,7 +50,7 @@ for line in $(sed 's/^/:/' $file); do
line="${line#:}"
if expr "$line" : '.*[^ ].*' >/dev/null && [ "$(expr "$line" : "#")" != 1 ]; then
items=$(expr "$items" + 1)
if valid "$line"; then
if [ -z "$NOTEST" ] && valid "$line"; then
gooditems=$(expr "$gooditems" + 1)
saveline "$line"
else


+ 7
- 0
debian/changelog View File

@@ -1,3 +1,10 @@
apt-setup (1:0.10) UNRELEASED; urgency=low

* When the security mirror cannot be reached, do not apt-setup-verify the
source lines again. This saves having to wait for two DNS timeouts.

-- Frans Pop <fjp@debian.org> Tue, 11 Apr 2006 03:03:23 +0200

apt-setup (1:0.9) unstable; urgency=low

* If no mirror hostname or directory are configured, avoid asking non-free


+ 4
- 0
generators/90security View File

@@ -38,6 +38,7 @@ if [ -n "$proxy" ]; then
fi
fi

RET=0
echo "deb http://$host/ $codename/updates $dists" >> $file
if ! apt-setup-verify $file; then
db_subst apt-setup/security-updates-failed SECURITY_HOST "$host"
@@ -45,6 +46,9 @@ if ! apt-setup-verify $file; then
if ! db_go; then
exit 10 # back up
fi
RET=9
fi

echo "deb-src http://$host/ $codename/updates $dists" >> $file

exit $RET

Loading…
Cancel
Save