Selaa lähdekoodia

Merge remote-tracking branch 'donkult/debian/sid' into debian/sid

Conflicts:
	apt-private/private-list.cc
	doc/po/de.po
	test/integration/framework
Michael Vogt 12 vuotta sitten
vanhempi
commit
796673c385

+ 9 - 11
apt-inst/dirstream.cc

@@ -20,7 +20,6 @@
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <errno.h>
-#include <utime.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/
@@ -93,19 +92,18 @@ bool pkgDirStream::FinishedFile(Item &Itm,int Fd)
 {
 {
    if (Fd < 0)
    if (Fd < 0)
       return true;
       return true;
-   
-   if (close(Fd) != 0)
-      return _error->Errno("close",_("Failed to close file %s"),Itm.Name);
 
 
    /* Set the modification times. The only way it can fail is if someone
    /* Set the modification times. The only way it can fail is if someone
       has futzed with our file, which is intolerable :> */
       has futzed with our file, which is intolerable :> */
-   struct utimbuf Time;
-   Time.actime = Itm.MTime;
-   Time.modtime = Itm.MTime;
-   if (utime(Itm.Name,&Time) != 0)
-      _error->Errno("utime",_("Failed to close file %s"),Itm.Name);
-   
-   return true;   
+   struct timespec times[2];
+   times[0].tv_sec = times[1].tv_sec = Itm.MTime;
+   times[0].tv_nsec = times[1].tv_nsec = 0;
+   if (futimens(Fd, times) != 0)
+      _error->Errno("futimens", "Failed to set modification time for %s",Itm.Name);
+
+   if (close(Fd) != 0)
+      return _error->Errno("close",_("Failed to close file %s"),Itm.Name);
+   return true;
 }
 }
 									/*}}}*/
 									/*}}}*/
 // DirStream::Fail - Failed processing a file				/*{{{*/
 // DirStream::Fail - Failed processing a file				/*{{{*/

+ 2 - 2
apt-pkg/aptconfiguration.cc

@@ -141,7 +141,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
 	// so they will be all included in the Cache.
 	// so they will be all included in the Cache.
 	std::vector<string> builtin;
 	std::vector<string> builtin;
 	DIR *D = opendir(_config->FindDir("Dir::State::lists").c_str());
 	DIR *D = opendir(_config->FindDir("Dir::State::lists").c_str());
-	if (D != 0) {
+	if (D != NULL) {
 		builtin.push_back("none");
 		builtin.push_back("none");
 		for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) {
 		for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) {
 			string const name = SubstVar(Ent->d_name, "%5f", "_");
 			string const name = SubstVar(Ent->d_name, "%5f", "_");
@@ -166,8 +166,8 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
 				continue;
 				continue;
 			builtin.push_back(c);
 			builtin.push_back(c);
 		}
 		}
+		closedir(D);
 	}
 	}
-	closedir(D);
 
 
 	// FIXME: Remove support for the old APT::Acquire::Translation
 	// FIXME: Remove support for the old APT::Acquire::Translation
 	// it was undocumented and so it should be not very widthly used
 	// it was undocumented and so it should be not very widthly used

+ 2 - 0
apt-pkg/cacheset.cc

@@ -73,6 +73,8 @@ bool PackageContainerInterface::FromTask(PackageContainerInterface * const pci,
 		const char *start, *end;
 		const char *start, *end;
 		parser.GetRec(start,end);
 		parser.GetRec(start,end);
 		unsigned int const length = end - start;
 		unsigned int const length = end - start;
+		if (unlikely(length == 0))
+		   continue;
 		char buf[length];
 		char buf[length];
 		strncpy(buf, start, length);
 		strncpy(buf, start, length);
 		buf[length-1] = '\0';
 		buf[length-1] = '\0';

+ 1 - 1
apt-pkg/contrib/fileutl.cc

@@ -319,7 +319,7 @@ bool CreateDirectory(string const &Parent, string const &Path)
       return false;
       return false;
 
 
    // we are not going to create directories "into the blue"
    // we are not going to create directories "into the blue"
-   if (Path.find(Parent, 0) != 0)
+   if (Path.compare(0, Parent.length(), Parent) != 0)
       return false;
       return false;
 
 
    vector<string> const dirs = VectorizeString(Path.substr(Parent.size()), '/');
    vector<string> const dirs = VectorizeString(Path.substr(Parent.size()), '/');

+ 5 - 6
apt-pkg/contrib/gpgv.cc

@@ -103,12 +103,12 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
       }
       }
    }
    }
 
 
+   enum  { DETACHED, CLEARSIGNED } releaseSignature = (FileGPG != File) ? DETACHED : CLEARSIGNED;
    std::vector<std::string> dataHeader;
    std::vector<std::string> dataHeader;
    char * sig = NULL;
    char * sig = NULL;
    char * data = NULL;
    char * data = NULL;
 
 
-   // file with detached signature
-   if (FileGPG != File)
+   if (releaseSignature == DETACHED)
    {
    {
       Args.push_back(FileGPG.c_str());
       Args.push_back(FileGPG.c_str());
       Args.push_back(File.c_str());
       Args.push_back(File.c_str());
@@ -181,7 +181,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
       putenv((char *)"LC_MESSAGES=");
       putenv((char *)"LC_MESSAGES=");
    }
    }
 
 
