From f7c7f4821e8050b6185c652215e639cbc0089769 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 10 Dec 2013 15:37:02 +0100 Subject: use C.UTF-8 in testcases as locale Git-Dch: Ignore --- test/integration/framework | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index a28363768..8aacb7456 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -202,7 +202,7 @@ setupenvironment() { echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf echo 'quiet::NoUpdate "true";' >> aptconfig.conf echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir/etc/apt/apt.conf.d/99https - export LC_ALL=C + export LC_ALL=C.UTF-8 export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin" configcompression '.' 'gz' #'bz2' 'lzma' 'xz' msgdone "info" @@ -288,7 +288,7 @@ setupsimplenativepackage() { local VERSION="$3" local RELEASE="${4:-unstable}" local DEPENDENCIES="$5" - local DESCRIPTION="${6:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + local DESCRIPTION="${6:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} If you find such a package installed on your system, something went horribly wrong! They are autogenerated und used only by testcases and surf no other propose…"}" @@ -338,7 +338,7 @@ buildsimplenativepackage() { local VERSION="$3" local RELEASE="${4:-unstable}" local DEPENDENCIES="$5" - local DESCRIPTION="${6:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + local DESCRIPTION="${6:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} If you find such a package installed on your system, something went horribly wrong! They are autogenerated und used only by testcases and surf no other propose…"}" @@ -535,7 +535,7 @@ insertpackage() { local VERSION="$4" local DEPENDENCIES="$5" local PRIORITY="${6:-optional}" - local DESCRIPTION="${7:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + local DESCRIPTION="${7:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} If you find such a package installed on your system, something went horribly wrong! They are autogenerated und used only by testcases and surf no other propose…"}" @@ -595,7 +595,7 @@ insertinstalledpackage() { local DEPENDENCIES="$4" local PRIORITY="${5:-optional}" local STATUS="${6:-install ok installed}" - local DESCRIPTION="${7:-"Description: an autogenerated dummy ${NAME}=${VERSION}/installed + local DESCRIPTION="${7:-"an autogenerated dummy ${NAME}=${VERSION}/installed If you find such a package installed on your system, something went horribly wrong! They are autogenerated und used only by testcases and surf no other propose…"}" -- cgit v1.2.3 From bf9e744761f605e537878b7524ea9023493e4c5b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 10 Dec 2013 18:23:47 +0100 Subject: tests: default to 'sid' codename for 'unstable' Git-Dch: Ignore --- test/integration/framework | 7 ++++++- test/integration/test-ubuntu-bug-784473-InRelease-one-message-only | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 8aacb7456..60a8167fa 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -662,7 +662,12 @@ compressfile() { } # 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; } getlabelfromsuite() { true; } diff --git a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only index e9d684309..50ca2bf57 100755 --- a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only +++ b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only @@ -35,5 +35,5 @@ testequal "Package files: 100 ${ROOTDIR}/rootdir/var/lib/dpkg/status release a=now 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 -- cgit v1.2.3 From c5909dcfdc65ce8120d641227976ba4597fd3e70 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 11 Dec 2013 13:39:51 +0100 Subject: test apt-get source release selection with suite and codename Git-Dch: Ignore --- test/integration/test-apt-get-source | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index 3ee7a9e23..083e26db1 100755 --- a/test/integration/test-apt-get-source +++ b/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.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 Selected version '1.0' (stable) for foo 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.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 testequal "$HEADER -- cgit v1.2.3 From bee0670b2dc8c50ddfc65731c00383da4d377cae Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jan 2014 17:21:13 +0100 Subject: show the error message if the webserver start failed Can happen e.g. if port 8080 is already used by something else Git-Dch: Ignore --- test/integration/framework | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 60a8167fa..c4953812b 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -835,10 +835,14 @@ changetowebserver() { else shift fi - local LOG='/dev/null' if test -x ${APTWEBSERVERBINDIR}/aptwebserver; then cd aptarchive - aptwebserver -o aptwebserver::fork=1 "$@" >$LOG 2>&1 + local LOG="$(mktemp)" + addtrap "rm $LOG;" + if ! aptwebserver -o aptwebserver::fork=1 "$@" >$LOG 2>&1 ; then + cat $LOG + false + fi local PID="$(cat aptwebserver.pid)" if [ -z "$PID" ]; then msgdie 'Could not fork aptwebserver successfully' -- cgit v1.2.3 From 62d8a765b9b37354efab6ca838cbdb7f347f7cac Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jan 2014 19:51:23 +0100 Subject: rework some code to fix some scan-build warnings No visible functional changes, just code moved around and additional checks to eliminate impossible branches Reported-By: scan-build Git-Dch: Ignore --- apt-pkg/aptconfiguration.cc | 4 +-- apt-pkg/cacheset.cc | 2 ++ apt-pkg/contrib/gpgv.cc | 6 ++--- apt-pkg/contrib/mmap.cc | 8 +++++- ftparchive/contents.cc | 2 +- ftparchive/override.cc | 56 +++++++++++++++++++--------------------- test/libapt/parsedepends_test.cc | 2 +- 7 files changed, 42 insertions(+), 38 deletions(-) diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 115d11616..1ebcf97bc 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -141,7 +141,7 @@ std::vector const Configuration::getLanguages(bool const &All, // so they will be all included in the Cache. std::vector builtin; DIR *D = opendir(_config->FindDir("Dir::State::lists").c_str()); - if (D != 0) { + if (D != NULL) { builtin.push_back("none"); for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) { string const name = SubstVar(Ent->d_name, "%5f", "_"); @@ -166,8 +166,8 @@ std::vector const Configuration::getLanguages(bool const &All, continue; builtin.push_back(c); } + closedir(D); } - closedir(D); // FIXME: Remove support for the old APT::Acquire::Translation // it was undocumented and so it should be not very widthly used diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index 0147f7e86..29281aab9 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -73,6 +73,8 @@ bool PackageContainerInterface::FromTask(PackageContainerInterface * const pci, const char *start, *end; parser.GetRec(start,end); unsigned int const length = end - start; + if (unlikely(length == 0)) + continue; char buf[length]; strncpy(buf, start, length); buf[length-1] = '\0'; diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index f57a72d86..0a469dd7a 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/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 dataHeader; char * sig = NULL; char * data = NULL; - // file with detached signature - if (FileGPG != File) + if (releaseSignature == DETACHED) { Args.push_back(FileGPG.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="); } - if (FileGPG != File) + if (releaseSignature == DETACHED) { execvp(gpgvpath.c_str(), (char **) &Args[0]); ioprintf(std::cerr, "Couldn't execute %s to check %s", Args[0], File.c_str()); diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index a176da636..51e8eb30f 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -352,6 +352,12 @@ unsigned long DynamicMMap::RawAllocate(unsigned long long Size,unsigned long Aln size in the file. */ 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 Pool *I; Pool *Empty = 0; @@ -412,7 +418,7 @@ unsigned long DynamicMMap::WriteString(const char *String, unsigned long const Result = RawAllocate(Len+1,0); - if (Result == 0 && _error->PendingError()) + if (Base == NULL || (Result == 0 && _error->PendingError())) return 0; memcpy((char *)Base + Result,String,Len); diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index 015c790e0..80fe6e17e 100644 --- a/ftparchive/contents.cc +++ b/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 / if (I - Start >= 1) - Root = Grab(Root,Start,Package); + Grab(Root,Start,Package); } /*}}}*/ // GenContents::WriteSpace - Write a given number of white space chars /*{{{*/ diff --git a/ftparchive/override.cc b/ftparchive/override.cc index 1288ff133..d2130db8a 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -52,45 +52,41 @@ bool Override::ReadOverride(string const &File,bool const &Source) if (*Pkg == 0) 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.. - char *Start = Pkg; + char *Start; char *End = Pkg; 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 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; + + APT_FIND_NEXT_FIELD; } - + // 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; // Source override files only have the two columns @@ -99,7 +95,7 @@ bool Override::ReadOverride(string const &File,bool const &Source) Mapping[Pkg] = Itm; continue; } - + // Find the => for (End++; isspace(*End) != 0 && *End != 0; End++); if (*End != 0) diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc index 677b1c892..e95016240 100644 --- a/test/libapt/parsedepends_test.cc +++ b/test/libapt/parsedepends_test.cc @@ -176,7 +176,7 @@ test: equals("7.15.3~", Version); 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) equals("overlord-dev", Package); else -- cgit v1.2.3 From 9ce3cfc9309c55cc01018c88c1ca82779fd74431 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jan 2014 22:19:49 +0100 Subject: correct some style/performance/warnings from cppcheck The most "visible" change is from utime to utimensat/futimens as the first one isn't part of POSIX anymore. Reported-By: cppcheck Git-Dch: Ignore --- apt-inst/dirstream.cc | 20 +++++++--------- apt-pkg/contrib/fileutl.cc | 2 +- apt-pkg/contrib/gpgv.cc | 5 ++-- apt-pkg/contrib/hashes.cc | 5 ++-- apt-pkg/contrib/hashsum.cc | 7 +++--- apt-pkg/deb/dpkgpm.cc | 9 +++---- apt-pkg/install-progress.cc | 2 +- apt-private/private-list.cc | 12 +++++----- apt-private/private-search.cc | 8 +++---- ftparchive/multicompress.cc | 10 ++++---- methods/connect.cc | 6 ++--- methods/copy.cc | 18 +++++++------- methods/ftp.cc | 49 +++++++++++++++++++++------------------ methods/gzip.cc | 26 +++++++++++---------- methods/http.cc | 4 +--- methods/https.cc | 10 ++++---- methods/https.h | 2 +- methods/mirror.cc | 8 +++---- methods/rsh.cc | 36 ++++++++++++++-------------- methods/server.cc | 25 ++++++++++---------- methods/server.h | 2 +- test/interactive-helper/rpmver.cc | 9 ++++--- 22 files changed, 133 insertions(+), 142 deletions(-) diff --git a/apt-inst/dirstream.cc b/apt-inst/dirstream.cc index 65d1aa188..b62bdcae1 100644 --- a/apt-inst/dirstream.cc +++ b/apt-inst/dirstream.cc @@ -20,7 +20,6 @@ #include #include #include -#include #include #include /*}}}*/ @@ -93,19 +92,18 @@ bool pkgDirStream::FinishedFile(Item &Itm,int Fd) { if (Fd < 0) 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 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 /*{{{*/ diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index efbf7aaf4..1c8acd513 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -319,7 +319,7 @@ bool CreateDirectory(string const &Parent, string const &Path) return false; // 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; vector const dirs = VectorizeString(Path.substr(Parent.size()), '/'); diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 0a469dd7a..9de227062 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -260,8 +260,7 @@ bool SplitClearSignedFile(std::string const &InFile, FileFd * const ContentFile, char *buf = NULL; 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); 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()); _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(); _error->MergeWithStack(); if (splitDone == false) diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index b4c768db9..890573d9c 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/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) { unsigned char Buf[64*64]; - ssize_t Res = 0; - int ToEOF = (Size == 0); + bool const ToEOF = (Size == 0); while (Size != 0 || ToEOF) { unsigned long long n = sizeof(Buf); 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 return false; if (ToEOF && Res == 0) // EOF diff --git a/apt-pkg/contrib/hashsum.cc b/apt-pkg/contrib/hashsum.cc index 289e43aa4..d02177724 100644 --- a/apt-pkg/contrib/hashsum.cc +++ b/apt-pkg/contrib/hashsum.cc @@ -9,13 +9,12 @@ /* */ bool SummationImplementation::AddFD(int const Fd, unsigned long long Size) { unsigned char Buf[64 * 64]; - ssize_t Res = 0; - int ToEOF = (Size == 0); + bool const ToEOF = (Size == 0); while (Size != 0 || ToEOF) { unsigned long long n = sizeof(Buf); 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 return false; 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) { unsigned char Buf[64 * 64]; - bool ToEOF = (Size == 0); + bool const ToEOF = (Size == 0); while (Size != 0 || ToEOF) { unsigned long long n = sizeof(Buf); diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 14ce133cf..1967d5d26 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -568,7 +568,6 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line) std::string prefix = APT::String::Strip(list[0]); std::string pkgname; std::string action; - ostringstream status; // "processing" has the form "processing: action: pkg or trigger" // with action = ["install", "configure", "remove", "purge", "disappear", @@ -1652,7 +1651,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("short read on buffer copy for %s")); - for (vector::iterator I = io_errors.begin(); I != io_errors.end(); I++) + for (vector::iterator I = io_errors.begin(); I != io_errors.end(); ++I) { vector list = VectorizeString(dgettext("dpkg", (*I).c_str()), '%'); if (list.size() > 1) { @@ -1767,13 +1766,11 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) string histfile_name = _config->FindFile("Dir::Log::History"); if (!histfile_name.empty()) { - FILE *log = NULL; - char buf[1024]; - fprintf(report, "DpkgHistoryLog:\n"); - log = fopen(histfile_name.c_str(),"r"); + FILE* log = fopen(histfile_name.c_str(),"r"); if(log != NULL) { + char buf[1024]; while( fgets(buf, sizeof(buf), log) != NULL) fprintf(report, " %s", buf); fclose(log); diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index fe065da4f..a3a4cc0e1 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -242,7 +242,7 @@ PackageManagerFancy::~PackageManagerFancy() void PackageManagerFancy::staticSIGWINCH(int signum) { std::vector::const_iterator I; - for(I = instances.begin(); I != instances.end(); I++) + for(I = instances.begin(); I != instances.end(); ++I) (*I)->HandleSIGWINCH(signum); } diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc index a02ebf02d..898ee7222 100644 --- a/apt-private/private-list.cc +++ b/apt-private/private-list.cc @@ -61,7 +61,7 @@ class PackageNameMatcher : public Matcher /*{{{*/ public: 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]; #ifdef PACKAGE_MATCHER_ABI_COMPAT @@ -79,12 +79,12 @@ class PackageNameMatcher : public Matcher /*{{{*/ } virtual ~PackageNameMatcher() { - for(J=filters.begin(); J != filters.end(); J++) + for(J=filters.begin(); J != filters.end(); ++J) delete *J; } 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; if((*cachefilter)(P)) @@ -104,7 +104,7 @@ void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/ std::ostream &outs) { for (pkgCache::VerIterator Ver = P.VersionList(); - Ver.end() == false; Ver++) + Ver.end() == false; ++Ver) ListSingleVersion(CacheFile, records, Ver, outs); } /*}}}*/ @@ -142,7 +142,7 @@ bool List(CommandLine &Cmd) Cache->Head().PackageCount, _("Listing")); 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; if(_config->FindB("APT::Cmd::All-Versions", false) == true) @@ -159,7 +159,7 @@ bool List(CommandLine &Cmd) // FIXME: SORT! and make sorting flexible (alphabetic, by pkg status) // 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; diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc index ff4140fa7..ade12353a 100644 --- a/apt-private/private-search.cc +++ b/apt-private/private-search.cc @@ -61,18 +61,18 @@ bool FullTextSearch(CommandLine &CmdL) /*{{{*/ progress.OverallProgress(50, 100, 50, _("Full Text Search")); progress.SubProgress(bag.size()); int Done = 0; - for ( ;V != bag.end(); V++) + for ( ;V != bag.end(); ++V) { if (Done%500 == 0) progress.Progress(Done); - Done++; + ++Done; int i; pkgCache::DescIterator Desc = V.TranslatedDescription(); pkgRecords::Parser &parser = records.Lookup(Desc.FileList()); 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() const char *pattern = patterns[i]; @@ -93,7 +93,7 @@ bool FullTextSearch(CommandLine &CmdL) /*{{{*/ // FIXME: SORT! and make sorting flexible (alphabetic, by pkg status) // 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; return true; diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index 1fea589e2..265fb1a80 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -21,9 +21,9 @@ #include #include +#include #include #include -#include #include #include @@ -234,14 +234,12 @@ bool MultiCompress::Finalize(unsigned long long &OutSize) else { // Update the mtime if necessary - if (UpdateMTime > 0 && + if (UpdateMTime > 0 && (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; - } + } } // Force the file permissions diff --git a/methods/connect.cc b/methods/connect.cc index fc7a72ee9..d9c9a1dd4 100644 --- a/methods/connect.cc +++ b/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 char ServStr[300]; if (Port != 0) - snprintf(ServStr,sizeof(ServStr),"%u",Port); + snprintf(ServStr,sizeof(ServStr),"%i", Port); 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 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) { - snprintf(ServStr,sizeof(ServStr),"%u",DefPort); + snprintf(ServStr, sizeof(ServStr), "%i", DefPort); DefPort = 0; continue; } diff --git a/methods/copy.cc b/methods/copy.cc index e81d0022b..744cc2b51 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -18,7 +18,6 @@ #include #include -#include #include #include /*}}}*/ @@ -71,18 +70,19 @@ bool CopyMethod::Fetch(FetchItem *Itm) } From.Close(); - To.Close(); - + // 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(); - return _error->Errno("utime",_("Failed to set modification time")); + return _error->Errno("futimens",_("Failed to set modification time")); } - + To.Close(); + Hashes Hash; FileFd Fd(Res.Filename, FileFd::ReadOnly); Hash.AddFD(Fd); diff --git a/methods/ftp.cc b/methods/ftp.cc index 979adca62..2d05364d5 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -953,14 +952,16 @@ void FtpMethod::SigTerm(int) { if (FailFd == -1) _exit(100); - close(FailFd); - + // 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); } /*}}}*/ @@ -1059,13 +1060,14 @@ bool FtpMethod::Fetch(FetchItem *Itm) if (Server->Get(File,Fd,Res.ResumePoint,Hash,Missing) == false) { Fd.Close(); - + // 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 // otherwise transient fail if (Missing == true) { @@ -1077,20 +1079,21 @@ bool FtpMethod::Fetch(FetchItem *Itm) } 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.TakeHashes(Hash); - - // Timestamp - struct utimbuf UBuf; - UBuf.actime = FailTime; - UBuf.modtime = FailTime; - utime(Queue->DestFile.c_str(),&UBuf); - FailFd = -1; URIDone(Res); - + return true; } /*}}}*/ diff --git a/methods/gzip.cc b/methods/gzip.cc index 48c8e9892..f1edb353b 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -94,32 +93,35 @@ bool GzipMethod::Fetch(FetchItem *Itm) } From.Close(); - To.Close(); - + if (Failed == true) return false; - + // Transfer the modification times struct stat Buf; if (stat(Path.c_str(),&Buf) != 0) 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) return _error->Errno("stat",_("Failed to stat")); - + // Return a Done response Res.LastModified = Buf.st_mtime; - Res.Size = Buf.st_size; Res.TakeHashes(Hash); URIDone(Res); - return true; } /*}}}*/ diff --git a/methods/http.cc b/methods/http.cc index b22b61efc..e1390afcb 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -97,8 +97,6 @@ void CircleBuf::Reset() is non-blocking.. */ bool CircleBuf::Read(int Fd) { - unsigned long long BwReadMax; - while (1) { // Woops, buffer is full @@ -106,7 +104,7 @@ bool CircleBuf::Read(int Fd) return true; // 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) { struct timeval now; diff --git a/methods/https.cc b/methods/https.cc index 2a562434b..e16e36339 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -405,10 +404,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm) curl_easy_getinfo(curl, CURLINFO_FILETIME, &Res.LastModified); 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 Res.LastModified = resultStat.st_mtime; diff --git a/methods/https.h b/methods/https.h index 8632d6d02..89a89d19c 100644 --- a/methods/https.h +++ b/methods/https.h @@ -65,7 +65,7 @@ class HttpsMethod : public pkgAcqMethod public: FileFd *File; - HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig) + HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig), File(NULL) { File = 0; curl = curl_easy_init(); diff --git a/methods/mirror.cc b/methods/mirror.cc index 854366318..83ef0d133 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -114,7 +114,7 @@ bool MirrorMethod::Clean(string Dir) for(I=list.begin(); I != list.end(); ++I) { string uri = (*I)->GetURI(); - if(uri.find("mirror://") != 0) + if(uri.compare(0, strlen("mirror://"), "mirror://") != 0) continue; string BaseUri = uri.substr(0,uri.size()-1); 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 // issues (i.e. Release/Release.gpg different on each mirror) struct utsname buf; - int seed=1, i; + int seed=1; 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]; } } @@ -306,7 +306,7 @@ bool MirrorMethod::InitMirrors() if (s.size() == 0) continue; // ignore non http lines - if (s.find("http://") != 0) + if (s.compare(0, strlen("http://"), "http://") != 0) continue; AllMirrors.push_back(s); diff --git a/methods/rsh.cc b/methods/rsh.cc index d76dca6ef..a441220bf 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -395,13 +394,14 @@ void RSHMethod::SigTerm(int sig) { if (FailFd == -1) _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); } @@ -488,10 +488,11 @@ bool RSHMethod::Fetch(FetchItem *Itm) Fd.Close(); // 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 (Missing == true) @@ -501,18 +502,17 @@ bool RSHMethod::Fetch(FetchItem *Itm) } 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.TakeHashes(Hash); - // Timestamp - struct utimbuf UBuf; - UBuf.actime = FailTime; - UBuf.modtime = FailTime; - utime(Queue->DestFile.c_str(),&UBuf); - FailFd = -1; - URIDone(Res); return true; diff --git a/methods/server.cc b/methods/server.cc index a2128441c..e12c23c07 100644 --- a/methods/server.cc +++ b/methods/server.cc @@ -17,9 +17,9 @@ #include #include +#include #include #include -#include #include #include #include @@ -368,14 +368,14 @@ void ServerMethod::SigTerm(int) { if (FailFd == -1) _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); - - // Timestamp - struct utimbuf UBuf; - UBuf.actime = FailTime; - UBuf.modtime = FailTime; - utime(FailFile.c_str(),&UBuf); - + _exit(100); } /*}}}*/ @@ -539,11 +539,10 @@ int ServerMethod::Loop() File = 0; // 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 if (Result == true) diff --git a/methods/server.h b/methods/server.h index 4dc6a1f2f..2b81e6173 100644 --- a/methods/server.h +++ b/methods/server.h @@ -137,7 +137,7 @@ class ServerMethod : public pkgAcqMethod virtual ServerState * CreateServerState(URI uri) = 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() {}; }; diff --git a/test/interactive-helper/rpmver.cc b/test/interactive-helper/rpmver.cc index 9fc807de8..15c96cbbe 100644 --- a/test/interactive-helper/rpmver.cc +++ b/test/interactive-helper/rpmver.cc @@ -2,6 +2,7 @@ #include #include #include +#include #include #define xisdigit(x) isdigit(x) @@ -12,10 +13,8 @@ using namespace std; int rpmvercmp(const char * a, const char * b) { - char oldch1, oldch2; char * str1, * str2; char * one, * two; - int rc; int isnum; /* 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 */ /* so that they can be restored after the comparison */ - oldch1 = *str1; + char oldch1 = *str1; *str1 = '\0'; - oldch2 = *str2; + char oldch2 = *str2; *str2 = '\0'; /* 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 */ /* if they are equal because there might be more segments to */ /* compare */ - rc = strcmp(one, two); + int rc = strcmp(one, two); if (rc) return rc; /* restore character that was replaced by null above */ -- cgit v1.2.3 From 5fd25d678f51cfa013643efe3429eb08b9504058 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jan 2014 23:00:27 +0100 Subject: use gpg --homedir instead of explicit file placement Avoids that gpg gets the idea it could use files from the user which weren't overridden specifically like secret keyring and trustdb as before. --- cmdline/apt-key.in | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index 463e4b4b4..0ced500db 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -5,22 +5,23 @@ unset GREP_OPTIONS 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 -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 -SECRETKEYRING="${TRUSTDBDIR}/secring.gpg" +SECRETKEYRING="${GPGHOMEDIR}/secring.gpg" 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="$GPG_CMD" -- cgit v1.2.3 From 77a45bebc9168b396334630ef109c1d48ddaf930 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jan 2014 23:51:05 +0100 Subject: use our own homedir for gpg in testcases Git-Dch: Ignore --- test/integration/framework | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index c4953812b..1db1946db 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -124,6 +124,13 @@ gdb() { 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() { # error if we about to overflow, but ... @@ -205,6 +212,20 @@ setupenvironment() { export LC_ALL=C.UTF-8 export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin" 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" } @@ -390,7 +411,7 @@ Package: $NAME" >> ${BUILDDIR}/debian/control | while read SRC; do echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist # 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' \ # --clearsign -o "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC" # mv "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC" @@ -764,7 +785,7 @@ setupaptarchive() { signreleasefiles() { 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… " local REXKEY='keys/rexexpired' local SECEXPIREBAK="${REXKEY}.sec.bak" -- cgit v1.2.3 From 0954c58eeb07f5c3c6e6385e0547924a4917c21d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 17 Jan 2014 01:02:47 +0100 Subject: improve stdout/stderr usage correctness in test framework Also adds a friendly note about how many tests were run/passed so that the end of the testrun isn't all that negative by just showing fails. (It now tells us that we have 111 tests at the moment!) Git-Dch: Ignore --- test/integration/framework | 26 +++++++++++++------------- test/integration/run-tests | 22 +++++++++++++++------- test/integration/test-apt-get-download | 3 ++- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 1db1946db..8d9f99d64 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -19,24 +19,24 @@ fi msgdie() { echo "${CERROR}E: $1${CNORMAL}" >&2; exit 1; } 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; } -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() { 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 if [ -n "$1" ]; then shift; else break; fi 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; } msgfail() { if [ $# -gt 0 ]; then echo "${CFAIL}FAIL: $*${CNORMAL}" >&2; @@ -57,7 +57,7 @@ if [ $MSGLEVEL -le 2 ]; then msgmsg() { true; } msgnmsg() { true; } msgtest() { true; } - msgpass() { echo -n " ${CPASS}P${CNORMAL}" >&2; } + msgpass() { echo -n " ${CPASS}P${CNORMAL}"; } msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; } if [ -n "$CFAIL" ]; then msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE=$((EXIT_CODE+1)); } @@ -81,7 +81,7 @@ msgdone() { [ "$1" = "die" -a $MSGLEVEL -le 0 ]; then true; else - echo "${CDONE}DONE${CNORMAL}" >&2; + echo "${CDONE}DONE${CNORMAL}"; fi } diff --git a/test/integration/run-tests b/test/integration/run-tests index 7316016e2..881c1c56b 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -2,6 +2,9 @@ set -e FAIL=0 +PASS=0 +ALL=0 + FAILED_TESTS="" DIR=$(readlink -f $(dirname $0)) if [ "$1" = "-q" ]; then @@ -29,18 +32,23 @@ for testcase in $(run-parts --list $DIR | grep '/test-'); do echo "${CTEST}Run Testcase ${CHIGH}$(basename ${testcase})${CRESET}" fi 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 echo fi 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 # ensure we don't overflow exit $((FAIL <= 255 ? FAIL : 255)) diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index 6eac079f3..fce0be018 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -19,7 +19,8 @@ testdownload() { APT="${APT}/${3}" fi 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 } -- cgit v1.2.3 From 846856f450a06dcb91bb214791b4eda2380f20ff Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 17 Jan 2014 17:36:47 +0100 Subject: correct some quoting offenses also avoids redirecting messages from dpkg-deb to /dev/null as it might fail (as it is quiet picky) and we should know why if it does. Git-Dch: Ignore --- test/integration/framework | 74 +++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 8d9f99d64..066cdb265 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -87,39 +87,41 @@ msgdone() { runapt() { msgdebug "Executing: ${CCMD}$*${CDEBUG} " + local CMD="$1" + shift 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 - 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 - MALLOC_PERTURB_=21 MALLOC_CHECK_=2 LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$* + MALLOC_PERTURB_=21 MALLOC_CHECK_=2 LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$CMD "$@" fi } -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 $*; } +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 "$@"; } aptwebserver() { - LD_LIBRARY_PATH=${APTWEBSERVERBINDIR} ${APTWEBSERVERBINDIR}/aptwebserver $*; + LD_LIBRARY_PATH=${APTWEBSERVERBINDIR} ${APTWEBSERVERBINDIR}/aptwebserver "$@"; } 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() { 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 - APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $* + APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} command aptitude "$@" else - LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $* + LD_LIBRARY_PATH=${BUILDDIRECTORY} command aptitude "$@" fi } gdb() { 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() { LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods/http @@ -203,7 +205,7 @@ setupenvironment() { echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf echo "DPKG::options:: \"--force-not-root\";" >> 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… fi echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf @@ -267,7 +269,7 @@ configdpkg() { fi fi 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)" if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then DPKGARCH="$(dpkg --print-architecture)" @@ -429,7 +431,12 @@ Package: $NAME" >> ${BUILDDIR}/debian/control (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch) (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" + 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 done @@ -445,14 +452,19 @@ buildpackage() { local RELEASE=$2 local SECTION=$3 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 if [ "$ARCH" = "all" ]; then ARCH="$(dpkg-architecture -qDEB_HOST_ARCH 2> /dev/null)" 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 for PKG in $PKGS; do echo "pool/${PKG}" >> ${TMPWORKINGDIRECTORY}/incoming/${RELEASE}.${SECTION}.pkglist @@ -465,9 +477,9 @@ buildpackage() { buildaptarchive() { if [ -d incoming ]; then - buildaptarchivefromincoming $* + buildaptarchivefromincoming "$@" else - buildaptarchivefromfiles $* + buildaptarchivefromfiles "$@" fi } @@ -952,7 +964,7 @@ Filename: ${2} } 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 echo echo "$DIFFTEXT" @@ -1026,7 +1038,7 @@ N: No packages found" testnopackage() { 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 echo echo "$SHOWPKG" @@ -1038,10 +1050,10 @@ testnopackage() { testdpkginstalled() { 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 echo $PKGS - dpkg -l $* | grep '^[a-z]' + dpkg -l "$@" | grep '^[a-z]' msgfail return 1 fi @@ -1050,10 +1062,10 @@ testdpkginstalled() { testdpkgnotinstalled() { 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 echo - dpkg -l $* | grep '^[a-z]' + dpkg -l "$@" | grep '^[a-z]' msgfail return 1 fi -- cgit v1.2.3 From 039382803d4172d512789e507c1e9a2559a4f235 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 17 Jan 2014 17:53:15 +0100 Subject: use our tmpdir instead of creating tmpfiles Maintaining (mainly the deletion of them) is a pain and they litter /tmp while the testcase is run for no good reason as we could just as well drop it into our tmpdir we have anyway and let them be deleted with the rest automatically Git-Dch: Ignore --- test/integration/framework | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 066cdb265..bbe77dcf8 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -179,7 +179,7 @@ setupenvironment() { mkdir rootdir aptarchive keys 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 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 touch var/lib/dpkg/available mkdir -p usr/lib/apt @@ -844,8 +844,7 @@ webserverconfig() { downloadfile "http://localhost:8080/_config/set/${1}/${2}" '/dev/null' >/dev/null local DOWNLOG='download-testfile.log' 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" if [ "$(cat "$STATUS")" = '200' ]; then msgpass @@ -853,6 +852,7 @@ webserverconfig() { cat >&2 "$DOWNLOG" msgfail "Statuscode was $(cat "$STATUS")" fi + rm "$STATUS" } rewritesourceslist() { @@ -870,9 +870,7 @@ changetowebserver() { fi if test -x ${APTWEBSERVERBINDIR}/aptwebserver; then cd aptarchive - local LOG="$(mktemp)" - addtrap "rm $LOG;" - if ! aptwebserver -o aptwebserver::fork=1 "$@" >$LOG 2>&1 ; then + if ! aptwebserver -o aptwebserver::fork=1 "$@" >webserver.log 2>&1 ; then cat $LOG false fi @@ -991,8 +989,7 @@ testempty() { } testequal() { - local COMPAREFILE=$(mktemp) - addtrap "rm $COMPAREFILE;" + local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequal.comparefile" echo "$1" > $COMPAREFILE shift msgtest "Test for equality of" "$*" @@ -1000,10 +997,9 @@ testequal() { } 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 "$2" > $COMPAREFILE2 shift 2 @@ -1029,8 +1025,7 @@ N: Can't select versions from package '$1' as it is purely virtual" msgtest "Test for virtual packages" "apt-cache show $PACKAGE" VIRTUAL="${VIRTUAL} N: No packages found" - local COMPAREFILE=$(mktemp) - addtrap "rm $COMPAREFILE;" + local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testshowvirtual.comparefile" local ARCH="$(getarchitecture 'native')" echo "$VIRTUAL" | sed -e "s/:$ARCH//" -e 's/:all//' > $COMPAREFILE aptcache show -q=0 $PACKAGE 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail @@ -1073,8 +1068,7 @@ testdpkgnotinstalled() { } testmarkedauto() { - local COMPAREFILE=$(mktemp) - addtrap "rm $COMPAREFILE;" + local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testmarkedauto.comparefile" if [ -n "$1" ]; then msgtest 'Test for correctly marked as auto-installed' "$*" while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE @@ -1091,8 +1085,7 @@ testsuccess() { else msgtest 'Test for successful execution of' "$*" fi - local OUTPUT=$(mktemp) - addtrap "rm $OUTPUT;" + local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" if $@ >${OUTPUT} 2>&1; then msgpass else @@ -1108,8 +1101,7 @@ testfailure() { else msgtest 'Test for failure in execution of' "$*" fi - local OUTPUT=$(mktemp) - addtrap "rm $OUTPUT;" + local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" if $@ >${OUTPUT} 2>&1; then echo cat $OUTPUT -- cgit v1.2.3 From eb9dee9602941af8a62f619817f1956ce7363074 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 17 Jan 2014 19:37:45 +0100 Subject: ensure the right permissions as dpkg-deb ensists otherwise you get with pickier umasks errors like: dpkg-deb: error: control directory has bad permissions 700 (must be >=0755 and <=0775) so we just force a 755 for the control directory and dpkg is happy. Git-Dch: Ignore --- test/integration/framework | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/framework b/test/integration/framework index bbe77dcf8..15c51e6ef 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -432,6 +432,8 @@ Package: $NAME" >> ${BUILDDIR}/debian/control (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch) (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) 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 -- cgit v1.2.3 From 1290422a1074e59bf37241596d60e28afb76fb5c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 17 Jan 2014 22:43:42 +0100 Subject: get color/msglevel handling for tests in line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without a PTY attached do not use color, but use the same MSGLEVEL with or without a PTY. The level is better adjust via flags – especially as it is likely that without a PTY you want fullblown logs instead of the reduced display you get with -q otherwise. Git-Dch: Ignore --- test/integration/framework | 30 ++++++++++++++++++------------ test/integration/run-tests | 35 +++++++++++++++++++++++------------ 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 15c51e6ef..3ea9f3774 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -3,18 +3,24 @@ EXIT_CODE=0 # 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 msgdie() { echo "${CERROR}E: $1${CNORMAL}" >&2; exit 1; } diff --git a/test/integration/run-tests b/test/integration/run-tests index 881c1c56b..79d5d1a29 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -7,22 +7,33 @@ ALL=0 FAILED_TESTS="" 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' CHIGH='\033[1;35m' CRESET='\033[0m' -elif [ -z "${MSGLEVEL}" ]; then - export MSGLEVEL=2 -fi - -if [ -z "$MSGLEVEL" ]; then - MSGLEVEL=5 +else + CTEST='' + CHIGH='' + CRESET='' fi for testcase in $(run-parts --list $DIR | grep '/test-'); do -- cgit v1.2.3 From 36e6c8e36f44355d7bbd78747198ec924dfe9910 Mon Sep 17 00:00:00 2001 From: Chris Leick Date: Fri, 24 Jan 2014 12:37:24 +0100 Subject: update german manpage translation --- doc/po/de.po | 133 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 64 insertions(+), 69 deletions(-) diff --git a/doc/po/de.po b/doc/po/de.po index 8983abb64..67c3f992b 100644 --- a/doc/po/de.po +++ b/doc/po/de.po @@ -1,14 +1,14 @@ # 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 , 2009-2012. +# Chris Leick , 2009-2014. # msgid "" msgstr "" -"Project-Id-Version: apt-doc 0.9.7\n" +"Project-Id-Version: apt-doc 0.9.14.2\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2013-12-29 17:01+0100\n" -"PO-Revision-Date: 2012-06-25 22:49+0100\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 \n" "Language-Team: German \n" "Language: de\n" @@ -1334,6 +1334,14 @@ msgid "" "will never remove packages, only allow adding new ones. Configuration Item: " "APT::Get::Upgrade-Allow-New." msgstr "" +"erlaubt das Installieren neuer Pakete, wenn es zusammen mit " +"upgrade benutzt wird. Dies ist nützlich, falls das " +"Aktualisieren eines installierten Pakets zur Installation neue " +"Abhängigkeiten hat. Anstatt das Paket zurückzuhalten, wird upgrade ein Upgrade des Pakets durchführen und die neuen Abhängigkeiten " +"installieren. Beachten Sie, dass upgrade mit dieser " +"Option niemals Pakete entfernen, sondern nur das Hinzufügen neuer gestatten " +"wird.Konfigurationselement: APT::Get::Upgrade-Allow-New." #. type: Content of: #: apt-get.8.xml:407 @@ -1553,6 +1561,7 @@ msgstr "" "fragen. Dies ist für Werkzeuge wie pbuilder nützlich. Konfigurationselement: " "APT::Get::AllowUnauthenticated." +# FIXME s/Item/Items/ #. type: Content of: #: apt-get.8.xml:527 msgid "" @@ -1562,6 +1571,12 @@ msgid "" "Item: DpkgPM::Progress and Dpkg::Progress-Fancy." 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: DpkgPM::Progress und " +"Dpkg::Progress-Fancy." #. type: Content of: #: apt-get.8.xml:540 apt-cache.8.xml:345 apt-key.8.xml:176 apt-mark.8.xml:127 @@ -2900,20 +2915,14 @@ msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: 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 "" "Do not try to auto-detect the CD-ROM path. Usually combined with the " "<option>--cdrom</option> option. Configuration Item: <literal>Acquire::" "cdrom::AutoDetect</literal>." 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> #: apt-cdrom.8.xml:95 @@ -3894,13 +3903,6 @@ msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: 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 "" "The used bandwidth can be limited with <literal>Acquire::http::Dl-Limit</" "literal> which accepts integer values in kilobytes per second. The default " @@ -3909,11 +3911,11 @@ msgid "" "multiple servers at the same time." msgstr "" "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> #: apt.conf.5.xml:398 @@ -3940,6 +3942,15 @@ msgid "" "takes precedence over the legacy option name <literal>ProxyAutoDetect</" "literal>." 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> #: apt.conf.5.xml:420 @@ -4330,12 +4341,12 @@ msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt.conf.5.xml:576 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> #: apt.conf.5.xml:582 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> #: apt.conf.5.xml:589 @@ -4575,13 +4586,6 @@ msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: 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 "" "This is a list of shell commands to run before invoking &dpkg;. Like " "<literal>options</literal> this must be specified in list notation. The " @@ -4595,17 +4599,12 @@ msgstr "" "Listenschreibweise angegeben werden. Die Befehle werden der Reihenfolge nach " "mit <filename>/bin/sh</filename> aufgerufen, sollte einer fehlschlagen, wird " "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> #: 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 "" "Version 2 of this protocol dumps more information, including the protocol " "version, the APT configuration space and the packages, files and versions " @@ -4614,10 +4613,8 @@ msgid "" msgstr "" "Version 2 dieses Protokolls gibt mehr Informationen aus, einschließlich der " "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> #: apt.conf.5.xml:715 @@ -4629,6 +4626,13 @@ msgid "" "the requested version it will send the information in the highest version it " "has support for instead." 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> #: apt.conf.5.xml:722 @@ -4640,6 +4644,13 @@ msgid "" "looking for the environment variable <envar>APT_HOOK_INFO_FD</envar> which " "contains the number of the used file descriptor as a confirmation." 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> #: apt.conf.5.xml:732 @@ -6816,25 +6827,18 @@ msgstr "" #. type: Content of: <refentry><refsect1><para><itemizedlist><listitem><para> #: sources.list.5.xml:124 -#, 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." msgid "" "<literal>arch+=<replaceable>arch1</replaceable>,<replaceable>arch2</" "replaceable>,…</literal> and <literal>arch-=<replaceable>arch1</replaceable>," "<replaceable>arch2</replaceable>,…</literal> which can be used to add/remove " "architectures from the set which will be downloaded." 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> #: sources.list.5.xml:127 @@ -8685,18 +8689,9 @@ msgstr "" #. type: <p></p> #: 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 "" "<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 " "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 " -- cgit v1.2.3 From 2f958de6e883ba7b0c9895750d4dde35047f1e82 Mon Sep 17 00:00:00 2001 From: David Kalnischkies <david@kalnischkies.de> Date: Sat, 25 Jan 2014 01:00:23 +0100 Subject: use svg in doxygen and ensure dot is around for it --- debian/control | 2 +- doc/Doxyfile.in | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/control b/debian/control index c70d0e9ea..f3303e891 100644 --- a/debian/control +++ b/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~), zlib1g-dev, libbz2-dev, xsltproc, docbook-xsl, docbook-xml, 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 Vcs-Git: git://anonscm.debian.org/apt/apt.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=apt/apt.git diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index a0087cd2c..9ebbd9673 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -880,7 +880,7 @@ HTML_OUTPUT = html # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # 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 # 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 # 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 default size is 10pt. @@ -1815,7 +1815,7 @@ DIRECTORY_GRAPH = YES # HTML_FILE_EXTENSION to xhtml in order to make the SVG files # 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 # 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 # 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 # found. If left blank, it is assumed the dot tool can be found in the path. -- cgit v1.2.3 From abaf0b8831bfb415137b10f56d89d3180906be38 Mon Sep 17 00:00:00 2001 From: Chris Leick <c.leick@vollbio.de> Date: Sun, 26 Jan 2014 15:44:45 +0100 Subject: Trivian unfuzzies of the German po4a translation --- doc/po/de.po | 127 +++++++++++++++++++++++------------------------------------ 1 file changed, 49 insertions(+), 78 deletions(-) diff --git a/doc/po/de.po b/doc/po/de.po index 61f99ee81..883aa49a8 100644 --- a/doc/po/de.po +++ b/doc/po/de.po @@ -1,29 +1,14 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Free Software Foundation, Inc. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# 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. # -#, fuzzy msgid "" msgstr "" -"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" +"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" +"PO-Revision-Date: 2014-01-26 15:26+0100\n" "Last-Translator: Chris Leick <c.leick@vollbio.de>\n" "Language-Team: German <debian-l10n-german@lists.debian.org>\n" "Language: de\n" @@ -6733,10 +6718,9 @@ msgstr "" #. type: Content of: <refentry><refsect1><literallayout> #: sources.list.5.xml:82 -#, fuzzy, no-wrap -#| msgid "deb [ options ] uri distribution [component1] [component2] [...]" +#, no-wrap msgid "deb [ options ] uri suite [component1] [component2] [...]" -msgstr "deb [ Optionen ] URI Distribution [Komponente1] [Komponente2] […]" +msgstr "deb [ Optionen ] URI Suite [Komponente1] [Komponente2] […]" #. type: Content of: <refentry><refsect1><para><literallayout> #: sources.list.5.xml:86 @@ -6760,6 +6744,23 @@ msgid "" " [option1]: [option1-value]\n" " " msgstr "" +" Types: deb deb-src\n" +" URIs: http://example.com\n" +" Suites: stable testing\n" +" Sections: Komponente1 Komponente2\n" +" Description: short\n" +" long long long\n" +" [Option1]: [Option1-Wert]\n" +"\n" +" Types: deb\n" +" URIs: http://another.example.com\n" +" Suites: experimental\n" +" Sections: Komponente1 Komponente2\n" +" Enabled: no\n" +" Description: short\n" +" long long long\n" +" [Option1]: [Option1-Wert]\n" +" " #. type: Content of: <refentry><refsect1><para> #: sources.list.5.xml:84 @@ -6767,19 +6768,11 @@ msgid "" "Alternatively a rfc822 style format is also supported: <placeholder type=" "\"literallayout\" id=\"0\"/>" msgstr "" +"Alternativ wird auch ein Format im Stil von RFC822 unterstützt: <placeholder " +"type=\"literallayout\" id=\"0\"/>" #. type: Content of: <refentry><refsect1><para> #: sources.list.5.xml:105 -#, fuzzy -#| msgid "" -#| "The URI for the <literal>deb</literal> type must specify the base of the " -#| "Debian distribution, from which APT will find the information it needs. " -#| "<literal>distribution</literal> can specify an exact path, in which case " -#| "the components must be omitted and <literal>distribution</literal> must " -#| "end with a slash (<literal>/</literal>). This is useful for the case when " -#| "only a particular sub-section of the archive denoted by the URI is of " -#| "interest. If <literal>distribution</literal> does not specify an exact " -#| "path, at least one <literal>component</literal> must be present." msgid "" "The URI for the <literal>deb</literal> type must specify the base of the " "Debian distribution, from which APT will find the information it needs. " @@ -6792,25 +6785,15 @@ msgid "" msgstr "" "Die URI für den <literal>deb</literal>-Typ muss die Basis der Debian-" "Distribution angeben, wo APT die Informationen findet, die es benötigt. " -"<literal>Distribution</literal> kann einen genauen Pfad angeben. In diesem " -"Fall müssen die Komponenten weggelassen werden und <literal>Distribution</" -"literal> muss mit einem Schrägstrich (<literal>/</literal>) enden. Dies ist " -"nützlich, wenn nur ein bestimmter Unterabschnitt des von der URI angegebenen " -"Archivs von Interesse ist. Wenn <literal>Distribution</literal> keinen " -"genauen Pfad angibt, muss mindestens eine <literal>Komponente</literal> " -"angegeben sein." +"<literal>Suite</literal> kann einen genauen Pfad angeben. In diesem Fall " +"müssen die Komponenten weggelassen werden und <literal>Suite</literal> muss " +"mit einem Schrägstrich (<literal>/</literal>) enden. Dies ist nützlich, wenn " +"nur ein bestimmter Unterabschnitt des von der URI angegebenen Archivs von " +"Interesse ist. Wenn <literal>Suite</literal> keinen genauen Pfad angibt, muss " +"mindestens eine <literal>Komponente</literal> angegeben sein." #. type: Content of: <refentry><refsect1><para> #: sources.list.5.xml:114 -#, fuzzy -#| msgid "" -#| "<literal>distribution</literal> may also contain a variable, <literal>" -#| "$(ARCH)</literal> which expands to the Debian architecture (such as " -#| "<literal>amd64</literal> or <literal>armel</literal>) used on the system. " -#| "This permits architecture-independent <filename>sources.list</filename> " -#| "files to be used. In general this is only of interest when specifying an " -#| "exact path, <literal>APT</literal> will automatically generate a URI with " -#| "the current architecture otherwise." msgid "" "<literal>suite</literal> may also contain a variable, <literal>$(ARCH)</" "literal> which expands to the Debian architecture (such as <literal>amd64</" @@ -6820,8 +6803,8 @@ msgid "" "<literal>APT</literal> will automatically generate a URI with the current " "architecture otherwise." msgstr "" -"<literal>distribution</literal> könnte außerdem eine Variable, <literal>" -"$(ARCH)</literal>, enthalten, die zur Debian-Architektur (wie " +"<literal>Suite</literal> könnte außerdem eine Variable, " +"<literal>$(ARCH)</literal>, enthalten, die zur Debian-Architektur (wie " "<literal>amd64</literal> oder <literal>armel</literal>) expandiert wird, die " "auf dem System benutzt wird. Dies erlaubt es, architekturunabhängige " "<filename>sources.list</filename>-Dateien zu benutzen. Im Allgemeinen ist " @@ -6831,19 +6814,6 @@ msgstr "" #. type: Content of: <refentry><refsect1><para> #: sources.list.5.xml:122 -#, fuzzy -#| msgid "" -#| "Since only one distribution can be specified per line it may be necessary " -#| "to have multiple lines for the same URI, if a subset of all available " -#| "distributions or components at that location is desired. APT will sort " -#| "the URI list after it has generated a complete set internally, and will " -#| "collapse multiple references to the same Internet host, for instance, " -#| "into a single connection, so that it does not inefficiently establish an " -#| "FTP connection, close it, do something else, and then re-establish a " -#| "connection to that same host. This feature is useful for accessing busy " -#| "FTP sites with limits on the number of simultaneous anonymous users. APT " -#| "also parallelizes connections to different hosts to more effectively deal " -#| "with sites with low bandwidth." msgid "" "In the traditional style sources.list format since only one distribution can " "be specified per line it may be necessary to have multiple lines for the " @@ -6857,18 +6827,19 @@ msgid "" "users. APT also parallelizes connections to different hosts to more " "effectively deal with sites with low bandwidth." msgstr "" -"Da pro Zeile nur eine Distribution angegeben werden kann, könnte es nötig " -"sein, mehrere Zeilen für die gleiche URI zu haben, falls eine Untermenge " -"aller verfügbarer Distributionen oder Komponenten von diesem Ort gewünscht " -"wird. APT wird die URI-Liste sortieren, nachdem es intern eine komplette " -"Zusammenstellung generiert hat und es wird mehrere Bezüge zum gleichen " -"Internet-Rechner zusammenfassen, zum Beispiel zu einer einzigen Verbindung, " -"so dass es nicht ineffizient FTP-Verbindungen herstellt, sie schließt, sonst " -"etwas tut und dann erneut eine Verbindung zum gleichen Rechner herstellt. " -"Diese Funktion ist nützlich für den Zugriff auf ausgelastete FTP-Sites mit " -"Begrenzungen der Anzahl gleichzeitiger anonymer Anwender. APT parallelisiert " -"außerdem Verbindungen zu verschiedenen Rechnern, um effektiver mit Orten " -"niedriger Bandbreite hauszuhalten." +"In der Sources.list im herkömmlichen Formatstil könnte es nötig sein, da pro " +"Zeile nur eine Distribution angegeben werden kann, mehrere Zeilen für die " +"gleiche URI zu haben, falls eine Untermenge aller verfügbarer Distributionen " +"oder Komponenten von diesem Ort gewünscht wird. APT wird die URI-Liste " +"sortieren, nachdem es intern eine komplette Zusammenstellung generiert hat " +"und es wird mehrere Bezüge zum gleichen Internet-Rechner zusammenfassen, zum " +"Beispiel zu einer einzigen Verbindung, so dass es nicht ineffizient " +"FTP-Verbindungen herstellt, sie schließt, sonst etwas tut und dann erneut " +"eine Verbindung zum gleichen Rechner herstellt. Diese Funktion ist nützlich " +"für den Zugriff auf ausgelastete FTP-Sites mit Begrenzungen der Anzahl " +"gleichzeitiger anonymer Anwender. APT parallelisiert außerdem Verbindungen zu " +"verschiedenen Rechnern, um effektiver mit Orten niedriger Bandbreite " +"hauszuhalten." #. type: Content of: <refentry><refsect1><para> #: sources.list.5.xml:136 -- cgit v1.2.3 From a0db467c7eb0e63b8e74887403689e2b446dde7f Mon Sep 17 00:00:00 2001 From: David Kalnischkies <david@kalnischkies.de> Date: Sun, 26 Jan 2014 13:06:31 +0100 Subject: fixup merge issues introduced in 796673c Issues in doc/po/de.po (fixed by Chris already) and test/integration/framework Git-Dch: Ignore --- test/integration/framework | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 5439244f7..5b9a58568 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -880,7 +880,8 @@ changetowebserver() { fi if test -x ${APTWEBSERVERBINDIR}/aptwebserver; then cd aptarchive - if ! aptwebserver -o aptwebserver::fork=1 "$@" >webserver.log 2>&1 ; then + local LOG="webserver.log" + if ! aptwebserver -o aptwebserver::fork=1 "$@" >$LOG 2>&1 ; then cat $LOG false fi @@ -1006,7 +1007,6 @@ testequal() { fi local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequal.comparefile" - addtrap "rm $COMPAREFILE;" echo "$1" > $COMPAREFILE shift -- cgit v1.2.3 From bae81c1307e956aa8928c9d6a77830fb733cd61f Mon Sep 17 00:00:00 2001 From: David Kalnischkies <david@kalnischkies.de> Date: Sun, 26 Jan 2014 15:29:10 +0100 Subject: enable deb822 sources for associated testcase Git-Dch: Ignore --- test/integration/test-apt-sources-deb822 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822 index 742adb5e2..87f1886ea 100755 --- a/test/integration/test-apt-sources-deb822 +++ b/test/integration/test-apt-sources-deb822 @@ -7,6 +7,8 @@ TESTDIR=$(readlink -f $(dirname $0)) setupenvironment configarchitecture 'i386' +echo 'APT::Sources::Use-Deb822 "true";' > rootdir/etc/apt/apt.conf.d/00enabledeb822 + SOURCES='rootdir/etc/apt/sources.list' BASE='# some comment # that contains a : as well @@ -19,13 +21,13 @@ Sections: main Description: summay and the long part' -msgtest 'Test old-style sources.list' +msgtest 'Test sources.list' 'old style' echo "deb http://ftp.debian.org/debian stable main" > $SOURCES testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris -msgtest 'Test simple deb822 sources.list' +msgtest 'Test sources.list' 'simple deb822' echo "$BASE" > $SOURCES testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : -- cgit v1.2.3