Преглед изворни кода

merge with lp:~mvo/apt/debian-sid

David Kalnischkies пре 17 година
родитељ
комит
ef1dff9320
13 измењених фајлова са 775 додато и 615 уклоњено
  1. 1 1
      apt-pkg/cachefile.cc
  2. 1 0
      apt-pkg/init.cc
  3. 50 1
      apt-pkg/policy.cc
  4. 1 0
      apt-pkg/policy.h
  5. 2 2
      cmdline/apt-cache.cc
  6. 7 0
      debian/apt.cron.daily
  7. 1 0
      debian/apt.dirs
  8. 10 3
      debian/changelog
  9. 1 1
      debian/control
  10. 6 2
      doc/examples/configure-index
  11. 250 199
      po/ast.po
  12. 197 191
      po/de.po
  13. 248 215
      po/fr.po

+ 1 - 1
apt-pkg/cachefile.cc

@@ -91,7 +91,7 @@ bool pkgCacheFile::Open(OpProgress &Progress,bool WithLock)
    Policy = new pkgPolicy(Cache);
    if (_error->PendingError() == true)
       return false;
-   if (ReadPinFile(*Policy) == false)
+   if (ReadPinFile(*Policy) == false || ReadPinDir(*Policy) == false)
       return false;
    
    // Create the dependency cache

+ 1 - 0
apt-pkg/init.cc

@@ -67,6 +67,7 @@ bool pkgInitConfig(Configuration &Cnf)
    Cnf.Set("Dir::Etc::main","apt.conf");
    Cnf.Set("Dir::Etc::parts","apt.conf.d");
    Cnf.Set("Dir::Etc::preferences","preferences");
+   Cnf.Set("Dir::Etc::preferencesparts","preferences.d");
    Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods");
 
    // State   

+ 50 - 1
apt-pkg/policy.cc

@@ -32,6 +32,9 @@
     
 #include <apti18n.h>
 
+#include <dirent.h>
+#include <sys/stat.h>
+#include <algorithm>
 #include <iostream>
 #include <sstream>
 									/*}}}*/
@@ -262,6 +265,52 @@ class PreferenceSection : public pkgTagSection
    }
 };
 									/*}}}*/
