From 69c28efc768e22029ba343f335dd198ac52b1eef Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 25 Feb 2008 18:08:19 +0000 Subject: * debian/apt.cron.daily: - sleep random amount of time (default within 0-30min) before starting the upate to hit the mirrors less hard --- debian/apt.cron.daily | 26 ++++++++++++++++++++++++++ debian/changelog | 3 +++ 2 files changed, 29 insertions(+) (limited to 'debian') diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily index 7af689e1f..ec53a7f2f 100644 --- a/debian/apt.cron.daily +++ b/debian/apt.cron.daily @@ -147,6 +147,25 @@ check_size_constraints() fi } +# sleep for a random intervall of time (default 30min) +# (some code taken from cron-apt, thanks) +random_sleep() +{ + RandomSleep=1800 + eval $(apt-config shell RandomSleep APT::Periodic::RandomSleep) + if [ $RandomSleep -eq 0 ]; then + return + fi + if [ -z "$RANDOM" ] ; then + # A fix for shells that do not have this bash feature. + RANDOM=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -c"1-5") + fi + TIME=$(($RANDOM % $RandomSleep)) + sleep $TIME +} + +# main + if ! which apt-config >/dev/null; then exit 0 fi @@ -179,6 +198,13 @@ if ! apt-get check -q -q 2>/dev/null; then exit 1 fi +# sleep random amount of time +random_sleep + +# check again if we can access the cache +if ! apt-get check -q -q 2>/dev/null; then + exit 1 +fi UPDATE_STAMP=/var/lib/apt/periodic/update-stamp if check_stamp $UPDATE_STAMP $UpdateInterval; then diff --git a/debian/changelog b/debian/changelog index 2c685b087..b6b0ac835 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,9 @@ apt (0.7.12) UNRELEASED; urgency=low is run * methods/connect.cc: - remember hosts with Resolve failures or connect Timeouts + * debian/apt.cron.daily: + - sleep random amount of time (default within 0-30min) before + starting the upate to hit the mirrors less hard [ Christian Perrier ] * Fix typos in manpages. Thanks to Daniel Leidert for the fixes -- cgit v1.2.3 From 704c39d64b265ec9aa70e14ec1a55ef5219762a3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 4 Mar 2008 14:48:43 +0100 Subject: * doc/apt_preferences.5.xml: - fix typo --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b6b0ac835..a4287b160 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ apt (0.7.12) UNRELEASED; urgency=low * debian/apt.cron.daily: - sleep random amount of time (default within 0-30min) before starting the upate to hit the mirrors less hard + * doc/apt_preferences.5.xml: + - fix typo [ Christian Perrier ] * Fix typos in manpages. Thanks to Daniel Leidert for the fixes -- cgit v1.2.3 From 0748d509f684e192e295302e77263719323f0d1a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 11 Mar 2008 09:53:09 +0100 Subject: * cmdline/apt-get.cc: - fix incorrect help output for -f (LP: #57487) --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a4287b160..6a83107fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ apt (0.7.12) UNRELEASED; urgency=low is run * methods/connect.cc: - remember hosts with Resolve failures or connect Timeouts + * cmdline/apt-get.cc: + - fix incorrect help output for -f (LP: #57487) * debian/apt.cron.daily: - sleep random amount of time (default within 0-30min) before starting the upate to hit the mirrors less hard -- cgit v1.2.3 From 9dbe6ae43a5a78f68a4863650a5d23eb9051d0f7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 11 Mar 2008 17:40:15 +0100 Subject: - run the problemResolver after a task was installed so that it can correct any missing dependencies --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 6a83107fe..da4779f8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,8 @@ apt (0.7.12) UNRELEASED; urgency=low - remember hosts with Resolve failures or connect Timeouts * cmdline/apt-get.cc: - fix incorrect help output for -f (LP: #57487) + - run the problemResolver after a task was installed + so that it can correct any missing dependencies * debian/apt.cron.daily: - sleep random amount of time (default within 0-30min) before starting the upate to hit the mirrors less hard -- cgit v1.2.3 From 85bd111a9b0778ba6e2b8950d369aeca192f9555 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 13 Mar 2008 23:19:10 +0100 Subject: cmdline/apt-get.cc: - install tasks in two passes, first without dependency auto-install, the with it. this ensure that we do not run in a situation were a task packages A dependens on B|C and C is part of the task but B gets installed too because of the greedy nature of apt --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index da4779f8b..5a4051f4d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,7 +19,8 @@ apt (0.7.12) UNRELEASED; urgency=low - remember hosts with Resolve failures or connect Timeouts * cmdline/apt-get.cc: - fix incorrect help output for -f (LP: #57487) - - run the problemResolver after a task was installed + - do two passes when installing tasks, first ignoring dependencies, + then resolving them and run the problemResolver at the end so that it can correct any missing dependencies * debian/apt.cron.daily: - sleep random amount of time (default within 0-30min) before -- cgit v1.2.3