-   if (FileGPG != File)
+   if (releaseSignature == DETACHED)
    {
    {
       execvp(gpgvpath.c_str(), (char **) &Args[0]);
       execvp(gpgvpath.c_str(), (char **) &Args[0]);
       ioprintf(std::cerr, "Couldn't execute %s to check %s", Args[0], File.c_str());
       ioprintf(std::cerr, "Couldn't execute %s to check %s", Args[0], File.c_str());
@@ -260,8 +260,7 @@ bool SplitClearSignedFile(std::string const &InFile, FileFd * const ContentFile,
 
 
    char *buf = NULL;
    char *buf = NULL;
    size_t buf_size = 0;
    size_t buf_size = 0;
-   ssize_t line_len = 0;
-   while ((line_len = getline(&buf, &buf_size, in)) != -1)
+   while (getline(&buf, &buf_size, in) != -1)
    {
    {
       _strrstrip(buf);
       _strrstrip(buf);
       if (found_message_start == false)
       if (found_message_start == false)
@@ -355,7 +354,7 @@ bool OpenMaybeClearSignedFile(std::string const &ClearSignedFileName, FileFd &Me
       return _error->Error("Couldn't open temporary file to work with %s", ClearSignedFileName.c_str());
       return _error->Error("Couldn't open temporary file to work with %s", ClearSignedFileName.c_str());
 
 
    _error->PushToStack();
    _error->PushToStack();
-   bool const splitDone = SplitClearSignedFile(ClearSignedFileName.c_str(), &MessageFile, NULL, NULL);
+   bool const splitDone = SplitClearSignedFile(ClearSignedFileName, &MessageFile, NULL, NULL);
    bool const errorDone = _error->PendingError();
    bool const errorDone = _error->PendingError();
    _error->MergeWithStack();
    _error->MergeWithStack();
    if (splitDone == false)
    if (splitDone == false)

+ 2 - 3
apt-pkg/contrib/hashes.cc

@@ -129,13 +129,12 @@ bool Hashes::AddFD(int const Fd,unsigned long long Size, bool const addMD5,
 		   bool const addSHA1, bool const addSHA256, bool const addSHA512)
 		   bool const addSHA1, bool const addSHA256, bool const addSHA512)
 {
 {
    unsigned char Buf[64*64];
    unsigned char Buf[64*64];
-   ssize_t Res = 0;
-   int ToEOF = (Size == 0);
+   bool const ToEOF = (Size == 0);
    while (Size != 0 || ToEOF)
    while (Size != 0 || ToEOF)
    {
    {
       unsigned long long n = sizeof(Buf);
       unsigned long long n = sizeof(Buf);
       if (!ToEOF) n = std::min(Size, n);
       if (!ToEOF) n = std::min(Size, n);
-      Res = read(Fd,Buf,n);
+      ssize_t const Res = read(Fd,Buf,n);
       if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read
       if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read
 	 return false;
 	 return false;
       if (ToEOF && Res == 0) // EOF
       if (ToEOF && Res == 0) // EOF

+ 3 - 4
apt-pkg/contrib/hashsum.cc

@@ -9,13 +9,12 @@
 /* */
 /* */
 bool SummationImplementation::AddFD(int const Fd, unsigned long long Size) {
 bool SummationImplementation::AddFD(int const Fd, unsigned long long Size) {
    unsigned char Buf[64 * 64];
    unsigned char Buf[64 * 64];
-   ssize_t Res = 0;
-   int ToEOF = (Size == 0);
+   bool const ToEOF = (Size == 0);
    while (Size != 0 || ToEOF)
    while (Size != 0 || ToEOF)
    {
    {
       unsigned long long n = sizeof(Buf);
       unsigned long long n = sizeof(Buf);
       if (!ToEOF) n = std::min(Size, n);
       if (!ToEOF) n = std::min(Size, n);
-      Res = read(Fd, Buf, n);
+      ssize_t const Res = read(Fd, Buf, n);
       if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read
       if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read
 	 return false;
 	 return false;
       if (ToEOF && Res == 0) // EOF
       if (ToEOF && Res == 0) // EOF
@@ -27,7 +26,7 @@ bool SummationImplementation::AddFD(int const Fd, unsigned long long Size) {
 }
 }
 bool SummationImplementation::AddFD(FileFd &Fd, unsigned long long Size) {
 bool SummationImplementation::AddFD(FileFd &Fd, unsigned long long Size) {
    unsigned char Buf[64 * 64];
    unsigned char Buf[64 * 64];
-   bool ToEOF = (Size == 0);
+   bool const ToEOF = (Size == 0);
    while (Size != 0 || ToEOF)
    while (Size != 0 || ToEOF)
    {
    {
       unsigned long long n = sizeof(Buf);
       unsigned long long n = sizeof(Buf);

+ 7 - 1
apt-pkg/contrib/mmap.cc

@@ -352,6 +352,12 @@ unsigned long DynamicMMap::RawAllocate(unsigned long long Size,unsigned long Aln
    size in the file. */
    size in the file. */
 unsigned long DynamicMMap::Allocate(unsigned long ItemSize)
 unsigned long DynamicMMap::Allocate(unsigned long ItemSize)
 {
 {
+   if (unlikely(ItemSize == 0))
+   {
+      _error->Fatal("Can't allocate an item of size zero");
+      return 0;
+   }
+
    // Look for a matching pool entry
    // Look for a matching pool entry
    Pool *I;
    Pool *I;
    Pool *Empty = 0;
    Pool *Empty = 0;
@@ -412,7 +418,7 @@ unsigned long DynamicMMap::WriteString(const char *String,
 
 
    unsigned long const Result = RawAllocate(Len+1,0);
    unsigned long const Result = RawAllocate(Len+1,0);
 
 
-   if (Result == 0 && _error->PendingError())
+   if (Base == NULL || (Result == 0 && _error->PendingError()))
       return 0;
       return 0;
 
 
    memcpy((char *)Base + Result,String,Len);
    memcpy((char *)Base + Result,String,Len);

+ 3 - 6
apt-pkg/deb/dpkgpm.cc

@@ -568,7 +568,6 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line)
    std::string prefix = APT::String::Strip(list[0]);
    std::string prefix = APT::String::Strip(list[0]);
    std::string pkgname;
    std::string pkgname;
    std::string action;
    std::string action;
-   ostringstream status;
 
 
    // "processing" has the form "processing: action: pkg or trigger"
    // "processing" has the form "processing: action: pkg or trigger"
    // with action = ["install", "configure", "remove", "purge", "disappear",
    // with action = ["install", "configure", "remove", "purge", "disappear",
@@ -1662,7 +1661,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
    io_errors.push_back(string("failed in write on buffer copy for %s"));
    io_errors.push_back(string("failed in write on buffer copy for %s"));
    io_errors.push_back(string("short read on buffer copy for %s"));
    io_errors.push_back(string("short read on buffer copy for %s"));
 
 
-   for (vector<string>::iterator I = io_errors.begin(); I != io_errors.end(); I++)
+   for (vector<string>::iterator I = io_errors.begin(); I != io_errors.end(); ++I)
    {
    {
       vector<string> list = VectorizeString(dgettext("dpkg", (*I).c_str()), '%');
       vector<string> list = VectorizeString(dgettext("dpkg", (*I).c_str()), '%');
       if (list.size() > 1) {
       if (list.size() > 1) {
@@ -1777,13 +1776,11 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
    string histfile_name = _config->FindFile("Dir::Log::History");
    string histfile_name = _config->FindFile("Dir::Log::History");
    if (!histfile_name.empty())
    if (!histfile_name.empty())
    {
    {
-      FILE *log = NULL;
-      char buf[1024];
-
       fprintf(report, "DpkgHistoryLog:\n");
       fprintf(report, "DpkgHistoryLog:\n");
-      log = fopen(histfile_name.c_str(),"r");
+      FILE* log = fopen(histfile_name.c_str(),"r");
       if(log != NULL)
       if(log != NULL)
       {
       {
+	 char buf[1024];
 	 while( fgets(buf, sizeof(buf), log) != NULL)
 	 while( fgets(buf, sizeof(buf), log) != NULL)
 	    fprintf(report, " %s", buf);
 	    fprintf(report, " %s", buf);
 	 fclose(log);
 	 fclose(log);

+ 1 - 1
apt-pkg/install-progress.cc

@@ -242,7 +242,7 @@ PackageManagerFancy::~PackageManagerFancy()
 void PackageManagerFancy::staticSIGWINCH(int signum)
 void PackageManagerFancy::staticSIGWINCH(int signum)
 {
 {
    std::vector<PackageManagerFancy *>::const_iterator I;
    std::vector<PackageManagerFancy *>::const_iterator I;
-   for(I = instances.begin(); I != instances.end(); I++)
+   for(I = instances.begin(); I != instances.end(); ++I)
       (*I)->HandleSIGWINCH(signum);
       (*I)->HandleSIGWINCH(signum);
 }
 }
 
 

+ 6 - 6
apt-private/private-list.cc

@@ -61,7 +61,7 @@ class PackageNameMatcher : public Matcher				/*{{{*/
   public:
   public:
    PackageNameMatcher(const char **patterns)
    PackageNameMatcher(const char **patterns)
    {
    {
-      for(int i=0; patterns[i] != NULL; i++)
+      for(int i=0; patterns[i] != NULL; ++i)
       {
       {
          std::string pattern = patterns[i];
          std::string pattern = patterns[i];
 #ifdef PACKAGE_MATCHER_ABI_COMPAT
 #ifdef PACKAGE_MATCHER_ABI_COMPAT
@@ -79,12 +79,12 @@ class PackageNameMatcher : public Matcher				/*{{{*/
    }
    }
    virtual ~PackageNameMatcher()
    virtual ~PackageNameMatcher()
    {
    {
-      for(J=filters.begin(); J != filters.end(); J++)
+      for(J=filters.begin(); J != filters.end(); ++J)
          delete *J;
          delete *J;
    }
    }
    virtual bool operator () (const pkgCache::PkgIterator &P) 
    virtual bool operator () (const pkgCache::PkgIterator &P) 
    {
    {
-      for(J=filters.begin(); J != filters.end(); J++)
+      for(J=filters.begin(); J != filters.end(); ++J)
       {
       {
          APT::CacheFilter::PackageMatcher *cachefilter = *J;
          APT::CacheFilter::PackageMatcher *cachefilter = *J;
          if((*cachefilter)(P)) 
          if((*cachefilter)(P)) 
@@ -105,7 +105,7 @@ void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records,	/*{{{*/
                      bool include_summary=true)
                      bool include_summary=true)
 {
 {
    for (pkgCache::VerIterator Ver = P.VersionList();
    for (pkgCache::VerIterator Ver = P.VersionList();
-        Ver.end() == false; Ver++) 
+        Ver.end() == false; ++Ver)
    {
    {
       ListSingleVersion(CacheFile, records, Ver, outs, include_summary);
       ListSingleVersion(CacheFile, records, Ver, outs, include_summary);
       outs << "\n";
       outs << "\n";
@@ -146,7 +146,7 @@ bool List(CommandLine &Cmd)
                             Cache->Head().PackageCount,
                             Cache->Head().PackageCount,
                             _("Listing"));
                             _("Listing"));
    GetLocalitySortedVersionSet(CacheFile, bag, matcher, progress);
    GetLocalitySortedVersionSet(CacheFile, bag, matcher, progress);
-   for (LocalitySortedVersionSet::iterator V = bag.begin(); V != bag.end(); V++)
+   for (LocalitySortedVersionSet::iterator V = bag.begin(); V != bag.end(); ++V)
    {
    {
       std::stringstream outs;
       std::stringstream outs;
       if(_config->FindB("APT::Cmd::All-Versions", false) == true)
       if(_config->FindB("APT::Cmd::All-Versions", false) == true)
@@ -163,7 +163,7 @@ bool List(CommandLine &Cmd)
 
 
    // FIXME: SORT! and make sorting flexible (alphabetic, by pkg status)
    // FIXME: SORT! and make sorting flexible (alphabetic, by pkg status)
    // output the sorted map
    // output the sorted map
-   for (K = output_map.begin(); K != output_map.end(); K++)
+   for (K = output_map.begin(); K != output_map.end(); ++K)
       std::cout << (*K).second << std::endl;
       std::cout << (*K).second << std::endl;
 
 
 
 

+ 4 - 4
apt-private/private-search.cc

@@ -61,18 +61,18 @@ bool FullTextSearch(CommandLine &CmdL)					/*{{{*/
    progress.OverallProgress(50, 100, 50,  _("Full Text Search"));
    progress.OverallProgress(50, 100, 50,  _("Full Text Search"));
    progress.SubProgress(bag.size());
    progress.SubProgress(bag.size());
    int Done = 0;
    int Done = 0;
-   for ( ;V != bag.end(); V++)
+   for ( ;V != bag.end(); ++V)
    {
    {
       if (Done%500 == 0)
       if (Done%500 == 0)
          progress.Progress(Done);
          progress.Progress(Done);
-      Done++;
+      ++Done;
       
       
       int i;
       int i;
       pkgCache::DescIterator Desc = V.TranslatedDescription();
       pkgCache::DescIterator Desc = V.TranslatedDescription();
       pkgRecords::Parser &parser = records.Lookup(Desc.FileList());
       pkgRecords::Parser &parser = records.Lookup(Desc.FileList());
      
      
       bool all_found = true;
       bool all_found = true;
-      for(i=0; patterns[i] != NULL; i++) 
+      for(i=0; patterns[i] != NULL; ++i)
       {
       {
          // FIXME: use regexp instead of simple find()
          // FIXME: use regexp instead of simple find()
          const char *pattern = patterns[i];
          const char *pattern = patterns[i];
@@ -93,7 +93,7 @@ bool FullTextSearch(CommandLine &CmdL)					/*{{{*/
 
 
    // FIXME: SORT! and make sorting flexible (alphabetic, by pkg status)
    // FIXME: SORT! and make sorting flexible (alphabetic, by pkg status)
    // output the sorted map
    // output the sorted map
-   for (K = output_map.begin(); K != output_map.end(); K++)
+   for (K = output_map.begin(); K != output_map.end(); ++K)
       std::cout << (*K).second << std::endl;
       std::cout << (*K).second << std::endl;
 
 
    return true;
    return true;

+ 14 - 13
cmdline/apt-key.in

@@ -5,22 +5,23 @@ unset GREP_OPTIONS
 
 
 GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring"
 GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring"
 
 
-# gpg needs a trustdb to function, but it can't be invalid (not even empty)
-# so we create a temporary directory to store our fresh readable trustdb in
-TRUSTDBDIR="$(mktemp -d)"
-CURRENTTRAP="${CURRENTTRAP} rm -rf '${TRUSTDBDIR}';"
+# gpg needs (in different versions more or less) files to function correctly,
+# so we give it its own homedir and generate some valid content for it
+GPGHOMEDIR="$(mktemp -d)"
+CURRENTTRAP="${CURRENTTRAP} rm -rf '${GPGHOMEDIR}';"
 trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
 trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
-chmod 700 "$TRUSTDBDIR"
-# We also don't use a secret keyring, of course, but gpg panics and
+chmod 700 "$GPGHOMEDIR"
+# We don't use a secret keyring, of course, but gpg panics and
 # implodes if there isn't one available - and writeable for imports
 # implodes if there isn't one available - and writeable for imports
-SECRETKEYRING="${TRUSTDBDIR}/secring.gpg"
+SECRETKEYRING="${GPGHOMEDIR}/secring.gpg"
 touch $SECRETKEYRING
 touch $SECRETKEYRING
-GPG_CMD="$GPG_CMD --secret-keyring $SECRETKEYRING"
-GPG_CMD="$GPG_CMD --trustdb-name ${TRUSTDBDIR}/trustdb.gpg"
-
-# now create the trustdb with an (empty) dummy keyring
-$GPG_CMD --quiet --check-trustdb --keyring $SECRETKEYRING
-# and make sure that gpg isn't trying to update the file
+GPG_CMD="$GPG_CMD --homedir $GPGHOMEDIR"
+# create the trustdb with an (empty) dummy keyring
+# older gpgs required it, newer gpgs even warn that it isn't needed,
+# but require it nontheless for some commands, so we just play safe
+# here for the foreseeable future and create a dummy one
+$GPG_CMD --quiet --check-trustdb --keyring $SECRETKEYRING >/dev/null 2>&1
+# tell gpg that it shouldn't try to maintain a trustdb file
 GPG_CMD="$GPG_CMD --no-auto-check-trustdb --trust-model always"
 GPG_CMD="$GPG_CMD --no-auto-check-trustdb --trust-model always"
 
 
 GPG="$GPG_CMD"
 GPG="$GPG_CMD"

+ 1 - 1
debian/control

@@ -9,7 +9,7 @@ Build-Depends: dpkg-dev (>= 1.15.8), debhelper (>= 8.1.3~), libdb-dev,
  gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.4~),
  gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.4~),
  zlib1g-dev, libbz2-dev, xsltproc, docbook-xsl, docbook-xml,
  zlib1g-dev, libbz2-dev, xsltproc, docbook-xsl, docbook-xml,
  po4a (>= 0.34-2), autotools-dev, autoconf, automake
  po4a (>= 0.34-2), autotools-dev, autoconf, automake
-Build-Depends-Indep: doxygen, debiandoc-sgml
+Build-Depends-Indep: doxygen, debiandoc-sgml, graphviz
 Build-Conflicts: autoconf2.13, automake1.4
 Build-Conflicts: autoconf2.13, automake1.4
 Vcs-Git: git://anonscm.debian.org/apt/apt.git
 Vcs-Git: git://anonscm.debian.org/apt/apt.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=apt/apt.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=apt/apt.git

+ 4 - 4
doc/Doxyfile.in

@@ -880,7 +880,7 @@ HTML_OUTPUT            = html
 # each generated HTML page (for example: .htm,.php,.asp). If it is left blank
 # each generated HTML page (for example: .htm,.php,.asp). If it is left blank
 # doxygen will generate files with .html extension.
 # doxygen will generate files with .html extension.
 
 
-HTML_FILE_EXTENSION    = .html
+HTML_FILE_EXTENSION    = .xhtml
 
 
 # The HTML_HEADER tag can be used to specify a personal HTML header for
 # The HTML_HEADER tag can be used to specify a personal HTML header for
 # each generated HTML page. If it is left blank doxygen will generate a
 # each generated HTML page. If it is left blank doxygen will generate a
@@ -1715,7 +1715,7 @@ DOT_NUM_THREADS        = 0
 # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
 # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
 # directory containing the font.
 # directory containing the font.
 
 
-DOT_FONTNAME           = FreeSans
+DOT_FONTNAME           =
 
 
 # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
 # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
 # The default size is 10pt.
 # The default size is 10pt.
@@ -1815,7 +1815,7 @@ DIRECTORY_GRAPH        = YES
 # HTML_FILE_EXTENSION to xhtml in order to make the SVG files
 # HTML_FILE_EXTENSION to xhtml in order to make the SVG files
 # visible in IE 9+ (other browsers do not have this requirement).
 # visible in IE 9+ (other browsers do not have this requirement).
 
 
-DOT_IMAGE_FORMAT       = png
+DOT_IMAGE_FORMAT       = svg
 
 
 # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
 # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
 # enable generation of interactive SVG images that allow zooming and panning.
 # enable generation of interactive SVG images that allow zooming and panning.
@@ -1824,7 +1824,7 @@ DOT_IMAGE_FORMAT       = png
 # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
 # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
 # visible. Older versions of IE do not have SVG support.
 # visible. Older versions of IE do not have SVG support.
 
 
-INTERACTIVE_SVG        = NO
+INTERACTIVE_SVG        = YES
 
 
 # The tag DOT_PATH can be used to specify the path where the dot tool can be
 # The tag DOT_PATH can be used to specify the path where the dot tool can be
 # found. If left blank, it is assumed the dot tool can be found in the path.
 # found. If left blank, it is assumed the dot tool can be found in the path.

+ 84 - 74
doc/po/de.po

@@ -1,14 +1,29 @@
-# Translation of apt-doc to German
-# Copyright (C) 1997, 1998, 1999 Jason Gunthorpe and others.
-# This file is distributed under the same license as the apt-doc package.
-# Chris Leick <c.leick@vollbio.de>, 2009-2012.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
 #
+#, fuzzy
 msgid ""
 msgid ""
 msgstr ""
 msgstr ""
-"Project-Id-Version: apt-doc 0.9.7\n"
-"Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n"
-"POT-Creation-Date: 2014-01-25 22:21+0100\n"
-"PO-Revision-Date: 2012-06-25 22:49+0100\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2014-01-26 08:14+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Translation of apt-doc to German
+#~ # Copyright (C) 1997, 1998, 1999 Jason Gunthorpe and others.
+#~ # This file is distributed under the same license as the apt-doc package.
+#~ # Chris Leick <c.leick@vollbio.de>, 2009-2014.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: apt-doc 0.9.14.2\n"
+#~ "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n"
+"POT-Creation-Date: 2014-01-24 12:29+0100\n"
+"PO-Revision-Date: 2014-01-21 20:59+0100\n"
 "Last-Translator: Chris Leick <c.leick@vollbio.de>\n"
 "Last-Translator: Chris Leick <c.leick@vollbio.de>\n"
 "Language-Team: German <debian-l10n-german@lists.debian.org>\n"
 "Language-Team: German <debian-l10n-german@lists.debian.org>\n"
 "Language: de\n"
 "Language: de\n"
@@ -1334,6 +1349,14 @@ msgid ""
 "will never remove packages, only allow adding new ones.  Configuration Item: "
 "will never remove packages, only allow adding new ones.  Configuration Item: "
 "<literal>APT::Get::Upgrade-Allow-New</literal>."
 "<literal>APT::Get::Upgrade-Allow-New</literal>."
 msgstr ""
 msgstr ""
+"erlaubt das Installieren neuer Pakete, wenn es zusammen mit "
+"<literal>upgrade</literal> benutzt wird. Dies ist nützlich, falls das "
+"Aktualisieren eines installierten Pakets zur Installation neue "
+"Abhängigkeiten hat. Anstatt das Paket zurückzuhalten, wird <literal>upgrade</"
+"literal> ein Upgrade des Pakets durchführen und die neuen Abhängigkeiten "
+"installieren. Beachten Sie, dass <literal>upgrade</literal> mit dieser "
+"Option niemals Pakete entfernen, sondern nur das Hinzufügen neuer gestatten "
+"wird.Konfigurationselement: <literal>APT::Get::Upgrade-Allow-New</literal>."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt-get.8.xml:407
 #: apt-get.8.xml:407
@@ -1553,6 +1576,7 @@ msgstr ""
 "fragen. Dies ist für Werkzeuge wie pbuilder nützlich. Konfigurationselement: "
 "fragen. Dies ist für Werkzeuge wie pbuilder nützlich. Konfigurationselement: "
 "<literal>APT::Get::AllowUnauthenticated</literal>."
 "<literal>APT::Get::AllowUnauthenticated</literal>."
 
 
+# FIXME s/Item/Items/
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt-get.8.xml:527
 #: apt-get.8.xml:527
 msgid ""
 msgid ""
@@ -1562,6 +1586,12 @@ msgid ""
 "Item: <literal>DpkgPM::Progress</literal> and <literal>Dpkg::Progress-Fancy</"
 "Item: <literal>DpkgPM::Progress</literal> and <literal>Dpkg::Progress-Fancy</"
 "literal>."
 "literal>."
 msgstr ""
 msgstr ""
+"zeigt benutzerfreundliche Fortschrittsinformationen im Terminalfenster, wenn "
+"Pakete installiert beziehungsweise entfernt werden oder ein Upgrade "
+"durchgeführt wird. Informationen über eine maschinell auswertbare Version "
+"dieser Daten finden Sie in README.progress-reporting im Apt-doc-Verzeichnis. "
+"Konfigurationselemente: <literal>DpkgPM::Progress</literal> und "
+"<literal>Dpkg::Progress-Fancy</literal>."
 
 
 #. type: Content of: <refentry><refsect1><title>
 #. type: Content of: <refentry><refsect1><title>
 #: apt-get.8.xml:540 apt-cache.8.xml:345 apt-key.8.xml:176 apt-mark.8.xml:127
 #: apt-get.8.xml:540 apt-cache.8.xml:345 apt-key.8.xml:176 apt-mark.8.xml:127
@@ -2900,20 +2930,14 @@ msgstr ""
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt-cdrom.8.xml:87
 #: apt-cdrom.8.xml:87
-#, fuzzy
-#| msgid ""
-#| "Mount point; specify the location to mount the CD-ROM. This mount point "
-#| "must be listed in <filename>/etc/fstab</filename> and properly "
-#| "configured.  Configuration Item: <literal>Acquire::cdrom::mount</literal>."
 msgid ""
 msgid ""
 "Do not try to auto-detect the CD-ROM path. Usually combined with the "
 "Do not try to auto-detect the CD-ROM path. Usually combined with the "
 "<option>--cdrom</option> option.  Configuration Item: <literal>Acquire::"
 "<option>--cdrom</option> option.  Configuration Item: <literal>Acquire::"
 "cdrom::AutoDetect</literal>."
 "cdrom::AutoDetect</literal>."
 msgstr ""
 msgstr ""
-"Einhängepunkt; gibt den Ort an, an dem die CD-ROM eingehängt wird. Dieser "
-"Einhängepunkt muss in <filename>/etc/fstab</filename> eingetragen und "
-"angemessen konfiguriert sein. Konfigurationselement: <literal>Acquire::"
-"cdrom::mount</literal>."
+"versucht nicht, den CD-ROM-Pfad automatisch zu bestimmen. Dies wird "
+"üblicherweise mit der Option <option>--cdrom</option> kombiniert. "
+"Konfigurationselement: <literal>Acquire::cdrom::AutoDetect</literal>."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt-cdrom.8.xml:95
 #: apt-cdrom.8.xml:95
@@ -3894,13 +3918,6 @@ msgstr ""
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:391
 #: apt.conf.5.xml:391
-#, fuzzy
-#| msgid ""
-#| "The used bandwidth can be limited with <literal>Acquire::http::Dl-Limit</"
-#| "literal> which accepts integer values in kilobytes. The default value is "
-#| "0 which deactivates the limit and tries to use all available bandwidth "
-#| "(note that this option implicitly disables downloading from multiple "
-#| "servers at the same time.)"
 msgid ""
 msgid ""
 "The used bandwidth can be limited with <literal>Acquire::http::Dl-Limit</"
 "The used bandwidth can be limited with <literal>Acquire::http::Dl-Limit</"
 "literal> which accepts integer values in kilobytes per second. The default "
 "literal> which accepts integer values in kilobytes per second. The default "
@@ -3909,11 +3926,11 @@ msgid ""
 "multiple servers at the same time."
 "multiple servers at the same time."
 msgstr ""
 msgstr ""
 "Die benutzte Bandbreite kann durch <literal>Acquire::http::Dl-Limit</"
 "Die benutzte Bandbreite kann durch <literal>Acquire::http::Dl-Limit</"
-"literal> eingeschränkt werden, was Ganzzahlwerte in Kilobyte akzeptiert. Der "
-"Vorgabewert ist 0, was die Beschränkung ausschaltet und versucht, sämtliche "
-"verfügbare Bandbreite zu benutzen. (Beachten Sie, dass diese Optionen "
-"implizit das Herunterladen von mehreren Servern zur gleichen Zeit "
-"deaktiviert.)"
+"literal> eingeschränkt werden, was Ganzzahlwerte in Kilobyte pro Sekunde "
+"akzeptiert. Der Vorgabewert ist 0, was die Beschränkung ausschaltet und "
+"versucht, sämtliche verfügbare Bandbreite zu benutzen. Beachten Sie, dass "
+"diese Optionen implizit das Herunterladen von mehreren Servern zur gleichen "
+"Zeit deaktiviert."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:398
 #: apt.conf.5.xml:398
@@ -3940,6 +3957,15 @@ msgid ""
 "takes precedence over the legacy option name <literal>ProxyAutoDetect</"
 "takes precedence over the legacy option name <literal>ProxyAutoDetect</"
 "literal>."
 "literal>."
 msgstr ""
 msgstr ""
+"<literal>Acquire::http::Proxy-Auto-Detect</literal> kann benutzt werden, um "
+"einen externen Befehl zum Auffinden des HTTP-Proxys anzugeben, der benutzt "
+"werden soll. APT erwartet den Befehl zum Ausgeben auf der Standardausgabe "
+"imStil <literal>http://proxy:port/</literal>. Dies wird das typische "
+"<literal>Acquire::http::Proxy</literal> außer Kraft setzen, aber keine "
+"spezielle per <literal>Acquire::http::Proxy::$HOST</literal> gesetzte Proxy-"
+"Rechnerkonfiguration. Eine Beispielimplementierung, die Avahi benutzt, "
+"finden Sie im Paket &squid-deb-proxy-client;. Diese Option hat Vorrang vor "
+"dem veralteten Optionsnamen <literal>ProxyAutoDetect</literal>."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:420
 #: apt.conf.5.xml:420
@@ -4330,12 +4356,12 @@ msgstr ""
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:576
 #: apt.conf.5.xml:576
 msgid "When downloading, force to use only the IPv4 protocol."
 msgid "When downloading, force to use only the IPv4 protocol."
-msgstr ""
+msgstr "Beim Herunterladen wird die Verwendung des IPv4-Protokolls erzwungen."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:582
 #: apt.conf.5.xml:582
 msgid "When downloading, force to use only the IPv6 protocol."
 msgid "When downloading, force to use only the IPv6 protocol."
-msgstr ""
+msgstr "Beim Herunterladen wird die Verwendung des IPv6-Protokolls erzwungen."
 
 
 #. type: Content of: <refentry><refsect1><title>
 #. type: Content of: <refentry><refsect1><title>
 #: apt.conf.5.xml:589
 #: apt.conf.5.xml:589
@@ -4575,13 +4601,6 @@ msgstr ""
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:703
 #: apt.conf.5.xml:703
-#, fuzzy
-#| msgid ""
-#| "This is a list of shell commands to run before invoking &dpkg;. Like "
-#| "<literal>options</literal> this must be specified in list notation. The "
-#| "commands are invoked in order using <filename>/bin/sh</filename>; should "
-#| "any fail APT will abort. APT will pass the filenames of all .deb files it "
-#| "is going to install to the commands, one per line on standard input."
 msgid ""
 msgid ""
 "This is a list of shell commands to run before invoking &dpkg;. Like "
 "This is a list of shell commands to run before invoking &dpkg;. Like "
 "<literal>options</literal> this must be specified in list notation. The "
 "<literal>options</literal> this must be specified in list notation. The "
@@ -4595,17 +4614,12 @@ msgstr ""
 "Listenschreibweise angegeben werden. Die Befehle werden der Reihenfolge nach "
 "Listenschreibweise angegeben werden. Die Befehle werden der Reihenfolge nach "
 "mit <filename>/bin/sh</filename> aufgerufen, sollte einer fehlschlagen, wird "
 "mit <filename>/bin/sh</filename> aufgerufen, sollte einer fehlschlagen, wird "
 "APT abgebrochen. APT wird den Befehlen die Dateinamen aller .deb-Dateien, "
 "APT abgebrochen. APT wird den Befehlen die Dateinamen aller .deb-Dateien, "
-"die es installieren wird, auf der Standardeingabe übergeben, einen pro Zeile."
+"die es installieren wird, einen pro Zeile, an den angeforderten "
+"standardmäßig auf die Standardeingabe verweisenden Dateideskriptor, "
+"übergeben."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:710
 #: apt.conf.5.xml:710
-#, fuzzy
-#| msgid ""
-#| "Version 2 of this protocol dumps more information, including the protocol "
-#| "version, the APT configuration space and the packages, files and versions "
-#| "being changed. Version 2 is enabled by setting <literal>DPkg::Tools::"
-#| "options::cmd::Version</literal> to 2. <literal>cmd</literal> is a command "
-#| "given to <literal>Pre-Install-Pkgs</literal>."
 msgid ""
 msgid ""
 "Version 2 of this protocol dumps more information, including the protocol "
 "Version 2 of this protocol dumps more information, including the protocol "
 "version, the APT configuration space and the packages, files and versions "
 "version, the APT configuration space and the packages, files and versions "
@@ -4614,10 +4628,8 @@ msgid ""
 msgstr ""
 msgstr ""
 "Version 2 dieses Protokolls gibt mehr Informationen aus, einschließlich der "
 "Version 2 dieses Protokolls gibt mehr Informationen aus, einschließlich der "
 "Protokollversion, dem APT-Konfigurationsraum und den Paketen, Dateien und "
 "Protokollversion, dem APT-Konfigurationsraum und den Paketen, Dateien und "
-"den Versionen, die geändert werden. Version 2 wird durch Setzen von "
-"<literal>DPkg::Tools::options::cmd::Version</literal> auf 2 eingeschaltet. "
-"<literal>cmd</literal> ist ein Befehl, der an <literal>Pre-Install-Pkgs</"
-"literal> gegeben wird."
+"den Versionen, die geändert werden. Version 3 fügt jeder ausgegebenen "
+"Version die Architektur und den <literal>MultiArch</literal>-Schalter hinzu."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:715
 #: apt.conf.5.xml:715
@@ -4629,6 +4641,13 @@ msgid ""
 "the requested version it will send the information in the highest version it "
 "the requested version it will send the information in the highest version it "
 "has support for instead."
 "has support for instead."
 msgstr ""
 msgstr ""
+"Die Protokollversion, die für den Befehl <literal><replaceable>Befehl</"
+"replaceable></literal> benutzt werden soll, kann durch entsprechendes Setzen "
+"von <literal>DPkg::Tools::options::<replaceable>Befehl</replaceable>::"
+"Version</literal> ausgewählt werden, Voreinstellung ist Version 1. Falls APT "
+"die angefragte Version nicht unterstützt, wird es stattdessen die "
+"Informationen in der höchsten Version senden, für die es Unterstützung "
+"bietet."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:722
 #: apt.conf.5.xml:722
@@ -4640,6 +4659,13 @@ msgid ""
 "looking for the environment variable <envar>APT_HOOK_INFO_FD</envar> which "
 "looking for the environment variable <envar>APT_HOOK_INFO_FD</envar> which "
 "contains the number of the used file descriptor as a confirmation."
 "contains the number of the used file descriptor as a confirmation."
 msgstr ""
 msgstr ""
+"Der Dateideskriptor, der zum Senden der Informationen benutzt wird, kann mit "
+"<literal>DPkg::Tools::options::<replaceable>Befehl</replaceable>::InfoFD</"
+"literal> abgefragt werden. Er ist standardmäßig <literal>0</literal> für die "
+"Standardeingabe und seit Version 0.9.11 verfügbar. Unterstützung für die "
+"Option können Sie finden, indem Sie in die Umgebungsvariable "
+"<envar>APT_HOOK_INFO_FD</envar> schauen. Sie enthält die Nummer des "
+"verwendeten Dateideskriptors als eine Bestätigung."
 
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:732
 #: apt.conf.5.xml:732
@@ -6879,26 +6905,19 @@ msgstr ""
 "heruntergeladen."
 "heruntergeladen."
 
 
 #. type: Content of: <refentry><refsect1><para><itemizedlist><listitem><para>
 #. type: Content of: <refentry><refsect1><para><itemizedlist><listitem><para>
-#: sources.list.5.xml:146
-#, fuzzy
-#| msgid ""
-#| "<literal>arch=<replaceable>arch1</replaceable>,<replaceable>arch2</"
-#| "replaceable>,…</literal> can be used to specify for which architectures "
-#| "information should be downloaded. If this option is not set all "
-#| "architectures defined by the <literal>APT::Architectures</literal> option "
-#| "will be downloaded."
+#: sources.list.5.xml:124
 msgid ""
 msgid ""
 "<literal>arch+=<replaceable>arch1</replaceable>,<replaceable>arch2</"
 "<literal>arch+=<replaceable>arch1</replaceable>,<replaceable>arch2</"
 "replaceable>,…</literal> and <literal>arch-=<replaceable>arch1</replaceable>,"
 "replaceable>,…</literal> and <literal>arch-=<replaceable>arch1</replaceable>,"
 "<replaceable>arch2</replaceable>,…</literal> which can be used to add/remove "
 "<replaceable>arch2</replaceable>,…</literal> which can be used to add/remove "
 "architectures from the set which will be downloaded."
 "architectures from the set which will be downloaded."
 msgstr ""
 msgstr ""
-"<literal>arch=<replaceable>Architektur1</replaceable>,"
-"<replaceable>Architektur2</replaceable>, …</literal> kann benutzt werden, um "
-"anzugeben, für welche Architekturen Paketinformationen heruntergeladen "
-"werden sollen. Falls diese Option nicht gesetzt ist, werden alle durch die "
-"Option <literal>APT::Architectures</literal> definierten Architekturen "
-"heruntergeladen."
+"<literal>arch+=<replaceable>Architektur1</replaceable>,"
+"<replaceable>Architektur2</replaceable>, …</literal> und <literal>arch-"
+"=<replaceable>Architektur1</replaceable>,<replaceable>Architektur2</"
+"replaceable>, …</literal>, die benutzt werden können, um der "
+"Zusammenstellung, die heruntergeladen werden soll, Architekturen "
+"hinzuzufügen oder zu entfernen."
 
 
 #. type: Content of: <refentry><refsect1><para><itemizedlist><listitem><para>
 #. type: Content of: <refentry><refsect1><para><itemizedlist><listitem><para>
 #: sources.list.5.xml:149
 #: sources.list.5.xml:149
@@ -8749,18 +8768,9 @@ msgstr ""
 
 
 #. type: <p></p>
 #. type: <p></p>
 #: guide.sgml:163
 #: guide.sgml:163
-#, fuzzy
-#| msgid ""
-#| "<prgn>apt-get</prgn> has several command line options that are detailed "
-#| "in its man page, <manref section=\"8\" name=\"apt-get\">. The most useful "
-#| "option is <tt>-d</tt> which does not install the fetched files. If the "
-#| "system has to download a large number of package it would be undesired to "
-#| "start installing them in case something goes wrong. When <tt>-d</tt> is "
-#| "used the downloaded archives can be installed by simply running the "
-#| "command that caused them to be downloaded again without <tt>-d</tt>."
 msgid ""
 msgid ""
 "<prgn>apt-get</prgn> has several command line options that are detailed in "
 "<prgn>apt-get</prgn> has several command line options that are detailed in "
-"its man page, <manref name=\"apt-get\" section=\"8\">. The most useful "
+"its man page, <manref section=\"8\" name=\"apt-get\">. The most useful "
 "option is <tt>-d</tt> which does not install the fetched files. If the "
 "option is <tt>-d</tt> which does not install the fetched files. If the "
 "system has to download a large number of package it would be undesired to "
 "system has to download a large number of package it would be undesired to "
 "start installing them in case something goes wrong. When <tt>-d</tt> is used "
 "start installing them in case something goes wrong. When <tt>-d</tt> is used "

+ 1 - 1
ftparchive/contents.cc

@@ -233,7 +233,7 @@ void GenContents::Add(const char *Dir,const char *Package)
    
    
    // The final component if it does not have a trailing /
    // The final component if it does not have a trailing /
    if (I - Start >= 1)
    if (I - Start >= 1)
-      Root = Grab(Root,Start,Package);
+      Grab(Root,Start,Package);
 }
 }
 									/*}}}*/
 									/*}}}*/
 // GenContents::WriteSpace - Write a given number of white space chars	/*{{{*/
 // GenContents::WriteSpace - Write a given number of white space chars	/*{{{*/

+ 4 - 6
ftparchive/multicompress.cc

@@ -21,9 +21,9 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/md5.h>
 #include <apt-pkg/md5.h>
 
 
+#include <fcntl.h>
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <utime.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <iostream>
 #include <iostream>
 
 
@@ -234,14 +234,12 @@ bool MultiCompress::Finalize(unsigned long long &OutSize)
       else
       else
       {
       {
 	 // Update the mtime if necessary
 	 // Update the mtime if necessary
-	 if (UpdateMTime > 0 && 
+	 if (UpdateMTime > 0 &&
 	     (Now - St.st_mtime > (signed)UpdateMTime || St.st_mtime > Now))
 	     (Now - St.st_mtime > (signed)UpdateMTime || St.st_mtime > Now))
 	 {
 	 {
-	    struct utimbuf Buf;
-	    Buf.actime = Buf.modtime = Now;
-	    utime(I->Output.c_str(),&Buf);
+	    utimensat(AT_FDCWD, I->Output.c_str(), NULL, AT_SYMLINK_NOFOLLOW);
 	    Changed = true;
 	    Changed = true;
-	 }	     
+	 }
       }
       }
       
       
       // Force the file permissions
       // Force the file permissions

+ 26 - 30
ftparchive/override.cc

@@ -52,45 +52,41 @@ bool Override::ReadOverride(string const &File,bool const &Source)
       if (*Pkg == 0)
       if (*Pkg == 0)
 	 continue;
 	 continue;
 
 
+#define APT_FIND_NEXT_FIELD \
+      for (End++; isspace(*End) != 0 && *End != 0; ++End) \
+	 /* skip spaces */ ; \
+      Start = End; \
+      for (; isspace(*End) == 0 && *End != 0; ++End) \
+	 /* find end of word */ ;
+
+#define APT_WARNING_MALFORMED_LINE(FIELD) \
+      if (*End == 0) \
+      { \
+	 _error->Warning(_("Malformed override %s line %llu (%s)"),File.c_str(), \
+			 Counter, FIELD ); \
+	 continue; \
+      } \
+      *End = 0;
+
       // Find the package and zero..
       // Find the package and zero..
-      char *Start = Pkg;
+      char *Start;
       char *End = Pkg;
       char *End = Pkg;
       for (; isspace(*End) == 0 && *End != 0; End++);
       for (; isspace(*End) == 0 && *End != 0; End++);
-      if (*End == 0)
-      {
-	 _error->Warning(_("Malformed override %s line %llu #1"),File.c_str(),
-			 Counter);
-	 continue;
-      }      
-      *End = 0;
+      APT_WARNING_MALFORMED_LINE("pkgname");
+
+      APT_FIND_NEXT_FIELD;
 
 
       // Find the priority
       // Find the priority
       if (Source == false)
       if (Source == false)
       {
       {
-	 for (End++; isspace(*End) != 0 && *End != 0; End++);
-	 Start = End;
-	 for (; isspace(*End) == 0 && *End != 0; End++);
-	 if (*End == 0)
-	 {
-	    _error->Warning(_("Malformed override %s line %llu #2"),File.c_str(),
-			    Counter);
-	    continue;
-	 }
-	 *End = 0;
+	 APT_WARNING_MALFORMED_LINE("priority");
 	 Itm.Priority = Start;
 	 Itm.Priority = Start;
+
+	 APT_FIND_NEXT_FIELD;
       }
       }
-      
+
       // Find the Section
       // Find the Section
-      for (End++; isspace(*End) != 0 && *End != 0; End++);
-      Start = End;
-      for (; isspace(*End) == 0 && *End != 0; End++);
-      if (*End == 0)
-      {
-	 _error->Warning(_("Malformed override %s line %llu #3"),File.c_str(),
-			 Counter);
-	 continue;
-      }      
-      *End = 0;
+      APT_WARNING_MALFORMED_LINE("section");
       Itm.FieldOverride["Section"] = Start;
       Itm.FieldOverride["Section"] = Start;
 
 
       // Source override files only have the two columns
       // Source override files only have the two columns
@@ -99,7 +95,7 @@ bool Override::ReadOverride(string const &File,bool const &Source)
 	 Mapping[Pkg] = Itm;
 	 Mapping[Pkg] = Itm;
 	 continue;
 	 continue;
       }
       }
-      
+
       // Find the =>
       // Find the =>
       for (End++; isspace(*End) != 0 && *End != 0; End++);
       for (End++; isspace(*End) != 0 && *End != 0; End++);
       if (*End != 0)
       if (*End != 0)

+ 3 - 3
methods/connect.cc

@@ -142,9 +142,9 @@ bool Connect(std::string Host,int Port,const char *Service,int DefPort,int &Fd,
    // Convert the port name/number
    // Convert the port name/number
    char ServStr[300];
    char ServStr[300];
    if (Port != 0)
    if (Port != 0)
-      snprintf(ServStr,sizeof(ServStr),"%u",Port);
+      snprintf(ServStr,sizeof(ServStr),"%i", Port);
    else
    else
-      snprintf(ServStr,sizeof(ServStr),"%s",Service);
+      snprintf(ServStr,sizeof(ServStr),"%s", Service);
    
    
    /* We used a cached address record.. Yes this is against the spec but
    /* We used a cached address record.. Yes this is against the spec but
       the way we have setup our rotating dns suggests that this is more
       the way we have setup our rotating dns suggests that this is more
@@ -190,7 +190,7 @@ bool Connect(std::string Host,int Port,const char *Service,int DefPort,int &Fd,
 	    {
 	    {
 	       if (DefPort != 0)
 	       if (DefPort != 0)
 	       {
 	       {
-		  snprintf(ServStr,sizeof(ServStr),"%u",DefPort);
+		  snprintf(ServStr, sizeof(ServStr), "%i", DefPort);
 		  DefPort = 0;
 		  DefPort = 0;
 		  continue;
 		  continue;
 	       }
 	       }

+ 9 - 9
methods/copy.cc

@@ -18,7 +18,6 @@
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/hashes.h>
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <utime.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/
@@ -71,18 +70,19 @@ bool CopyMethod::Fetch(FetchItem *Itm)
    }
    }
 
 
    From.Close();
    From.Close();
-   To.Close();
-   
+
    // Transfer the modification times
    // Transfer the modification times
-   struct utimbuf TimeBuf;
-   TimeBuf.actime = Buf.st_atime;
-   TimeBuf.modtime = Buf.st_mtime;
-   if (utime(Itm->DestFile.c_str(),&TimeBuf) != 0)
+   struct timespec times[2];
+   times[0].tv_sec = Buf.st_atime;
+   times[1].tv_sec = Buf.st_mtime;
+   times[0].tv_nsec = times[1].tv_nsec = 0;
+   if (futimens(To.Fd(), times) != 0)
    {
    {
       To.OpFail();
       To.OpFail();
-      return _error->Errno("utime",_("Failed to set modification time"));
+      return _error->Errno("futimens",_("Failed to set modification time"));
    }
    }
-   
+   To.Close();
+
    Hashes Hash;
    Hashes Hash;
    FileFd Fd(Res.Filename, FileFd::ReadOnly);
    FileFd Fd(Res.Filename, FileFd::ReadOnly);
    Hash.AddFD(Fd);
    Hash.AddFD(Fd);

+ 26 - 23
methods/ftp.cc

@@ -26,7 +26,6 @@
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/time.h>
-#include <utime.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <signal.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -953,14 +952,16 @@ void FtpMethod::SigTerm(int)
 {
 {
    if (FailFd == -1)
    if (FailFd == -1)
       _exit(100);
       _exit(100);
-   close(FailFd);
-   
+
    // Timestamp
    // Timestamp
-   struct utimbuf UBuf;
-   UBuf.actime = FailTime;
-   UBuf.modtime = FailTime;
-   utime(FailFile.c_str(),&UBuf);
-   
+   struct timespec times[2];
+   times[0].tv_sec = FailTime;
+   times[1].tv_sec = FailTime;
+   times[0].tv_nsec = times[1].tv_nsec = 0;
+   futimens(FailFd, times);
+
+   close(FailFd);
+
    _exit(100);
    _exit(100);
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -1059,13 +1060,14 @@ bool FtpMethod::Fetch(FetchItem *Itm)
       if (Server->Get(File,Fd,Res.ResumePoint,Hash,Missing) == false)
       if (Server->Get(File,Fd,Res.ResumePoint,Hash,Missing) == false)
       {
       {
 	 Fd.Close();
 	 Fd.Close();
-	 
+
 	 // Timestamp
 	 // Timestamp
-	 struct utimbuf UBuf;
-	 UBuf.actime = FailTime;
-	 UBuf.modtime = FailTime;
-	 utime(FailFile.c_str(),&UBuf);
-	 
+	 struct timespec times[2];
+	 times[0].tv_sec = FailTime;
+	 times[1].tv_sec = FailTime;
+	 times[0].tv_nsec = times[1].tv_nsec = 0;
+	 futimens(FailFd, times);
+
 	 // If the file is missing we hard fail and delete the destfile
 	 // If the file is missing we hard fail and delete the destfile
 	 // otherwise transient fail
 	 // otherwise transient fail
 	 if (Missing == true) {
 	 if (Missing == true) {
@@ -1077,20 +1079,21 @@ bool FtpMethod::Fetch(FetchItem *Itm)
       }
       }
 
 
       Res.Size = Fd.Size();
       Res.Size = Fd.Size();
+
+      // Timestamp
+      struct timespec times[2];
+      times[0].tv_sec = FailTime;
+      times[1].tv_sec = FailTime;
+      times[0].tv_nsec = times[1].tv_nsec = 0;
+      futimens(Fd.Fd(), times);
+      FailFd = -1;
    }
    }
-   
+
    Res.LastModified = FailTime;
    Res.LastModified = FailTime;
    Res.TakeHashes(Hash);
    Res.TakeHashes(Hash);
-   
-   // Timestamp
-   struct utimbuf UBuf;
-   UBuf.actime = FailTime;
-   UBuf.modtime = FailTime;
-   utime(Queue->DestFile.c_str(),&UBuf);
-   FailFd = -1;
 
 
    URIDone(Res);
    URIDone(Res);
-   
+
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/

+ 14 - 12
methods/gzip.cc

@@ -19,7 +19,6 @@
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
-#include <utime.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <errno.h>
 #include <errno.h>
 #include <apti18n.h>
 #include <apti18n.h>
@@ -94,32 +93,35 @@ bool GzipMethod::Fetch(FetchItem *Itm)
    }
    }
    
    
    From.Close();
    From.Close();
-   To.Close();
-   
+
    if (Failed == true)
    if (Failed == true)
       return false;
       return false;
-   
+
    // Transfer the modification times
    // Transfer the modification times
    struct stat Buf;
    struct stat Buf;
    if (stat(Path.c_str(),&Buf) != 0)
    if (stat(Path.c_str(),&Buf) != 0)
       return _error->Errno("stat",_("Failed to stat"));
       return _error->Errno("stat",_("Failed to stat"));
 
 
-   struct utimbuf TimeBuf;
-   TimeBuf.actime = Buf.st_atime;
-   TimeBuf.modtime = Buf.st_mtime;
-   if (utime(Itm->DestFile.c_str(),&TimeBuf) != 0)
-      return _error->Errno("utime",_("Failed to set modification time"));
+   struct timespec times[2];
+   times[0].tv_sec = Buf.st_atime;
+   times[1].tv_sec = Buf.st_mtime;
+   times[0].tv_nsec = times[1].tv_nsec = 0;
+   if (futimens(To.Fd(), times) != 0)
+   {
+      To.OpFail();
+      return _error->Errno("futimens",_("Failed to set modification time"));
+   }
+   Res.Size = To.FileSize();
+   To.Close();
 
 
    if (stat(Itm->DestFile.c_str(),&Buf) != 0)
    if (stat(Itm->DestFile.c_str(),&Buf) != 0)
       return _error->Errno("stat",_("Failed to stat"));
       return _error->Errno("stat",_("Failed to stat"));
-   
+
    // Return a Done response
    // Return a Done response
    Res.LastModified = Buf.st_mtime;
    Res.LastModified = Buf.st_mtime;
-   Res.Size = Buf.st_size;
    Res.TakeHashes(Hash);
    Res.TakeHashes(Hash);
 
 
    URIDone(Res);
    URIDone(Res);
-   
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/

+ 1 - 3
methods/http.cc

@@ -97,8 +97,6 @@ void CircleBuf::Reset()
    is non-blocking.. */
    is non-blocking.. */
 bool CircleBuf::Read(int Fd)
 bool CircleBuf::Read(int Fd)
 {
 {
-   unsigned long long BwReadMax;
-
    while (1)
    while (1)
    {
    {
       // Woops, buffer is full
       // Woops, buffer is full
@@ -106,7 +104,7 @@ bool CircleBuf::Read(int Fd)
 	 return true;
 	 return true;
 
 
       // what's left to read in this tick
       // what's left to read in this tick
-      BwReadMax = CircleBuf::BwReadLimit/BW_HZ;
+      unsigned long long const BwReadMax = CircleBuf::BwReadLimit/BW_HZ;
 
 
       if(CircleBuf::BwReadLimit) {
       if(CircleBuf::BwReadLimit) {
 	 struct timeval now;
 	 struct timeval now;

+ 5 - 5
methods/https.cc

@@ -21,7 +21,6 @@
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/time.h>
-#include <utime.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <signal.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -405,10 +404,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
    curl_easy_getinfo(curl, CURLINFO_FILETIME, &Res.LastModified);
    curl_easy_getinfo(curl, CURLINFO_FILETIME, &Res.LastModified);
    if (Res.LastModified != -1)
    if (Res.LastModified != -1)
    {
    {
-      struct utimbuf UBuf;
-      UBuf.actime = Res.LastModified;
-      UBuf.modtime = Res.LastModified;
-      utime(File->Name().c_str(),&UBuf);
+      struct timespec times[2];
+      times[0].tv_sec = Res.LastModified;
+      times[1].tv_sec = Res.LastModified;
+      times[0].tv_nsec = times[1].tv_nsec = 0;
+      futimens(File->Fd(), times);
    }
    }
    else
    else
       Res.LastModified = resultStat.st_mtime;
       Res.LastModified = resultStat.st_mtime;

+ 1 - 1
methods/https.h

@@ -65,7 +65,7 @@ class HttpsMethod : public pkgAcqMethod
    public:
    public:
    FileFd *File;
    FileFd *File;
       
       
-   HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig) 
+   HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig), File(NULL)
    {
    {
       File = 0;
       File = 0;
       curl = curl_easy_init();
       curl = curl_easy_init();

+ 4 - 4
methods/mirror.cc

@@ -114,7 +114,7 @@ bool MirrorMethod::Clean(string Dir)
       for(I=list.begin(); I != list.end(); ++I)
       for(I=list.begin(); I != list.end(); ++I)
       {
       {
 	 string uri = (*I)->GetURI();
 	 string uri = (*I)->GetURI();
-	 if(uri.find("mirror://") != 0)
+	 if(uri.compare(0, strlen("mirror://"), "mirror://") != 0)
 	    continue;
 	    continue;
 	 string BaseUri = uri.substr(0,uri.size()-1);
 	 string BaseUri = uri.substr(0,uri.size()-1);
 	 if (URItoFileName(BaseUri) == Dir->d_name)
 	 if (URItoFileName(BaseUri) == Dir->d_name)
@@ -198,9 +198,9 @@ bool MirrorMethod::RandomizeMirrorFile(string mirror_file)
    // "stable" on the same machine. this is to avoid running into out-of-sync
    // "stable" on the same machine. this is to avoid running into out-of-sync
    // issues (i.e. Release/Release.gpg different on each mirror)
    // issues (i.e. Release/Release.gpg different on each mirror)
    struct utsname buf;
    struct utsname buf;
-   int seed=1, i;
+   int seed=1;
    if(uname(&buf) == 0) {
    if(uname(&buf) == 0) {
-      for(i=0,seed=1; buf.nodename[i] != 0; i++) {
+      for(int i=0,seed=1; buf.nodename[i] != 0; ++i) {
          seed = seed * 31 + buf.nodename[i];
          seed = seed * 31 + buf.nodename[i];
       }
       }
    }
    }
@@ -306,7 +306,7 @@ bool MirrorMethod::InitMirrors()
       if (s.size() == 0)
       if (s.size() == 0)
          continue;
          continue;
       // ignore non http lines
       // ignore non http lines
-      if (s.find("http://") != 0)
+      if (s.compare(0, strlen("http://"), "http://") != 0)
          continue;
          continue;
 
 
       AllMirrors.push_back(s);
       AllMirrors.push_back(s);

+ 18 - 18
methods/rsh.cc

@@ -20,7 +20,6 @@
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/time.h>
-#include <utime.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <signal.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -395,13 +394,14 @@ void RSHMethod::SigTerm(int sig)
 {
 {
    if (FailFd == -1)
    if (FailFd == -1)
       _exit(100);
       _exit(100);
-   close(FailFd);
 
 
-   // Timestamp
-   struct utimbuf UBuf;
-   UBuf.actime = FailTime;
-   UBuf.modtime = FailTime;
-   utime(FailFile.c_str(),&UBuf);
+   // Transfer the modification times
+   struct timespec times[2];
+   times[0].tv_sec = FailTime;
+   times[1].tv_sec = FailTime;
+   times[0].tv_nsec = times[1].tv_nsec = 0;
+   futimens(FailFd, times);
+   close(FailFd);
 
 
    _exit(100);
    _exit(100);
 }
 }
@@ -488,10 +488,11 @@ bool RSHMethod::Fetch(FetchItem *Itm)
 	 Fd.Close();
 	 Fd.Close();
 
 
 	 // Timestamp
 	 // Timestamp
-	 struct utimbuf UBuf;
-	 UBuf.actime = FailTime;
-	 UBuf.modtime = FailTime;
-	 utime(FailFile.c_str(),&UBuf);
+	 struct timespec times[2];
+	 times[0].tv_sec = FailTime;
+	 times[1].tv_sec = FailTime;
+	 times[0].tv_nsec = times[1].tv_nsec = 0;
+	 futimens(FailFd, times);
 
 
 	 // If the file is missing we hard fail otherwise transient fail
 	 // If the file is missing we hard fail otherwise transient fail
 	 if (Missing == true)
 	 if (Missing == true)
@@ -501,18 +502,17 @@ bool RSHMethod::Fetch(FetchItem *Itm)
       }
       }
 
 
       Res.Size = Fd.Size();
       Res.Size = Fd.Size();
+      struct timespec times[2];
+      times[0].tv_sec = FailTime;
+      times[1].tv_sec = FailTime;
+      times[0].tv_nsec = times[1].tv_nsec = 0;
+      futimens(Fd.Fd(), times);
+      FailFd = -1;
    }
    }
 
 
    Res.LastModified = FailTime;
    Res.LastModified = FailTime;
    Res.TakeHashes(Hash);
    Res.TakeHashes(Hash);
 
 
-   // Timestamp
-   struct utimbuf UBuf;
-   UBuf.actime = FailTime;
-   UBuf.modtime = FailTime;
-   utime(Queue->DestFile.c_str(),&UBuf);
-   FailFd = -1;
-
    URIDone(Res);
    URIDone(Res);
 
 
    return true;
    return true;

+ 12 - 13
methods/server.cc

@@ -17,9 +17,9 @@
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/netrc.h>
 #include <apt-pkg/netrc.h>
 
 
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/time.h>
-#include <utime.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <signal.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -368,14 +368,14 @@ void ServerMethod::SigTerm(int)
 {
 {
    if (FailFd == -1)
    if (FailFd == -1)
       _exit(100);
       _exit(100);
+
+   struct timespec times[2];
+   times[0].tv_sec = FailTime;
+   times[1].tv_sec = FailTime;
+   times[0].tv_nsec = times[1].tv_nsec = 0;
+   futimens(FailFd, times);
    close(FailFd);
    close(FailFd);
-   
-   // Timestamp
-   struct utimbuf UBuf;
-   UBuf.actime = FailTime;
-   UBuf.modtime = FailTime;
-   utime(FailFile.c_str(),&UBuf);
-   
+
    _exit(100);
    _exit(100);
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -539,11 +539,10 @@ int ServerMethod::Loop()
 	    File = 0;
 	    File = 0;
 	    
 	    
 	    // Timestamp
 	    // Timestamp
-	    struct utimbuf UBuf;
-	    time(&UBuf.actime);
-	    UBuf.actime = Server->Date;
-	    UBuf.modtime = Server->Date;
-	    utime(Queue->DestFile.c_str(),&UBuf);
+	    struct timespec times[2];
+	    times[0].tv_sec = times[1].tv_sec = Server->Date;
+	    times[0].tv_nsec = times[1].tv_nsec = 0;
+	    utimensat(AT_FDCWD, Queue->DestFile.c_str(), times, AT_SYMLINK_NOFOLLOW);
 
 
 	    // Send status to APT
 	    // Send status to APT
 	    if (Result == true)
 	    if (Result == true)

+ 1 - 1
methods/server.h

@@ -137,7 +137,7 @@ class ServerMethod : public pkgAcqMethod
    virtual ServerState * CreateServerState(URI uri) = 0;
    virtual ServerState * CreateServerState(URI uri) = 0;
    virtual void RotateDNS() = 0;
    virtual void RotateDNS() = 0;
 
 
-   ServerMethod(const char *Ver,unsigned long Flags = 0) : pkgAcqMethod(Ver, Flags), PipelineDepth(0), AllowRedirect(false), Debug(false) {};
+   ServerMethod(const char *Ver,unsigned long Flags = 0) : pkgAcqMethod(Ver, Flags), Server(NULL), File(NULL), PipelineDepth(0), AllowRedirect(false), Debug(false) {};
    virtual ~ServerMethod() {};
    virtual ~ServerMethod() {};
 };
 };
 
 

+ 122 - 79
test/integration/framework

@@ -3,40 +3,46 @@
 EXIT_CODE=0
 EXIT_CODE=0
 
 
 # we all like colorful messages
 # we all like colorful messages
-if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null && \
-   expr match "$(readlink -f /proc/$$/fd/2)" '/dev/pts/[0-9]\+' > /dev/null; then
-	CERROR="" # red
-	CWARNING="" # yellow
-	CMSG="" # green
-	CINFO="" # light blue
-	CDEBUG="" # blue
-	CNORMAL="" # default system console color
-	CDONE="" # green
-	CPASS="" # green
-	CFAIL="" # red
-	CCMD="" # pink
+if [ "$MSGCOLOR" != 'NO' ]; then
+	if ! expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then
+		export MSGCOLOR='NO'
+	fi
+fi
+
+
+if [ "$MSGCOLOR" != 'NO' ]; then
+	CERROR="\033[1;31m" # red
+	CWARNING="\033[1;33m" # yellow
+	CMSG="\033[1;32m" # green
+	CINFO="\033[1;96m" # light blue
+	CDEBUG="\033[1;94m" # blue
+	CNORMAL="\033[0;39m" # default system console color
+	CDONE="\033[1;32m" # green
+	CPASS="\033[1;32m" # green
+	CFAIL="\033[1;31m" # red
+	CCMD="\033[1;35m" # pink
 fi
 fi
 
 
 msgdie() { echo "${CERROR}E: $1${CNORMAL}" >&2; exit 1; }
 msgdie() { echo "${CERROR}E: $1${CNORMAL}" >&2; exit 1; }
 msgwarn() { echo "${CWARNING}W: $1${CNORMAL}" >&2; }
 msgwarn() { echo "${CWARNING}W: $1${CNORMAL}" >&2; }
-msgmsg() { echo "${CMSG}$1${CNORMAL}" >&2; }
-msginfo() { echo "${CINFO}I: $1${CNORMAL}" >&2; }
-msgdebug() { echo "${CDEBUG}D: $1${CNORMAL}" >&2; }
-msgdone() { echo "${CDONE}DONE${CNORMAL}" >&2; }
+msgmsg() { echo "${CMSG}$1${CNORMAL}"; }
+msginfo() { echo "${CINFO}I: $1${CNORMAL}"; }
+msgdebug() { echo "${CDEBUG}D: $1${CNORMAL}"; }
+msgdone() { echo "${CDONE}DONE${CNORMAL}"; }
 msgnwarn() { echo -n "${CWARNING}W: $1${CNORMAL}" >&2; }
 msgnwarn() { echo -n "${CWARNING}W: $1${CNORMAL}" >&2; }
-msgnmsg() { echo -n "${CMSG}$1${CNORMAL}" >&2; }
-msgninfo() { echo -n "${CINFO}I: $1${CNORMAL}" >&2; }
-msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}" >&2; }
+msgnmsg() { echo -n "${CMSG}$1${CNORMAL}"; }
+msgninfo() { echo -n "${CINFO}I: $1${CNORMAL}"; }
+msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}"; }
 msgtest() {
 msgtest() {
 	while [ -n "$1" ]; do
 	while [ -n "$1" ]; do
-		echo -n "${CINFO}$1${CCMD} " >&2;
-		echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} " >&2;
+		echo -n "${CINFO}$1${CCMD} "
+		echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} "
 		shift
 		shift
 		if [ -n "$1" ]; then shift; else break; fi
 		if [ -n "$1" ]; then shift; else break; fi
 	done
 	done
-	echo -n "…${CNORMAL} " >&2;
+	echo -n "…${CNORMAL} "
 }
 }
-msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; }
+msgpass() { echo "${CPASS}PASS${CNORMAL}"; }
 msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; }
 msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; }
 msgfail() {
 msgfail() {
 	if [ $# -gt 0 ]; then echo "${CFAIL}FAIL: $*${CNORMAL}" >&2;
 	if [ $# -gt 0 ]; then echo "${CFAIL}FAIL: $*${CNORMAL}" >&2;
@@ -57,7 +63,7 @@ if [ $MSGLEVEL -le 2 ]; then
 	msgmsg() { true; }
 	msgmsg() { true; }
 	msgnmsg() { true; }
 	msgnmsg() { true; }
 	msgtest() { true; }
 	msgtest() { true; }
-	msgpass() { echo -n " ${CPASS}P${CNORMAL}" >&2; }
+	msgpass() { echo -n " ${CPASS}P${CNORMAL}"; }
 	msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; }
 	msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; }
 	if [ -n "$CFAIL" ]; then
 	if [ -n "$CFAIL" ]; then
 		msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE=$((EXIT_CODE+1)); }
 		msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE=$((EXIT_CODE+1)); }
@@ -81,50 +87,59 @@ msgdone() {
 	   [ "$1" = "die" -a $MSGLEVEL -le 0 ]; then
 	   [ "$1" = "die" -a $MSGLEVEL -le 0 ]; then
 		true;
 		true;
 	else
 	else
-		echo "${CDONE}DONE${CNORMAL}" >&2;
+		echo "${CDONE}DONE${CNORMAL}";
 	fi
 	fi
 }
 }
 
 
 runapt() {
 runapt() {
 	msgdebug "Executing: ${CCMD}$*${CDEBUG} "
 	msgdebug "Executing: ${CCMD}$*${CDEBUG} "
+	local CMD="$1"
+	shift
 	if [ -f ./aptconfig.conf ]; then
 	if [ -f ./aptconfig.conf ]; then
-		MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$*
+		MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$CMD "$@"
 	elif [ -f ../aptconfig.conf ]; then
 	elif [ -f ../aptconfig.conf ]; then
-		MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$*
+		MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$CMD "$@"
 	else
 	else
-		MALLOC_PERTURB_=21 MALLOC_CHECK_=2 LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$*
+		MALLOC_PERTURB_=21 MALLOC_CHECK_=2 LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$CMD "$@"
 	fi
 	fi
 }
 }
-aptconfig() { runapt apt-config $*; }
-aptcache() { runapt apt-cache $*; }
-aptcdrom() { runapt apt-cdrom $*; }
-aptget() { runapt apt-get $*; }
-apt() { runapt apt $*; }
-aptftparchive() { runapt apt-ftparchive $*; }
-aptkey() { runapt apt-key $*; }
-aptmark() { runapt apt-mark $*; }
+aptconfig() { runapt apt-config "$@"; }
+aptcache() { runapt apt-cache "$@"; }
+aptcdrom() { runapt apt-cdrom "$@"; }
+aptget() { runapt apt-get "$@"; }
+aptftparchive() { runapt apt-ftparchive "$@"; }
+aptkey() { runapt apt-key "$@"; }
+aptmark() { runapt apt-mark "$@"; }
+apt() { runapt apt "$@"; }
 aptwebserver() {
 aptwebserver() {
-  LD_LIBRARY_PATH=${APTWEBSERVERBINDIR} ${APTWEBSERVERBINDIR}/aptwebserver $*;
+  LD_LIBRARY_PATH=${APTWEBSERVERBINDIR} ${APTWEBSERVERBINDIR}/aptwebserver "$@";
 }
 }
 dpkg() {
 dpkg() {
-	$(which dpkg) --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log $*
+	command dpkg --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log "$@"
 }
 }
 aptitude() {
 aptitude() {
 	if [ -f ./aptconfig.conf ]; then
 	if [ -f ./aptconfig.conf ]; then
-		APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY}  $(which aptitude) $*
+		APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY}  command aptitude "$@"
 	elif [ -f ../aptconfig.conf ]; then
 	elif [ -f ../aptconfig.conf ]; then
-		APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $*
+		APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} command aptitude "$@"
 	else
 	else
-		LD_LIBRARY_PATH=${BUILDDIRECTORY}  $(which aptitude) $*
+		LD_LIBRARY_PATH=${BUILDDIRECTORY}  command aptitude "$@"
 	fi
 	fi
 }
 }
 gdb() {
 gdb() {
 	echo "gdb: run »$*«"
 	echo "gdb: run »$*«"
-	APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1 --args $*
+	APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} command gdb ${BUILDDIRECTORY}/$1 --args "$@"
 }
 }
 http() {
 http() {
 	LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods/http
 	LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods/http
 }
 }
+gpg() {
+	# see apt-key for the whole trickery. Setup is done in setupenvironment
+	command gpg --ignore-time-conflict --no-options --no-default-keyring \
+		--homedir "${TMPWORKINGDIRECTORY}/gnupghome" \
+		--no-auto-check-trustdb --trust-model always \
+		"$@"
+}
 
 
 exitwithstatus() {
 exitwithstatus() {
         # error if we about to overflow, but ...
         # error if we about to overflow, but ...
@@ -171,7 +186,7 @@ setupenvironment() {
 	mkdir rootdir aptarchive keys
 	mkdir rootdir aptarchive keys
 	cd rootdir
 	cd rootdir
 	mkdir -p etc/apt/apt.conf.d etc/apt/sources.list.d etc/apt/trusted.gpg.d etc/apt/preferences.d
 	mkdir -p etc/apt/apt.conf.d etc/apt/sources.list.d etc/apt/trusted.gpg.d etc/apt/preferences.d
-	mkdir -p var/cache var/lib var/log
+	mkdir -p var/cache var/lib var/log tmp
 	mkdir -p var/lib/dpkg/info var/lib/dpkg/updates var/lib/dpkg/triggers
 	mkdir -p var/lib/dpkg/info var/lib/dpkg/updates var/lib/dpkg/triggers
 	touch var/lib/dpkg/available
 	touch var/lib/dpkg/available
 	mkdir -p usr/lib/apt
 	mkdir -p usr/lib/apt
@@ -197,16 +212,30 @@ setupenvironment() {
 	echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf
 	echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf
 	echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf
 	echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf
 	echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf
 	echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf
-	if ! $(which dpkg) --assert-multi-arch >/dev/null 2>&1; then
+	if ! command dpkg --assert-multi-arch >/dev/null 2>&1; then
 		echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it…
 		echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it…
 	fi
 	fi
 	echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
 	echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
 	echo 'quiet::NoUpdate "true";' >> aptconfig.conf
 	echo 'quiet::NoUpdate "true";' >> aptconfig.conf
 	echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir/etc/apt/apt.conf.d/99https
 	echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir/etc/apt/apt.conf.d/99https
         echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary
         echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary
-	export LC_ALL=C
+	export LC_ALL=C.UTF-8
 	export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
 	export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
 	configcompression '.' 'gz' #'bz2' 'lzma' 'xz'
 	configcompression '.' 'gz' #'bz2' 'lzma' 'xz'
+
+	# gpg needs a trustdb to function, but it can't be invalid (not even empty)
+	# see also apt-key where this trickery comes from:
+	local TRUSTDBDIR="${TMPWORKINGDIRECTORY}/gnupghome"
+	mkdir "$TRUSTDBDIR"
+	chmod 700 "$TRUSTDBDIR"
+	# We also don't use a secret keyring, of course, but gpg panics and
+	# implodes if there isn't one available - and writeable for imports
+	local SECRETKEYRING="${TRUSTDBDIR}/secring.gpg"
+	touch $SECRETKEYRING
+	# now create the trustdb with an (empty) dummy keyring
+	# newer gpg versions are fine without it, but play it safe for now
+	gpg --quiet --check-trustdb --secret-keyring $SECRETKEYRING --keyring $SECRETKEYRING >/dev/null 2>&1
+
 	msgdone "info"
 	msgdone "info"
 }
 }
 
 
@@ -248,7 +277,7 @@ configdpkg() {
 		fi
 		fi
 	fi
 	fi
 	rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg
 	rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg
-	if $(which dpkg) --assert-multi-arch >/dev/null 2>&1; then
+	if command dpkg --assert-multi-arch >/dev/null 2>&1 ; then
 		local ARCHS="$(getarchitectures)"
 		local ARCHS="$(getarchitectures)"
 		if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then
 		if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then
 			DPKGARCH="$(dpkg --print-architecture)"
 			DPKGARCH="$(dpkg --print-architecture)"
@@ -392,7 +421,7 @@ Package: $NAME" >> ${BUILDDIR}/debian/control
 		| while read SRC; do
 		| while read SRC; do
 		echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist
 		echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist
 #		if expr match "${SRC}" '.*\.dsc' >/dev/null 2>&1; then
 #		if expr match "${SRC}" '.*\.dsc' >/dev/null 2>&1; then
-#			gpg --yes --no-default-keyring --secret-keyring ./keys/joesixpack.sec \
+#			gpg --yes --secret-keyring ./keys/joesixpack.sec \
 #				--keyring ./keys/joesixpack.pub --default-key 'Joe Sixpack' \
 #				--keyring ./keys/joesixpack.pub --default-key 'Joe Sixpack' \
 #				--clearsign -o "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC"
 #				--clearsign -o "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC"
 #			mv "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC"
 #			mv "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC"
@@ -410,7 +439,14 @@ Package: $NAME" >> ${BUILDDIR}/debian/control
 
 
 		(cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch)
 		(cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch)
 		(cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums)
 		(cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums)
-		dpkg-deb --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. 2> /dev/null > /dev/null
+		local LOG="${BUILDDIR}/../${NAME}_${VERSION}_${arch}.dpkg-deb.log"
+		# ensure the right permissions as dpkg-deb ensists
+		chmod 755 ${BUILDDIR}/debian/tmp/DEBIAN
+		if ! dpkg-deb --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. >$LOG 2>&1; then
+			cat $LOG
+			false
+		fi
+		rm $LOG
 		echo "pool/${NAME}_${VERSION}_${arch}.deb" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.pkglist
 		echo "pool/${NAME}_${VERSION}_${arch}.deb" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.pkglist
 	done
 	done
 
 
@@ -426,14 +462,19 @@ buildpackage() {
 	local RELEASE=$2
 	local RELEASE=$2
 	local SECTION=$3
 	local SECTION=$3
 	local ARCH=$(getarchitecture $4)
 	local ARCH=$(getarchitecture $4)
-	msgninfo "Build package $(echo "$BUILDDIR" | grep -o '[^/]*$') for ${RELEASE} in ${SECTION}… "
+	local PKGNAME="$(echo "$BUILDDIR" | grep -o '[^/]*$')"
+	local BUILDLOG="$(readlink -f "${BUILDDIR}/../${PKGNAME}_${RELEASE}_${SECTION}.dpkg-bp.log")"
+	msgninfo "Build package ${PKGNAME} for ${RELEASE} in ${SECTION}… "
 	cd $BUILDDIR
 	cd $BUILDDIR
 	if [ "$ARCH" = "all" ]; then
 	if [ "$ARCH" = "all" ]; then
 		ARCH="$(dpkg-architecture -qDEB_HOST_ARCH 2> /dev/null)"
 		ARCH="$(dpkg-architecture -qDEB_HOST_ARCH 2> /dev/null)"
 	fi
 	fi
-	local BUILT="$(dpkg-buildpackage -uc -us -a$ARCH 2> /dev/null)"
-	local PKGS="$( echo "$BUILT" | grep '^dpkg-deb: building package' | cut -d'/' -f 2 | sed -e "s#'\.##")"
-	local SRCS="$( echo "$BUILT" | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')"
+	if ! dpkg-buildpackage -uc -us -a$ARCH >$BUILDLOG 2>&1 ; then
+		cat $BUILDLOG
+		false
+	fi
+	local PKGS="$(grep '^dpkg-deb: building package' $BUILDLOG | cut -d'/' -f 2 | sed -e "s#'\.##")"
+	local SRCS="$(grep '^dpkg-source: info: building' $BUILDLOG | grep -o '[a-z0-9._+~-]*$')"
 	cd - > /dev/null
 	cd - > /dev/null
 	for PKG in $PKGS; do
 	for PKG in $PKGS; do
 		echo "pool/${PKG}" >> ${TMPWORKINGDIRECTORY}/incoming/${RELEASE}.${SECTION}.pkglist
 		echo "pool/${PKG}" >> ${TMPWORKINGDIRECTORY}/incoming/${RELEASE}.${SECTION}.pkglist
@@ -446,9 +487,9 @@ buildpackage() {
 
 
 buildaptarchive() {
 buildaptarchive() {
 	if [ -d incoming ]; then
 	if [ -d incoming ]; then
-		buildaptarchivefromincoming $*
+		buildaptarchivefromincoming "$@"
 	else
 	else
-		buildaptarchivefromfiles $*
+		buildaptarchivefromfiles "$@"
 	fi
 	fi
 }
 }
 
 
@@ -664,7 +705,12 @@ compressfile() {
 }
 }
 
 
 # can be overridden by testcases for their pleasure
 # can be overridden by testcases for their pleasure
-getcodenamefromsuite() { echo -n "$1"; }
+getcodenamefromsuite() {
+	case "$1" in
+	unstable) echo 'sid';;
+	*) echo -n "$1";;
+	esac
+}
 getreleaseversionfromsuite() { true; }
 getreleaseversionfromsuite() { true; }
 getlabelfromsuite() { true; }
 getlabelfromsuite() { true; }
 
 
@@ -761,7 +807,7 @@ setupaptarchive() {
 
 
 signreleasefiles() {
 signreleasefiles() {
 	local SIGNER="${1:-Joe Sixpack}"
 	local SIGNER="${1:-Joe Sixpack}"
-	local GPG="gpg --batch --yes --no-default-keyring --trustdb-name rootdir/etc/apt/trustdb.gpg"
+	local GPG="gpg --batch --yes"
 	msgninfo "\tSign archive with $SIGNER key… "
 	msgninfo "\tSign archive with $SIGNER key… "
 	local REXKEY='keys/rexexpired'
 	local REXKEY='keys/rexexpired'
 	local SECEXPIREBAK="${REXKEY}.sec.bak"
 	local SECEXPIREBAK="${REXKEY}.sec.bak"
@@ -808,8 +854,7 @@ webserverconfig() {
 	downloadfile "http://localhost:8080/_config/set/${1}/${2}" '/dev/null' >/dev/null
 	downloadfile "http://localhost:8080/_config/set/${1}/${2}" '/dev/null' >/dev/null
 	local DOWNLOG='download-testfile.log'
 	local DOWNLOG='download-testfile.log'
 	rm -f "$DOWNLOG"
 	rm -f "$DOWNLOG"
-	local STATUS="$(mktemp)"
-	addtrap "rm $STATUS;"
+	local STATUS="${TMPWORKINGDIRECTORY}/rootdir/tmp/webserverconfig.status"
 	downloadfile "http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" > "$DOWNLOG"
 	downloadfile "http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" > "$DOWNLOG"
 	if [ "$(cat "$STATUS")" = '200' ]; then
 	if [ "$(cat "$STATUS")" = '200' ]; then
 		msgpass
 		msgpass
@@ -817,6 +862,7 @@ webserverconfig() {
 		cat >&2 "$DOWNLOG"
 		cat >&2 "$DOWNLOG"
 		msgfail "Statuscode was $(cat "$STATUS")"
 		msgfail "Statuscode was $(cat "$STATUS")"
 	fi
 	fi
+	rm "$STATUS"
 }
 }
 
 
 rewritesourceslist() {
 rewritesourceslist() {
@@ -832,10 +878,12 @@ changetowebserver() {
 	else
 	else
 		shift
 		shift
 	fi
 	fi
-	local LOG='/dev/null'
 	if test -x ${APTWEBSERVERBINDIR}/aptwebserver; then
 	if test -x ${APTWEBSERVERBINDIR}/aptwebserver; then
 		cd aptarchive
 		cd aptarchive
-		aptwebserver -o aptwebserver::fork=1 "$@" >$LOG 2>&1
+		if ! aptwebserver -o aptwebserver::fork=1 "$@" >webserver.log 2>&1 ; then
+			cat $LOG
+			false
+		fi
 		local PID="$(cat aptwebserver.pid)"
 		local PID="$(cat aptwebserver.pid)"
 		if [ -z "$PID" ]; then
 		if [ -z "$PID" ]; then
 			msgdie 'Could not fork aptwebserver successfully'
 			msgdie 'Could not fork aptwebserver successfully'
@@ -924,7 +972,7 @@ Filename: ${2}
 }
 }
 
 
 checkdiff() {
 checkdiff() {
-	local DIFFTEXT="$($(which diff) -u $* | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')"
+	local DIFFTEXT="$(command diff -u "$@" | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')"
 	if [ -n "$DIFFTEXT" ]; then
 	if [ -n "$DIFFTEXT" ]; then
 		echo
 		echo
 		echo "$DIFFTEXT"
 		echo "$DIFFTEXT"
@@ -957,7 +1005,7 @@ testequal() {
 		shift
 		shift
 	fi
 	fi
 
 
-	local COMPAREFILE=$(mktemp)
+	local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequal.comparefile"
 	addtrap "rm $COMPAREFILE;"
 	addtrap "rm $COMPAREFILE;"
 	echo "$1" > $COMPAREFILE
 	echo "$1" > $COMPAREFILE
 	shift
 	shift
@@ -969,10 +1017,9 @@ testequal() {
 }
 }
 
 
 testequalor2() {
 testequalor2() {
-	local COMPAREFILE1=$(mktemp)
-	local COMPAREFILE2=$(mktemp)
-	local COMPAREAGAINST=$(mktemp)
-	addtrap "rm $COMPAREFILE1 $COMPAREFILE2 $COMPAREAGAINST;"
+	local COMPAREFILE1="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequalor2.comparefile1"
+	local COMPAREFILE2="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequalor2.comparefile2"
+	local COMPAREAGAINST="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequalor2.compareagainst"
 	echo "$1" > $COMPAREFILE1
 	echo "$1" > $COMPAREFILE1
 	echo "$2" > $COMPAREFILE2
 	echo "$2" > $COMPAREFILE2
 	shift 2
 	shift 2
@@ -998,8 +1045,7 @@ N: Can't select versions from package '$1' as it is purely virtual"
 	msgtest "Test for virtual packages" "apt-cache show $PACKAGE"
 	msgtest "Test for virtual packages" "apt-cache show $PACKAGE"
 	VIRTUAL="${VIRTUAL}
 	VIRTUAL="${VIRTUAL}
 N: No packages found"
 N: No packages found"
-	local COMPAREFILE=$(mktemp)
-	addtrap "rm $COMPAREFILE;"
+	local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testshowvirtual.comparefile"
 	local ARCH="$(getarchitecture 'native')"
 	local ARCH="$(getarchitecture 'native')"
 	echo "$VIRTUAL" | sed -e "s/:$ARCH//" -e 's/:all//' > $COMPAREFILE
 	echo "$VIRTUAL" | sed -e "s/:$ARCH//" -e 's/:all//' > $COMPAREFILE
 	aptcache show -q=0 $PACKAGE 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
 	aptcache show -q=0 $PACKAGE 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
@@ -1007,7 +1053,7 @@ N: No packages found"
 
 
 testnopackage() {
 testnopackage() {
 	msgtest "Test for non-existent packages" "apt-cache show $*"
 	msgtest "Test for non-existent packages" "apt-cache show $*"
-	local SHOWPKG="$(aptcache show $* 2>&1 | grep '^Package: ')"
+	local SHOWPKG="$(aptcache show "$@" 2>&1 | grep '^Package: ')"
 	if [ -n "$SHOWPKG" ]; then
 	if [ -n "$SHOWPKG" ]; then
 		echo
 		echo
 		echo "$SHOWPKG"
 		echo "$SHOWPKG"
@@ -1019,10 +1065,10 @@ testnopackage() {
 
 
 testdpkginstalled() {
 testdpkginstalled() {
 	msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
 	msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
-	local PKGS="$(dpkg -l $* 2>/dev/null | grep '^i' | wc -l)"
+	local PKGS="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
 	if [ "$PKGS" != $# ]; then
 	if [ "$PKGS" != $# ]; then
 		echo $PKGS
 		echo $PKGS
-		dpkg -l $* | grep '^[a-z]'
+		dpkg -l "$@" | grep '^[a-z]'
 		msgfail
 		msgfail
 		return 1
 		return 1
 	fi
 	fi
@@ -1031,10 +1077,10 @@ testdpkginstalled() {
 
 
 testdpkgnotinstalled() {
 testdpkgnotinstalled() {
 	msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
 	msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
-	local PKGS="$(dpkg -l $* 2> /dev/null | grep '^i' | wc -l)"
+	local PKGS="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
 	if [ "$PKGS" != 0 ]; then
 	if [ "$PKGS" != 0 ]; then
 		echo
 		echo
-		dpkg -l $* | grep '^[a-z]'
+		dpkg -l "$@" | grep '^[a-z]'
 		msgfail
 		msgfail
 		return 1
 		return 1
 	fi
 	fi
@@ -1042,8 +1088,7 @@ testdpkgnotinstalled() {
 }
 }
 
 
 testmarkedauto() {
 testmarkedauto() {
-	local COMPAREFILE=$(mktemp)
-	addtrap "rm $COMPAREFILE;"
+	local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testmarkedauto.comparefile"
 	if [ -n "$1" ]; then
 	if [ -n "$1" ]; then
 		msgtest 'Test for correctly marked as auto-installed' "$*"
 		msgtest 'Test for correctly marked as auto-installed' "$*"
 		while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE
 		while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE
@@ -1060,8 +1105,7 @@ testsuccess() {
 	else
 	else
 		msgtest 'Test for successful execution of' "$*"
 		msgtest 'Test for successful execution of' "$*"
 	fi
 	fi
-	local OUTPUT=$(mktemp)
-	addtrap "rm $OUTPUT;"
+	local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output"
 	if $@ >${OUTPUT} 2>&1; then
 	if $@ >${OUTPUT} 2>&1; then
 		msgpass
 		msgpass
 	else
 	else
@@ -1077,8 +1121,7 @@ testfailure() {
 	else
 	else
 		msgtest 'Test for failure in  execution of' "$*"
 		msgtest 'Test for failure in  execution of' "$*"
 	fi
 	fi
-	local OUTPUT=$(mktemp)
-	addtrap "rm $OUTPUT;"
+	local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output"
 	if $@ >${OUTPUT} 2>&1; then
 	if $@ >${OUTPUT} 2>&1; then
 		echo
 		echo
 		cat $OUTPUT
 		cat $OUTPUT

+ 38 - 19
test/integration/run-tests

@@ -2,24 +2,38 @@
 set -e
 set -e
 
 
 FAIL=0
 FAIL=0
+PASS=0
+ALL=0
+
 FAILED_TESTS=""
 FAILED_TESTS=""
 DIR=$(readlink -f $(dirname $0))
 DIR=$(readlink -f $(dirname $0))
-if [ "$1" = "-q" ]; then
-	export MSGLEVEL=2
-elif [ "$1" = "-v" ]; then
-	export MSGLEVEL=4
-fi
+while [ -n "$1" ]; do
+	if [ "$1" = "-q" ]; then
+		export MSGLEVEL=2
+	elif [ "$1" = "-v" ]; then
+		export MSGLEVEL=4
+	elif [ "$1" = '--color=no' ]; then
+		export MSGCOLOR='NO'
+	else
+		echo >&2 "WARNING: Unknown parameter »$1« will be ignored"
+	fi
+	shift
+done
+export MSGLEVEL="${MSGLEVEL:-3}"
 
 
-if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then
+if [ "$MSGCOLOR" != 'NO' ]; then
+	if ! expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then
+		export MSGCOLOR='NO'
+	fi
+fi
+if [ "$MSGCOLOR" != 'NO' ]; then
 	CTEST='\033[1;32m'
 	CTEST='\033[1;32m'
 	CHIGH='\033[1;35m'
 	CHIGH='\033[1;35m'
 	CRESET='\033[0m'
 	CRESET='\033[0m'
-elif [ -z "${MSGLEVEL}" ]; then
-	export MSGLEVEL=2
-fi
-
-if [ -z "$MSGLEVEL" ]; then
-	MSGLEVEL=5
+else
+	CTEST=''
+	CHIGH=''
+	CRESET=''
 fi
 fi
 
 
 for testcase in $(run-parts --list $DIR | grep '/test-'); do
 for testcase in $(run-parts --list $DIR | grep '/test-'); do
@@ -29,18 +43,23 @@ for testcase in $(run-parts --list $DIR | grep '/test-'); do
 		echo "${CTEST}Run Testcase ${CHIGH}$(basename ${testcase})${CRESET}"
 		echo "${CTEST}Run Testcase ${CHIGH}$(basename ${testcase})${CRESET}"
 	fi
 	fi
 	if ! ${testcase}; then
 	if ! ${testcase}; then
-                 FAIL=$((FAIL+1))
-                 FAILED_TESTS="$FAILED_TESTS $(basename $testcase)"
-                 echo "$(basename $testcase) ... FAIL"
-        fi
+		FAIL=$((FAIL+1))
+		FAILED_TESTS="$FAILED_TESTS $(basename $testcase)"
+		echo >&2 "$(basename $testcase) ... FAIL"
+	else
+		PASS=$((PASS+1))
+	fi
+	ALL=$((ALL+1))
 	if [ "$MSGLEVEL" -le 2 ]; then
 	if [ "$MSGLEVEL" -le 2 ]; then
 		echo
 		echo
 	fi
 	fi
 done
 done
 
 
-echo "failures: $FAIL"
-if [ -n "$FAILED_TESTS" ]; then 
-    echo "Failed tests: $FAILED_TESTS";
+echo >&2 "Statistics: $ALL tests were run: $PASS successfully and $FAIL failed"
+if [ -n "$FAILED_TESTS" ]; then
+	echo >&2 "Failed tests: $FAILED_TESTS"
+else
+	echo >&2 'All tests seem to have been run successfully. What could possibly go wrong?'
 fi
 fi
 # ensure we don't overflow
 # ensure we don't overflow
 exit $((FAIL <= 255 ? FAIL : 255))
 exit $((FAIL <= 255 ? FAIL : 255))

+ 2 - 1
test/integration/test-apt-get-download

@@ -19,7 +19,8 @@ testdownload() {
 		APT="${APT}/${3}"
 		APT="${APT}/${3}"
 	fi
 	fi
 	msgtest "Test download of package file $1 with" "$APT"
 	msgtest "Test download of package file $1 with" "$APT"
-	aptget -qq download ${APT} && test -f $1 && msgpass || msgfail
+	testsuccess --nomsg aptget download ${APT}
+	testsuccess test -f $1
 	rm $1
 	rm $1
 }
 }
 
 

+ 13 - 1
test/integration/test-apt-get-source

@@ -39,12 +39,24 @@ Need to get 0 B of source archives.
 'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
 'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
 'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo
 'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo
 
 
-# select by release
+# select by release: suite
 testequal "$HEADER
 testequal "$HEADER
 Selected version '1.0' (stable) for foo
 Selected version '1.0' (stable) for foo
 Need to get 0 B of source archives.
 Need to get 0 B of source archives.
 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/stable
 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/stable
+testequal "$HEADER
+Selected version '2.0' (unstable) for foo
+Need to get 0 B of source archives.
+'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
+'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/unstable
+
+# select by release: codename
+testequal "$HEADER
+Selected version '2.0' (sid) for foo
+Need to get 0 B of source archives.
+'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
+'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/sid
 
 
 # select by version
 # select by version
 testequal "$HEADER
 testequal "$HEADER

+ 1 - 1
test/integration/test-ubuntu-bug-784473-InRelease-one-message-only

@@ -35,5 +35,5 @@ testequal "Package files:
  100 ${ROOTDIR}/rootdir/var/lib/dpkg/status
  100 ${ROOTDIR}/rootdir/var/lib/dpkg/status
      release a=now
      release a=now
  500 file:${ROOTDIR}/aptarchive/ unstable/main i386 Packages
  500 file:${ROOTDIR}/aptarchive/ unstable/main i386 Packages
-     release a=unstable,n=unstable,c=main
+     release a=unstable,n=sid,c=main
 Pinned packages:" aptcache policy
 Pinned packages:" aptcache policy

+ 4 - 5
test/interactive-helper/rpmver.cc

@@ -2,6 +2,7 @@
 #include <rpm/rpmio.h>
 #include <rpm/rpmio.h>
 #include <rpm/misc.h>
 #include <rpm/misc.h>
 #include <stdlib.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <ctype.h>
 #include <ctype.h>
 
 
 #define xisdigit(x) isdigit(x)
 #define xisdigit(x) isdigit(x)
@@ -12,10 +13,8 @@ using namespace std;
 
 
 int rpmvercmp(const char * a, const char * b)
 int rpmvercmp(const char * a, const char * b)
 {
 {
-    char oldch1, oldch2;
     char * str1, * str2;
     char * str1, * str2;
     char * one, * two;
     char * one, * two;
-    int rc;
     int isnum;
     int isnum;
 
 
     /* easy comparison to see if versions are identical */
     /* easy comparison to see if versions are identical */
@@ -53,9 +52,9 @@ int rpmvercmp(const char * a, const char * b)
 
 
 	/* save character at the end of the alpha or numeric segment */
 	/* save character at the end of the alpha or numeric segment */
 	/* so that they can be restored after the comparison */
 	/* so that they can be restored after the comparison */
-	oldch1 = *str1;
+	char oldch1 = *str1;
 	*str1 = '\0';
 	*str1 = '\0';
-	oldch2 = *str2;
+	char oldch2 = *str2;
 	*str2 = '\0';
 	*str2 = '\0';
 
 
 	/* take care of the case where the two version segments are */
 	/* take care of the case where the two version segments are */
@@ -81,7 +80,7 @@ int rpmvercmp(const char * a, const char * b)
 	/* segments are alpha or if they are numeric.  don't return  */
 	/* segments are alpha or if they are numeric.  don't return  */
 	/* if they are equal because there might be more segments to */
 	/* if they are equal because there might be more segments to */
 	/* compare */
 	/* compare */
-	rc = strcmp(one, two);
+	int rc = strcmp(one, two);
 	if (rc) return rc;
 	if (rc) return rc;
 
 
 	/* restore character that was replaced by null above */
 	/* restore character that was replaced by null above */

+ 1 - 1
test/libapt/parsedepends_test.cc

@@ -176,7 +176,7 @@ test:
 	equals("7.15.3~", Version);
 	equals("7.15.3~", Version);
 	equals(Null | pkgCache::Dep::Equals | pkgCache::Dep::Or, Op);
 	equals(Null | pkgCache::Dep::Equals | pkgCache::Dep::Or, Op);
 
 
-	Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch);
+	debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch);
 	if (StripMultiArch == true)
 	if (StripMultiArch == true)
 		equals("overlord-dev", Package);
 		equals("overlord-dev", Package);
 	else
 	else