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-70-g09d2 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 ++ doc/apt_preferences.5.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (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 diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 3f8d4568d..c55bb4ee2 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -184,7 +184,7 @@ belonging to any distribution whose Archive name is "unstable Package: * Pin: release a=unstable -Pin-Priority: 500 +Pin-Priority: 50 The following record assigns a high priority to all package versions -- cgit v1.2.3-70-g09d2 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) --- cmdline/apt-get.cc | 2 +- debian/changelog | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 11a8b2ef4..920e5e2ec 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2635,7 +2635,7 @@ bool ShowHelp(CommandLine &CmdL) " -d Download only - do NOT install or unpack archives\n" " -s No-act. Perform ordering simulation\n" " -y Assume Yes to all queries and do not prompt\n" - " -f Attempt to continue if the integrity check fails\n" + " -f Attempt to correct a system with broken dependencies in place\n" " -m Attempt to continue if archives are unlocatable\n" " -u Show a list of upgraded packages as well\n" " -b Build the source package after fetching it\n" 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-70-g09d2 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 --- cmdline/apt-get.cc | 5 ++++- debian/changelog | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 920e5e2ec..fe9416f1a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1506,10 +1506,13 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, buf[end-start] = 0x0; if (regexec(&Pattern,buf,0,0,0) != 0) continue; - res &= TryToInstall(Pkg,Cache,Fix,Remove,false,ExpectedInst); + res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst); found = true; } + // now let the problem resolver deal with any issues + Fix.Resolve(true); + if(!found) _error->Error(_("Couldn't find task %s"),taskname); 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-70-g09d2 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 --- cmdline/apt-get.cc | 29 +++++++++++++++++------------ debian/changelog | 3 ++- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'debian') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index fe9416f1a..3f9a5b248 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1495,19 +1495,24 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, bool found = false; bool res = true; - for (Pkg = Cache.PkgBegin(); Pkg.end() == false; Pkg++) + + // two runs, first ignore dependencies, second install any missing + for(int IgnoreBroken=1; IgnoreBroken >= 0; IgnoreBroken--) { - pkgCache::VerIterator ver = Cache[Pkg].CandidateVerIter(Cache); - if(ver.end()) - continue; - pkgRecords::Parser &parser = Recs.Lookup(ver.FileList()); - parser.GetRec(start,end); - strncpy(buf, start, end-start); - buf[end-start] = 0x0; - if (regexec(&Pattern,buf,0,0,0) != 0) - continue; - res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst); - found = true; + for (Pkg = Cache.PkgBegin(); Pkg.end() == false; Pkg++) + { + pkgCache::VerIterator ver = Cache[Pkg].CandidateVerIter(Cache); + if(ver.end()) + continue; + pkgRecords::Parser &parser = Recs.Lookup(ver.FileList()); + parser.GetRec(start,end); + strncpy(buf, start, end-start); + buf[end-start] = 0x0; + if (regexec(&Pattern,buf,0,0,0) != 0) + continue; + res &= TryToInstall(Pkg,Cache,Fix,Remove,IgnoreBroken,ExpectedInst); + found = true; + } } // now let the problem resolver deal with any issues 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-70-g09d2