+// ReadPinDir - Load the pin files from this dir into a Policy		/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+bool ReadPinDir(pkgPolicy &Plcy,string Dir)
+{
+   if (Dir.empty() == true)
+      Dir = _config->FindDir("Dir::Etc::PreferencesParts");
+
+   DIR *D = opendir(Dir.c_str());
+   if (D == 0)
+      return _error->Errno("opendir",_("Unable to read %s"),Dir.c_str());
+
+   vector<string> List;
+
+   for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D))
+   {
+      if (Ent->d_name[0] == '.')
+	 continue;
+
+      // Skip bad file names ala run-parts
+      const char *C = Ent->d_name;
+      for (; *C != 0; C++)
+	 if (isalpha(*C) == 0 && isdigit(*C) == 0 && *C != '_' && *C != '-')
+	    break;
+      if (*C != 0)
+	 continue;
+
+      // Make sure it is a file and not something else
+      string File = flCombine(Dir,Ent->d_name);
+      struct stat St;
+      if (stat(File.c_str(),&St) != 0 || S_ISREG(St.st_mode) == 0)
+	 continue;
+
+      List.push_back(File);
+   }
+   closedir(D);
+
+   sort(List.begin(),List.end());
+
+   // Read the files
+   for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+      if (ReadPinFile(Plcy, *I) == false)
+	 return false;
+   return true;
+}
+									/*}}}*/
 // ReadPinFile - Load the pin file into a Policy			/*{{{*/
 // ---------------------------------------------------------------------
 /* I'd like to see the preferences file store more than just pin information
@@ -286,7 +335,7 @@ bool ReadPinFile(pkgPolicy &Plcy,string File)
    {
       string Name = Tags.FindS("Package");
       if (Name.empty() == true)
-	 return _error->Error(_("Invalid record in the preferences file, no Package header"));
+	 return _error->Error(_("Invalid record in the preferences file %s, no Package header"), File.c_str());
       if (Name == "*")
 	 Name = string();
       

+ 1 - 0
apt-pkg/policy.h

@@ -84,5 +84,6 @@ class pkgPolicy : public pkgDepCache::Policy
 };
 
 bool ReadPinFile(pkgPolicy &Plcy,string File = "");
+bool ReadPinDir(pkgPolicy &Plcy,string Dir = "");
 
 #endif

+ 2 - 2
cmdline/apt-cache.cc

@@ -401,7 +401,7 @@ bool DumpAvail(CommandLine &Cmd)
    pkgCache &Cache = *GCache;
 
    pkgPolicy Plcy(&Cache);
-   if (ReadPinFile(Plcy) == false)
+   if (ReadPinFile(Plcy) == false || ReadPinDir(Plcy) == false)
       return false;
    
    unsigned long Count = Cache.HeaderP->PackageCount+1;
@@ -1511,7 +1511,7 @@ bool Policy(CommandLine &CmdL)
    
    pkgCache &Cache = *GCache;
    pkgPolicy Plcy(&Cache);
-   if (ReadPinFile(Plcy) == false)
+   if (ReadPinFile(Plcy) == false || ReadPinDir(Plcy) == false)
       return false;
    
    // Print out all of the package files

+ 7 - 0
debian/apt.cron.daily

@@ -76,6 +76,13 @@ check_stamp()
     #echo "stampfile: $1"
     #echo "interval=$interval, now=$now, stamp=$stamp, delta=$delta"
 
+    # remove timestamps a day (or more) in the future and force re-check
+    if [ $stamp -gt $(($now+86400)) ]; then
+         echo "WARNING: file $stamp_file has a timestamp in the future: $stamp"
+         rm -f "$stamp_file"
+         return 0
+    fi
+
     if [ $delta -ge $interval ]; then
         return 0
     fi

+ 1 - 0
debian/apt.dirs

@@ -3,6 +3,7 @@ usr/lib/apt/methods
 usr/lib/dpkg/methods/apt
 etc/apt
 etc/apt/apt.conf.d
+etc/apt/preferences.d
 etc/apt/sources.list.d
 etc/logrotate.d
 var/cache/apt/archives/partial

+ 10 - 3
debian/changelog

@@ -13,9 +13,10 @@ apt (0.7.22) UNRELEASED; urgency=low
     - fr.po
     - it.po. Closes: #531758
     - ca.po. Closes: #531921
+    - de.po. Closes: #536430
   * Added translations
     - ast.po (Asturian by Marcos Alvareez Costales).
-      Closes: #529007, #529730
+      Closes: #529007, #529730, #535328
   
   [ David Kalnischkies ]
   * [ABI break] support '#' in apt.conf and /etc/apt/preferences
@@ -41,13 +42,19 @@ apt (0.7.22) UNRELEASED; urgency=low
 
   [ Michael Vogt ]
   * honor the dpkg hold state in new Marker hooks (closes: #64141)
-  
+  * debian/apt.cron.daily:
+    - if the timestamp is too far in the future, delete it
+
   [ Julian Andres Klode ]
   * apt-pkg/contrib/configuration.cc: Fix a small memory leak in
     ReadConfigFile.
   * Introduce support for the Enhances field. (Closes: #137583) 
+  * Support /etc/apt/preferences.d, by adding ReadPinDir() (Closes: #535512)
+  * configure-index: document Dir::Etc::SourceParts and some other options
+    (Closes: #459605)
+  * Remove Eugene V. Lyubimkin from uploaders as requested.
 
- -- Christian Perrier <bubulle@debian.org>  Wed, 22 Apr 2009 10:13:54 +0200
+ -- Julian Andres Klode <jak@debian.org>  Fri, 03 Jul 2009 08:27:35 +0200
 
 apt (0.7.21) unstable; urgency=low
 

+ 1 - 1
debian/control

@@ -4,7 +4,7 @@ Priority: important
 Maintainer: APT Development Team <deity@lists.debian.org>
 Uploaders: Michael Vogt <mvo@debian.org>, Otavio Salvador <otavio@debian.org>,
  Christian Perrier <bubulle@debian.org>, Daniel Burrows <dburrows@debian.org>,
- Luca Bruno <lethalman88@gmail.com>, Eugene V. Lyubimkin <jackyf.devel@gmail.com>
+ Luca Bruno <lethalman88@gmail.com>
 Standards-Version: 3.8.1.0
 Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5), debiandoc-sgml, docbook-utils (>= 0.6.12), xsltproc, docbook-xsl, xmlto
 Vcs-Bzr: http://bzr.debian.org/apt/debian-sid/

+ 6 - 2
doc/examples/configure-index

@@ -220,10 +220,14 @@ Dir "/"
   
   // Config files
   Etc "etc/apt/" {
-     SourceList "sources.list";
      Main "apt.conf";
-     Preferences "preferences";     
      Parts "apt.conf.d/";
+     Preferences "preferences";
+     PreferencesParts "preferences.d";
+     SourceList "sources.list";
+     SourceParts "sources.list.d";
+     VendorList "vendors.list";
+     VendorParts "vendors.list.d";
   };
   
   // Locations of binaries

Разлика између датотеке није приказан због своје велике величине
+ 250 - 199
po/ast.po


Разлика између датотеке није приказан због своје велике величине
+ 197 - 191
po/de.po


Разлика између датотеке није приказан због своје велике величине
+ 248 - 215
po/fr.po