Просмотр исходного кода

* merge from apt--mvo (fix resource leak, run apt.cron.daily only if
apt-get check is successfull)

Michael Vogt лет назад: 19
Родитель
Сommit
312764930f
3 измененных файлов с 12 добавлено и 1 удалено
  1. 4 1
      apt-pkg/deb/dpkgpm.cc
  2. 6 0
      debian/apt.cron.daily
  3. 2 0
      debian/changelog

+ 4 - 1
apt-pkg/deb/dpkgpm.cc

@@ -864,8 +864,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)

+ 6 - 0
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

+ 2 - 0
debian/changelog

@@ -42,6 +42,8 @@ apt (0.7.7) UNRELEASED; urgency=low
       (thanks to Laurent Bigonville)
   * apt-pkg/depcache.cc:
     - set "APT::Install-Recommends" to true by default (OMG!)
+  * debian/apt.cron.daily:
+    - only run the cron job if apt-get check succeeds (LP: #131719)
   
   [ Program translations ]
     - French updated