From e15dcd38afd712c1c935339e533c72cd8f0f70bb Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 12 Oct 2007 18:03:18 +0200 Subject: * debian/apt.cron.daily: - only run the cron job if apt-get check succeeds (LP: #131719) --- debian/apt.cron.daily | 6 ++++++ debian/changelog | 2 ++ 2 files changed, 8 insertions(+) diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily index 34d6b164f..5524c16ee 100644 --- a/debian/apt.cron.daily +++ b/debian/apt.cron.daily @@ -170,6 +170,12 @@ if which on_ac_power >/dev/null; then fi fi +# check if we can lock the cache and if the cache is clean +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 if apt-get -qq update 2>/dev/null; then diff --git a/debian/changelog b/debian/changelog index d43fb9861..e1f037350 100644 --- a/debian/changelog +++ b/debian/changelog @@ -40,6 +40,8 @@ apt (0.7.7) UNRELEASED; urgency=low * cmdline/apt-mark: - Fix chmoding after have renamed the extended-states file (LP: #140019) (thanks to Laurent Bigonville) + * debian/apt.cron.daily: + - only run the cron job if apt-get check succeeds (LP: #131719) [ Program translations ] - French updated -- cgit v1.2.3 From 477b5d6cacb53e868ec182330ffdcc3678a98560 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 15 Oct 2007 21:23:04 +0200 Subject: apt-pkg/deb/dpkgpm.cc: - fix resource leak --- apt-pkg/deb/dpkgpm.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 92f96620f..3235b0b06 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -841,8 +841,11 @@ bool pkgDPkgPM::Go(int OutStatusFd) signal(SIGQUIT,old_SIGQUIT); signal(SIGINT,old_SIGINT); - if(master >= 0 && slave >= 0) + if(master >= 0) + { tcsetattr(0, TCSAFLUSH, &tt); + close(master); + } // Check for an error code. if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0) -- cgit v1.2.3