From: Michael Vogt Date: Wed, 17 Oct 2012 08:27:50 +0000 (+0200) Subject: * lp:~mvo/apt/add-glob-function: X-Git-Tag: 1.1.exp1~57 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/20a2b201389092a17763b703039b2e4528234e30?hp=-c * lp:~mvo/apt/add-glob-function: - add Glob() to fileutl.{cc,h} --- 20a2b201389092a17763b703039b2e4528234e30 diff --combined apt-pkg/contrib/fileutl.cc index 4c224337e,d6930ddd5..a31a8a141 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@@ -41,14 -41,19 +41,16 @@@ #include #include #include + #include + #include #include -// FIXME: Compressor Fds have some speed disadvantages and are a bit buggy currently, -// so while the current implementation satisfies the testcases it is not a real option -// to disable it for now -#define APT_USE_ZLIB 1 -#if APT_USE_ZLIB -#include -#else -#pragma message "Usage of zlib is DISABLED!" +#ifdef HAVE_ZLIB + #include +#endif +#ifdef HAVE_BZ2 + #include #endif #ifdef WORDS_BIGENDIAN @@@ -62,15 -67,10 +64,15 @@@ using namespace std class FileFdPrivate { public: -#if APT_USE_ZLIB +#ifdef HAVE_ZLIB gzFile gz; #else void* gz; +#endif +#ifdef HAVE_BZ2 + BZFILE* bz2; +#else + void* bz2; #endif int compressed_fd; pid_t compressor_pid; @@@ -78,34 -78,8 +80,34 @@@ APT::Configuration::Compressor compressor; unsigned int openmode; unsigned long long seekpos; - FileFdPrivate() : gz(NULL), compressed_fd(-1), compressor_pid(-1), pipe(false), + FileFdPrivate() : gz(NULL), bz2(NULL), + compressed_fd(-1), compressor_pid(-1), pipe(false), openmode(0), seekpos(0) {}; + bool CloseDown(std::string const &FileName) + { + bool Res = true; +#ifdef HAVE_ZLIB + if (gz != NULL) { + int const e = gzclose(gz); + gz = NULL; + // gzdclose() on empty files always fails with "buffer error" here, ignore that + if (e != 0 && e != Z_BUF_ERROR) + Res &= _error->Errno("close",_("Problem closing the gzip file %s"), FileName.c_str()); + } +#endif +#ifdef HAVE_BZ2 + if (bz2 != NULL) { + BZ2_bzclose(bz2); + bz2 = NULL; + } +#endif + if (compressor_pid > 0) + ExecWait(compressor_pid, "FileFdCompressor", true); + compressor_pid = -1; + + return Res; + } + ~FileFdPrivate() { CloseDown(""); } }; // RunScripts - Run a set of scripts from a configuration subtree /*{{{*/ @@@ -852,26 -826,6 +854,26 @@@ bool ExecWait(pid_t Pid,const char *Nam } /*}}}*/ +// StartsWithGPGClearTextSignature - Check if a file is Pgp/GPG clearsigned /*{{{*/ +// --------------------------------------------------------------------- +/* */ +bool StartsWithGPGClearTextSignature(string const &FileName) +{ + static const char* SIGMSG = "-----BEGIN PGP SIGNED MESSAGE-----\n"; + char buffer[strlen(SIGMSG)+1]; + FILE* gpg = fopen(FileName.c_str(), "r"); + if (gpg == NULL) + return false; + + char const * const test = fgets(buffer, sizeof(buffer), gpg); + fclose(gpg); + if (test == NULL || strcmp(buffer, SIGMSG) != 0) + return false; + + return true; +} + + // FileFd::Open - Open a file /*{{{*/ // --------------------------------------------------------------------- /* The most commonly used open mode combinations are given with Mode */ @@@ -883,6 -837,7 +885,6 @@@ bool FileFd::Open(string FileName,unsig if (Compress == Auto && (Mode & WriteOnly) == WriteOnly) return _error->Error("Autodetection on %s only works in ReadOnly openmode!", FileName.c_str()); - // FIXME: Denote inbuilt compressors somehow - as we don't need to have the binaries for them std::vector const compressors = APT::Configuration::getCompressors(); std::vector::const_iterator compressor = compressors.begin(); if (Compress == Auto) @@@ -950,6 -905,8 +952,6 @@@ bool FileFd::Open(string FileName,unsigned int const Mode,APT::Configuration::Compressor const &compressor, unsigned long const Perms) { Close(); - d = new FileFdPrivate; - d->openmode = Mode; Flags = AutoClose; if ((Mode & WriteOnly) != WriteOnly && (Mode & (Atomic | Create | Empty | Exclusive)) != 0) @@@ -1043,21 -1000,10 +1045,21 @@@ bool FileFd::OpenDescriptor(int Fd, uns bool FileFd::OpenDescriptor(int Fd, unsigned int const Mode, APT::Configuration::Compressor const &compressor, bool AutoClose) { Close(); - d = new FileFdPrivate; - d->openmode = Mode; Flags = (AutoClose) ? FileFd::AutoClose : 0; - iFd = Fd; + if (AutoClose == false && ( +#ifdef HAVE_ZLIB + compressor.Name == "gzip" || +#endif +#ifdef HAVE_BZ2 + compressor.Name == "bzip2" || +#endif + false)) + { + // Need to duplicate fd here or gzclose for cleanup will close the fd as well + iFd = dup(Fd); + } + else + iFd = Fd; this->FileName = ""; if (OpenInternDescriptor(Mode, compressor) == false) { @@@ -1069,71 -1015,32 +1071,71 @@@ } bool FileFd::OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor) { - d->compressor = compressor; if (compressor.Name == "." || compressor.Binary.empty() == true) return true; -#if APT_USE_ZLIB - else if (compressor.Name == "gzip") + + if (d == NULL) { + d = new FileFdPrivate(); + d->openmode = Mode; + d->compressor = compressor; + } + +#ifdef HAVE_ZLIB + if (compressor.Name == "gzip") + { + if (d->gz != NULL) + { + gzclose(d->gz); + d->gz = NULL; + } if ((Mode & ReadWrite) == ReadWrite) d->gz = gzdopen(iFd, "r+"); else if ((Mode & WriteOnly) == WriteOnly) d->gz = gzdopen(iFd, "w"); else - d->gz = gzdopen (iFd, "r"); + d->gz = gzdopen(iFd, "r"); if (d->gz == NULL) return false; Flags |= Compressed; return true; } #endif +#ifdef HAVE_BZ2 + if (compressor.Name == "bzip2") + { + if (d->bz2 != NULL) + { + BZ2_bzclose(d->bz2); + d->bz2 = NULL; + } + if ((Mode & ReadWrite) == ReadWrite) + d->bz2 = BZ2_bzdopen(iFd, "r+"); + else if ((Mode & WriteOnly) == WriteOnly) + d->bz2 = BZ2_bzdopen(iFd, "w"); + else + d->bz2 = BZ2_bzdopen(iFd, "r"); + if (d->bz2 == NULL) + return false; + Flags |= Compressed; + return true; + } +#endif + + // collect zombies here in case we reopen + if (d->compressor_pid > 0) + ExecWait(d->compressor_pid, "FileFdCompressor", true); if ((Mode & ReadWrite) == ReadWrite) + { + Flags |= Fail; return _error->Error("ReadWrite mode is not supported for file %s", FileName.c_str()); + } bool const Comp = (Mode & WriteOnly) == WriteOnly; - // Handle 'decompression' of empty files if (Comp == false) { + // Handle 'decompression' of empty files struct stat Buf; fstat(iFd, &Buf); if (Buf.st_size == 0 && S_ISFIFO(Buf.st_mode) == false) @@@ -1142,19 -1049,13 +1144,19 @@@ // We don't need the file open - instead let the compressor open it // as he properly knows better how to efficiently read from 'his' file if (FileName.empty() == false) + { close(iFd); + iFd = -1; + } } // Create a data pipe int Pipe[2] = {-1,-1}; if (pipe(Pipe) != 0) + { + Flags |= Fail; return _error->Errno("pipe",_("Failed to create subprocess IPC")); + } for (int J = 0; J != 2; J++) SetCloseExec(Pipe[J],true); @@@ -1181,12 -1082,6 +1183,12 @@@ dup2(d->compressed_fd,STDIN_FILENO); dup2(Pipe[1],STDOUT_FILENO); } + int const nullfd = open("/dev/null", O_WRONLY); + if (nullfd != -1) + { + dup2(nullfd,STDERR_FILENO); + close(nullfd); + } SetCloseExec(STDOUT_FILENO,false); SetCloseExec(STDIN_FILENO,false); @@@ -1216,6 -1111,8 +1218,6 @@@ close(Pipe[0]); else close(Pipe[1]); - if (Comp == true || FileName.empty() == true) - close(d->compressed_fd); return true; } @@@ -1227,12 -1124,6 +1229,12 @@@ FileFd::~FileFd() { Close(); + if (d != NULL) + { + d->CloseDown(FileName); + delete d; + d = NULL; + } } /*}}}*/ // FileFd::Read - Read a bit of the file /*{{{*/ @@@ -1248,14 -1139,9 +1250,14 @@@ bool FileFd::Read(void *To,unsigned lon *((char *)To) = '\0'; do { -#if APT_USE_ZLIB - if (d->gz != NULL) - Res = gzread(d->gz,To,Size); +#ifdef HAVE_ZLIB + if (d != NULL && d->gz != NULL) + Res = gzread(d->gz,To,Size); + else +#endif +#ifdef HAVE_BZ2 + if (d != NULL && d->bz2 != NULL) + Res = BZ2_bzread(d->bz2,To,Size); else #endif Res = read(iFd,To,Size); @@@ -1265,31 -1151,21 +1267,31 @@@ if (errno == EINTR) continue; Flags |= Fail; -#if APT_USE_ZLIB - if (d->gz != NULL) +#ifdef HAVE_ZLIB + if (d != NULL && d->gz != NULL) { int err; char const * const errmsg = gzerror(d->gz, &err); if (err != Z_ERRNO) return _error->Error("gzread: %s (%d: %s)", _("Read error"), err, errmsg); } +#endif +#ifdef HAVE_BZ2 + if (d != NULL && d->bz2 != NULL) + { + int err; + char const * const errmsg = BZ2_bzerror(d->bz2, &err); + if (err != BZ_IO_ERROR) + return _error->Error("BZ2_bzread: %s (%d: %s)", _("Read error"), err, errmsg); + } #endif return _error->Errno("read",_("Read error")); } To = (char *)To + Res; Size -= Res; - d->seekpos += Res; + if (d != NULL) + d->seekpos += Res; if (Actual != 0) *Actual += Res; } @@@ -1316,8 -1192,8 +1318,8 @@@ char* FileFd::ReadLine(char *To, unsigned long long const Size) { *To = '\0'; -#if APT_USE_ZLIB - if (d->gz != NULL) +#ifdef HAVE_ZLIB + if (d != NULL && d->gz != NULL) return gzgets(d->gz, To, Size); #endif @@@ -1347,15 -1223,10 +1349,15 @@@ bool FileFd::Write(const void *From,uns errno = 0; do { -#if APT_USE_ZLIB - if (d->gz != NULL) +#ifdef HAVE_ZLIB + if (d != NULL && d->gz != NULL) Res = gzwrite(d->gz,From,Size); else +#endif +#ifdef HAVE_BZ2 + if (d != NULL && d->bz2 != NULL) + Res = BZ2_bzwrite(d->bz2,(void*)From,Size); + else #endif Res = write(iFd,From,Size); if (Res < 0 && errno == EINTR) @@@ -1363,31 -1234,12 +1365,31 @@@ if (Res < 0) { Flags |= Fail; +#ifdef HAVE_ZLIB + if (d != NULL && d->gz != NULL) + { + int err; + char const * const errmsg = gzerror(d->gz, &err); + if (err != Z_ERRNO) + return _error->Error("gzwrite: %s (%d: %s)", _("Write error"), err, errmsg); + } +#endif +#ifdef HAVE_BZ2 + if (d != NULL && d->bz2 != NULL) + { + int err; + char const * const errmsg = BZ2_bzerror(d->bz2, &err); + if (err != BZ_IO_ERROR) + return _error->Error("BZ2_bzwrite: %s (%d: %s)", _("Write error"), err, errmsg); + } +#endif return _error->Errno("write",_("Write error")); } From = (char *)From + Res; Size -= Res; - d->seekpos += Res; + if (d != NULL) + d->seekpos += Res; } while (Res > 0 && Size > 0); @@@ -1396,28 -1248,6 +1398,28 @@@ Flags |= Fail; return _error->Error(_("write, still have %llu to write but couldn't"), Size); +} +bool FileFd::Write(int Fd, const void *From, unsigned long long Size) +{ + int Res; + errno = 0; + do + { + Res = write(Fd,From,Size); + if (Res < 0 && errno == EINTR) + continue; + if (Res < 0) + return _error->Errno("write",_("Write error")); + + From = (char *)From + Res; + Size -= Res; + } + while (Res > 0 && Size > 0); + + if (Size == 0) + return true; + + return _error->Error(_("write, still have %llu to write but couldn't"), Size); } /*}}}*/ // FileFd::Seek - Seek in the file /*{{{*/ @@@ -1425,11 -1255,7 +1427,11 @@@ /* */ bool FileFd::Seek(unsigned long long To) { - if (d->pipe == true) + if (d != NULL && (d->pipe == true +#ifdef HAVE_BZ2 + || d->bz2 != NULL +#endif + )) { // Our poor man seeking in pipes is costly, so try to avoid it unsigned long long seekpos = Tell(); @@@ -1439,17 -1265,9 +1441,17 @@@ return Skip(To - seekpos); if ((d->openmode & ReadOnly) != ReadOnly) + { + Flags |= Fail; return _error->Error("Reopen is only implemented for read-only files!"); - close(iFd); - iFd = 0; + } +#ifdef HAVE_BZ2 + if (d->bz2 != NULL) + BZ2_bzclose(d->bz2); +#endif + if (iFd != -1) + close(iFd); + iFd = -1; if (TemporaryFileName.empty() == false) iFd = open(TemporaryFileName.c_str(), O_RDONLY); else if (FileName.empty() == false) @@@ -1459,18 -1277,12 +1461,18 @@@ if (d->compressed_fd > 0) if (lseek(d->compressed_fd, 0, SEEK_SET) != 0) iFd = d->compressed_fd; - if (iFd <= 0) + if (iFd < 0) + { + Flags |= Fail; return _error->Error("Reopen is not implemented for pipes opened with FileFd::OpenDescriptor()!"); + } } if (OpenInternDescriptor(d->openmode, d->compressor) == false) + { + Flags |= Fail; return _error->Error("Seek on file %s because it couldn't be reopened", FileName.c_str()); + } if (To != 0) return Skip(To); @@@ -1479,8 -1291,8 +1481,8 @@@ return true; } int res; -#if APT_USE_ZLIB - if (d->gz) +#ifdef HAVE_ZLIB + if (d != NULL && d->gz) res = gzseek(d->gz,To,SEEK_SET); else #endif @@@ -1491,8 -1303,7 +1493,8 @@@ return _error->Error("Unable to seek to %llu", To); } - d->seekpos = To; + if (d != NULL) + d->seekpos = To; return true; } /*}}}*/ @@@ -1501,11 -1312,7 +1503,11 @@@ /* */ bool FileFd::Skip(unsigned long long Over) { - if (d->pipe == true) + if (d != NULL && (d->pipe == true +#ifdef HAVE_BZ2 + || d->bz2 != NULL +#endif + )) { d->seekpos += Over; char buffer[1024]; @@@ -1513,18 -1320,15 +1515,18 @@@ { unsigned long long toread = std::min((unsigned long long) sizeof(buffer), Over); if (Read(buffer, toread) == false) + { + Flags |= Fail; return _error->Error("Unable to seek ahead %llu",Over); + } Over -= toread; } return true; } int res; -#if APT_USE_ZLIB - if (d->gz != NULL) +#ifdef HAVE_ZLIB + if (d != NULL && d->gz != NULL) res = gzseek(d->gz,Over,SEEK_CUR); else #endif @@@ -1534,8 -1338,7 +1536,8 @@@ Flags |= Fail; return _error->Error("Unable to seek ahead %llu",Over); } - d->seekpos = res; + if (d != NULL) + d->seekpos = res; return true; } @@@ -1545,13 -1348,11 +1547,13 @@@ /* */ bool FileFd::Truncate(unsigned long long To) { - if (d->gz != NULL) +#if defined HAVE_ZLIB || defined HAVE_BZ2 + if (d != NULL && (d->gz != NULL || d->bz2 != NULL)) { Flags |= Fail; - return _error->Error("Truncating gzipped files is not implemented (%s)", FileName.c_str()); + return _error->Error("Truncating compressed files is not implemented (%s)", FileName.c_str()); } +#endif if (ftruncate(iFd,To) != 0) { Flags |= Fail; @@@ -1570,27 -1371,19 +1572,27 @@@ unsigned long long FileFd::Tell( // seeking around, but not all users of FileFd use always Seek() and co // so d->seekpos isn't always true and we can just use it as a hint if // we have nothing else, but not always as an authority… - if (d->pipe == true) + if (d != NULL && (d->pipe == true +#ifdef HAVE_BZ2 + || d->bz2 != NULL +#endif + )) return d->seekpos; off_t Res; -#if APT_USE_ZLIB - if (d->gz != NULL) +#ifdef HAVE_ZLIB + if (d != NULL && d->gz != NULL) Res = gztell(d->gz); else #endif Res = lseek(iFd,0,SEEK_CUR); if (Res == (off_t)-1) + { + Flags |= Fail; _error->Errno("lseek","Failed to determine the current file position"); - d->seekpos = Res; + } + if (d != NULL) + d->seekpos = Res; return Res; } /*}}}*/ @@@ -1600,24 -1393,17 +1602,24 @@@ unsigned long long FileFd::FileSize() { struct stat Buf; - if (d->pipe == false && fstat(iFd,&Buf) != 0) + if ((d == NULL || d->pipe == false) && fstat(iFd,&Buf) != 0) + { + Flags |= Fail; return _error->Errno("fstat","Unable to determine the file size"); + } // for compressor pipes st_size is undefined and at 'best' zero - if (d->pipe == true || S_ISFIFO(Buf.st_mode)) + if ((d != NULL && d->pipe == true) || S_ISFIFO(Buf.st_mode)) { // we set it here, too, as we get the info here for free // in theory the Open-methods should take care of it already - d->pipe = true; + if (d != NULL) + d->pipe = true; if (stat(FileName.c_str(), &Buf) != 0) + { + Flags |= Fail; return _error->Errno("stat","Unable to determine the file size"); + } } return Buf.st_size; @@@ -1632,11 -1418,7 +1634,11 @@@ unsigned long long FileFd::Size( // for compressor pipes st_size is undefined and at 'best' zero, // so we 'read' the content and 'seek' back - see there - if (d->pipe == true) + if (d != NULL && (d->pipe == true +#ifdef HAVE_BZ2 + || (d->bz2 && size > 0) +#endif + )) { unsigned long long const oldSeek = Tell(); char ignore[1000]; @@@ -1647,11 -1429,11 +1649,11 @@@ size = Tell(); Seek(oldSeek); } -#if APT_USE_ZLIB +#ifdef HAVE_ZLIB // only check gzsize if we are actually a gzip file, just checking for // "gz" is not sufficient as uncompressed files could be opened with // gzopen in "direct" mode as well - else if (d->gz && !gzdirect(d->gz) && size > 0) + else if (d != NULL && d->gz && !gzdirect(d->gz) && size > 0) { off_t const oldPos = lseek(iFd,0,SEEK_CUR); /* unfortunately zlib.h doesn't provide a gzsize(), so we have to do @@@ -1659,16 -1441,10 +1661,16 @@@ * bits of the file */ // FIXME: Size for gz-files is limited by 32bit… no largefile support if (lseek(iFd, -4, SEEK_END) < 0) - return _error->Errno("lseek","Unable to seek to end of gzipped file"); + { + Flags |= Fail; + return _error->Errno("lseek","Unable to seek to end of gzipped file"); + } size = 0L; if (read(iFd, &size, 4) != 4) - return _error->Errno("read","Unable to read original size of gzipped file"); + { + Flags |= Fail; + return _error->Errno("read","Unable to read original size of gzipped file"); + } #ifdef WORDS_BIGENDIAN uint32_t tmp_size = size; @@@ -1678,10 -1454,7 +1680,10 @@@ #endif if (lseek(iFd, oldPos, SEEK_SET) < 0) - return _error->Errno("lseek","Unable to seek in gzipped file"); + { + Flags |= Fail; + return _error->Errno("lseek","Unable to seek in gzipped file"); + } return size; } @@@ -1696,23 -1469,20 +1698,23 @@@ time_t FileFd::ModificationTime() { struct stat Buf; - if (d->pipe == false && fstat(iFd,&Buf) != 0) + if ((d == NULL || d->pipe == false) && fstat(iFd,&Buf) != 0) { + Flags |= Fail; _error->Errno("fstat","Unable to determine the modification time of file %s", FileName.c_str()); return 0; } // for compressor pipes st_size is undefined and at 'best' zero - if (d->pipe == true || S_ISFIFO(Buf.st_mode)) + if ((d != NULL && d->pipe == true) || S_ISFIFO(Buf.st_mode)) { // we set it here, too, as we get the info here for free // in theory the Open-methods should take care of it already - d->pipe = true; + if (d != NULL) + d->pipe = true; if (stat(FileName.c_str(), &Buf) != 0) { + Flags |= Fail; _error->Errno("fstat","Unable to determine the modification time of file %s", FileName.c_str()); return 0; } @@@ -1732,18 -1502,19 +1734,18 @@@ bool FileFd::Close( bool Res = true; if ((Flags & AutoClose) == AutoClose) { -#if APT_USE_ZLIB - if (d != NULL && d->gz != NULL) { - int const e = gzclose(d->gz); - // gzdclose() on empty files always fails with "buffer error" here, ignore that - if (e != 0 && e != Z_BUF_ERROR) - Res &= _error->Errno("close",_("Problem closing the gzip file %s"), FileName.c_str()); - } else -#endif - if (iFd > 0 && close(iFd) != 0) - Res &= _error->Errno("close",_("Problem closing the file %s"), FileName.c_str()); + if ((Flags & Compressed) != Compressed && iFd > 0 && close(iFd) != 0) + Res &= _error->Errno("close",_("Problem closing the file %s"), FileName.c_str()); + + if (d != NULL) + { + Res &= d->CloseDown(FileName); + delete d; + d = NULL; + } } - if ((Flags & Replace) == Replace && iFd >= 0) { + if ((Flags & Replace) == Replace) { if (rename(TemporaryFileName.c_str(), FileName.c_str()) != 0) Res &= _error->Errno("rename",_("Problem renaming the file %s to %s"), TemporaryFileName.c_str(), FileName.c_str()); @@@ -1758,8 -1529,14 +1760,8 @@@ if (unlink(FileName.c_str()) != 0) Res &= _error->WarningE("unlnk",_("Problem unlinking the file %s"), FileName.c_str()); - if (d != NULL) - { - if (d->compressor_pid > 0) - ExecWait(d->compressor_pid, "FileFdCompressor", true); - delete d; - d = NULL; - } - + if (Res == false) + Flags |= Fail; return Res; } /*}}}*/ @@@ -1768,13 -1545,41 +1770,42 @@@ /* */ bool FileFd::Sync() { -#ifdef _POSIX_SYNCHRONIZED_IO if (fsync(iFd) != 0) + { + Flags |= Fail; return _error->Errno("sync",_("Problem syncing the file")); -#endif + } return true; } /*}}}*/ gzFile FileFd::gzFd() { return (gzFile) d->gz; } + + + // Glob - wrapper around "glob()" /*{{{*/ + // --------------------------------------------------------------------- + /* */ + std::vector Glob(std::string const &pattern, int flags) + { + std::vector result; + glob_t globbuf; + int glob_res, i; + + glob_res = glob(pattern.c_str(), flags, NULL, &globbuf); + + if (glob_res != 0) + { + if(glob_res != GLOB_NOMATCH) { + _error->Errno("glob", "Problem with glob"); + return result; + } + } + + // append results + for(i=0;i Glob(std::string const &pattern, int flags=0); #endif diff --combined debian/changelog index 2688a2686,50d6ea3ce..e93ed51ae --- a/debian/changelog +++ b/debian/changelog @@@ -1,573 -1,13 +1,575 @@@ -apt (0.8.16~exp15) unstable; urgency=low +apt (0.9.8~exp1) UNRELEASED; urgency=low + [ David Kalnischkies ] + * apt-pkg/contrib/strutl.cc: + - support \n and \r\n line endings in ReadMessages + + [ Michael Vogt ] + * lp:~mvo/apt/webserver-simulate-broken-with-fix346386: + - fix invalid InRelease file download checking and add regression + test to server broken files to the buildin test webserver + * stop exporting the accidently exported parsenetrc() symbol ++ * lp:~mvo/apt/add-glob-function: ++ - add Glob() to fileutl.{cc,h} + + -- David Kalnischkies Mon, 09 Jul 2012 17:36:40 +0200 + +apt (0.9.7.6) unstable; urgency=low + + [ Program translation updates ] + * Ukrainian (A. Bondarenko) + + [ David Kalnischkies ] + * apt-pkg/pkgcachegen.cc: + - ensure that dependencies for packages:none are always generated + - add 2 missing remap registrations causing a segfault in case + we use the not remapped iterators after a move of the mmap again + - write the native architecture as unique string into the cache header + as it is used for arch:all packages as a map to arch:native. + Otherwise arch comparisons later will see differences (Closes: #689323) + * apt-pkg/pkgcache.cc: + - ignore negative dependencies applying in the same group for M-A:same + packages on the real package name as self-conflicts (Closes: #688863) + * cmdline/apt-cache.cc: + - print versioned dependency relations in (r)depends if the option + APT::Cache::ShowVersion is true (default: false) as discussed in + #218995 to help debian-cd fixing #687949. Thanks to Sam Lidder + for initial patch and Steve McIntyre for nagging and testing! + * apt-pkg/edsp.cc: + - include reinstall requests and already installed (= protected) packages + in the install-request for external resolvers (Closes: #689331) + * apt-pkg/policy.cc: + - match pins with(out) an architecture as we do on the commandline + (partly fixing #687255, b= support has to wait for jessie) + * apt-pkg/contrib/netrc.cc: + - remove the 64 char limit for login/password in internal usage + - remove 256 char line limit by using getline() (POSIX.1-2008) + + [ Colin Watson ] + * apt-pkg/pkgcachegen.cc: + - Fix crash if the cache is remapped while writing a Provides version + (LP: #1066445). + + -- Michael Vogt Tue, 16 Oct 2012 18:08:53 +0200 + +apt (0.9.7.5) unstable; urgency=low + + [ Manpages translation updates ] + * Japanese (KURASAWA Nozomu) (Closes: #684435) + * Portuguese (Américo Monteiro) (Closes: #686975) + + [ David Kalnischkies ] + * handle packages without a mandatory architecture (debian-policy §5.3) + by introducing a pseudo-architecture 'none' so that the small group of + users with these packages can get right of them without introducing too + much hassle for other users (Closes: #686346) + * apt-pkg/cdrom.cc: + - copy only configured translation files from a CD-ROM and not all + available translation files preventing new installs with d-i from + being initialized with all translations (Closes: #678227) + - handle Components in the reduction for the source.list as multi-arch CDs + otherwise create duplicated source entries (e.g. "wheezy main main") + * apt-pkg/packagemanager.cc: + - unpack versions only in case a different version from the package + is currently in unpack state to recover from broken system states + (like different file in M-A:same package and other dpkg errors) + and avoid re-unpack otherwise (Closes: #670900) + * debian/control: + - let libapt-pkg break apt < 0.9.4 to ensure that the installed http- + method supports the new redirection-style, thanks to Raphael Geissert + for reporting & testing (Closes: #685192) + * doc/apt_preferences.5.xml: + - use the correct interval (x <= P < y) for pin value documentation as + these are the intervals used by the code (Closes: #685989) + * apt-pkg/indexcopy.cc: + - do not create duplicated flat-archive CD-ROM sources for foreign + architectures on multi-arch CD-ROMs + - do not warn about files which have a record in the Release file, but + are not present on the CD to mirror the behavior of the other methods + and to allow uncompressed indexes to be dropped without scaring users + * apt-pkg/pkgcachegen.cc: + - do not create 'native' (or now 'none') package structures as a side + effect of description translation parsing as it pollutes the cache + + -- Michael Vogt Tue, 11 Sep 2012 15:56:44 +0200 + +apt (0.9.7.4) unstable; urgency=low + + [ Manpages translation updates ] + * Polish (Robert Luberda) (Closes: #683109) + + [ Program translation updates ] + * Polish (Michał Kułach) + + [ Pino Toscano ] + * apt-pkg/contrib/mmap.cc: + - guard only the msync call with _POSIX_SYNCHRONIZED_IO rather + than also the fallback code as it breaks APT on hurd since 0.9.7.3 + as the fallback is now always used on non-linux (Closes: #683354) + + [ David Kalnischkies ] + * apt-pkg/contrib/fileutl.cc: + - remove _POSIX_SYNCHRONIZED_IO guard in FileFd::Sync() around fsync + as this guard is only needed for fdatasync and not defined on hurd + * cmdline/apt-get.cc: + - error out on (unsatisfiable) build-deps on purly virtual packages + instead of ignoring these dependencies; thanks to Johannes Schauer + for the detailed report! (Closes: #683786) + - ensure that the right architecture is used for cross-dependencies in + cases we have to choose a provider by defaulting on host-arch + instead of build-arch + * doc/apt-verbatim.ent: + - denote 'wheezy' as stable codename and 'jessie' as testing codename + in the documentation in preparation for release + * apt-pkg/indexcopy.cc: + - do not use atomic writing if the target is /dev/null as we don't want + to replace it, not even automically. (Closes: #683410) + * apt-pkg/cdrom.cc: + - do not link() but rename() the cdroms.list to cdroms.list~ as a backup + to ensure that apt-cdrom can be run multiple times (Closes: #676302) + + -- Michael Vogt Mon, 06 Aug 2012 15:55:04 +0200 + +apt (0.9.7.3) unstable; urgency=low + + [ Manpages translation updates ] + * Spanish; (Omar Campagne). Closes: #681566 + + [ Program translation updates ] + * Czech (Miroslav Kure). Closes: #680758 + + [ David Kalnischkies ] + * apt-pkg/cacheset.cc: + - handle :all and :native correctly as architectures again + in the commandline parsing (regression in 0.9.7) + * apt-pkg/packagemanager.cc: + - do not segfault if nothing can be configured to statisfy + a pre-depends (e.g. in a pre-depends loop) (Closes: #681958) + * apt-pkg/contrib/mmap.cc: + - trigger the usage of the fallback code for kfreebsd also in the + second (filebased) constructor of DynamicMMap (Closes: #677704) + - refer to APT::Cache-Start in case the growing failed as if -Limit is + really the offender it will be noted in a previous error message. + - for filesystems not supporting mmap'ing a file we need to use a + SyncToFd dummy just as we did for compressed files in 0.9.5 + + -- Michael Vogt Fri, 27 Jul 2012 17:53:41 +0200 + +apt (0.9.7.2) unstable; urgency=low + + [ Manpages translation updates ] + * French (Christian Perrier) + * German (Chris Leick) + + [ Program translation updates ] + * Greek (Θανάσης Νάτσης) + * Japanese (Kenshi Muto) (Closes: #679662) + * Russian (Yuri Kozlov) (Closes: #679599) + * Danish (Joe Dalton) (Closes: #680119) + * Portuguese (Miguel Figueiredo) (Closes: #680616) + + [ David Kalnischkies ] + * debian/apt.cron.daily: + - do not try to backup extended_states file if it doesn't + exist (Closes: #680287) + * ftparchive/writer.cc: + - handle the APT::FTPArchive::Packages::SHA512 option correctly instead + of overriding SHA256, thanks Christian Marillat! (Closes: #680252) + * cmdline/apt-mark.cc: + - arch:all packages are treated as arch:native packages, but dpkg + expects pkg:all for selections, so use the arch of the installed + version instead of the package structure if possible. + Thanks to Stepan Golosunov for the report! (Closes: #680041) + * apt-pkg/clean.cc: + - run autoclean against pkg:arch and not always against pkg:native as + this removes valid cache entries (Closes: #679371) + * apt-pkg/deb/deblistparser.cc: + - negative dependencies need to apply to all architectures, + but those with a specific architecture only apply to this one + * apt-pkg/cachefilter.cc: + - remove architecture-specific arch to tuple expansion-rules as they lead + to the same tuples for different architectures (e.g. linux-arm for arm, + armel and armhf) while the dpkg-architecture code uses triples which + are different (in the first part, which we omit in our tuples), so e.g. + build-dep restrictions for armel ended up effecting armhf as well + + -- Michael Vogt Fri, 13 Jul 2012 21:33:56 +0200 + +apt (0.9.7.1) unstable; urgency=low + + [ Program translation updates ] + * Bulgarian (Damyan Ivanov) (Closes: #678983) + * Hungarian (Gabor Kelemen) + * Italian (Milo Casagrande) + * Slovenian (Andrej Znidarsic) + * German (Holger Wansing) (Closes: #679314) + * Slovak (Ivan Masár) (Closes: #679448) + + [ David Kalnischkies ] + * cmdline/apt-internal-solver.cc, cmdline/apt-mark.cc: + - typo fixes and unfuzzy translations + * debian/control: + - libapt-{pkg,inst} packages should be in section 'libs' instead + of 'admin' as by ftp-master override request in #677596 + - demote debiandoc-sgml to Build-Depends-Indep + * doc/makefile: + - separate translation building of debiandoc from manpages + so that we don't need to build debiandoc for binary packages + + -- Michael Vogt Fri, 29 Jun 2012 14:26:32 +0200 + +apt (0.9.7) unstable; urgency=low + + [ Julian Andres Klode ] + * apt-pkg/contrib/mmap.cc: + - Fix the Fallback option to work correctly, by not calling + realloc() on a map mapped by mmap(), and by using malloc + and friends instead of new[]. + - Zero out the new memory allocated with realloc(). + + [ Daniel Hartwig ] + * apt-pkg/pkgcachegen.cc: + - always reset _error->StackCount in MakeStatusCache (Closes: #677175) + + [ David Kalnischkies ] + * apt-pkg/deb/deblistparser.cc: + - ensure that mixed positive/negative architecture wildcards + are handled in the same way as dpkg handles them + - use PackageArchitectureMatchesSpecification filter + * apt-pkg/cachefilter.cc: + - add PackageArchitectureMatchesSpecification (Closes: #672603) + * apt-pkg/cacheset.cc: + - add PackageContainerInterface::FromGroup to support + architecture specifications with wildcards on the commandline + * apt-pkg/pkgcache.cc: + - do a string comparision for architecture checking in IsMultiArchImplicit + as 'unique' strings in the pkgcache aren't unique (Closes: #677454) + * buildlib/configure.mak: + - print a message detailing how to get config.guess and config.sub + in case they are not in /usr/share/misc (Closes: #677312) + * cmdline/apt-get.cc: + - print a friendly message in 'download' if a package can't be + downloaded (Closes: #677887) + + -- Michael Vogt Tue, 19 Jun 2012 16:42:43 +0200 + +apt (0.9.6) unstable; urgency=low + + [ David Kalnischkies ] + * apt-pkg/cdrom.cc: + - fix regression from 0.9.3 which dumped the main configuration + _config instead of the cdrom settings (Cnf) as identified and + tested by Milan Kupcevic, thanks! (Closes: #674100) + * cmdline/apt-get.cc: + - do not show 'list of broken packages' header if no package + is broken as it happens e.g. for external resolver errors + - print URIs for all changelogs in case of --print-uris, + thanks to Daniel Hartwig for the patch! (Closes: #674897) + - show 'bzr branch' as 'bzr get' is deprecated (LP: #1011032) + - check build-dep candidate if install is forbidden + * debian/apt-utils.links: + - the internal resolver 'apt' is now directly installed in + /usr/lib/apt/solvers, so don't instruct dh to create a broken link + * doc/apt-verbatim.ent: + - APT doesn't belong to the product 'Linux', so use 'APT' instead + as after all APT is a big suite of applications + * doc/examples/sources.list: + - use the codename instead of 'stable' in the examples sources.list + as we do in the manpage and as the debian-installer does + * doc/apt-get.8.xml: + - use apt-utils as package example instead of libc6 + * apt-pkg/contrib/cmdline.cc: + - apply patch from Daniel Hartwig to fix a segfault in case + the LongOpt is empty (Closes: #676331) + - fix segfault with empty LongOpt in --no-* branch + * ftparchive/apt-ftparchive.cc: + - default to putting the Contents-* files below $(SECTION) as apt-file + expects them there - thanks Martin-Éric Racine! (Closes: #675827) + * apt-pkg/deb/deblistparser.cc: + - set pkgCacheGen::Essential to "all" again (Closes: #675449) + * apt-pkg/algorithms.cc: + - force install only for one essential package out of a group + * apt-pkg/aptconfiguration.cc: + - if APT::Languages=none save "none" in allCodes so that the detected + configuration is cached as intended (Closes: #674690, LP: #1004947) + * apt-pkg/cacheiterators.h: + - add an IsMultiArchImplicit() method for Dep- and PrvIterator + + [ Justin B Rye ] + * doc/apt-cdrom.8.xml: + - replace CDROM with the proper CD-ROM in text + - correct disc vs. disk issues + * doc/apt-extracttemplates.1.xml: + - debconf is not DebConf + * doc/apt-get.8.xml: + - move dselect-upgrade below dist-upgrade + - review and fix spelling issues + * doc/apt-ftparchive.8.xml, doc/apt-config.8.xml, + doc/apt-key.8.xml, doc/apt-mark.8.xml, + doc/apt_preferences.5.xml, doc/apt-secure.8.xml, + doc/apt-sortpkgs.1.xml, sources.list.5.xml: + - review and fix typo, grammar and style issues + * doc/apt.conf.5.xml: + - review and fix typo, grammar and style issues + - rephrase APT::Immediate-Configuration and many others + + [ Sebastian Heinlein ] + * cmdline/apt-key: + - do not hardcode /etc but use Dir::Etc instead + + [ Robert Luberda ] + * Polish manpage translation update (Closes: #675603) + * doc/apt-mark.8.xml: + - in hold, the option name is --file not --filename + + [ Christian Perrier ] + * French program and manpage translation update + * Danish program translation by Joe Hansen. Closes: #675605 + + [ Thibaut Girka ] + * cmdline/apt-get.cc: + - complain correctly about :any build-dep on M-A:none packages + * apt-pkg/deb/deblistparser.cc: + - add support for arch-specific qualifiers in dependencies + + -- Michael Vogt Mon, 11 Jun 2012 16:21:53 +0200 + +apt (0.9.5.1) unstable; urgency=low + + [ David Kalnischkies ] + * apt-pkg/contrib/fileutl.cc: + - dup() given compressed fd in OpenDescriptor if AutoClose + is disabled as otherwise gzclose() and co will close it + * doc/*.xml: + - mark even more stuff as untranslateable and improve the + markup here and there (no real text change) + - use docbook DTD 4.5 instead of 4.2 to have valid docs + + [ Justin B Rye ] + * doc/*.xml: + - remove 'GNU/Linux' from 'Debian systems' strings as Debian + has more systems than just GNU/Linux nowadays + * doc/apt-cache.8.xml: + - fix a typo as well as adding missing literal markup + - three small rewordings for better english sentences + + -- Michael Vogt Thu, 24 May 2012 17:16:34 +0200 + +apt (0.9.5) unstable; urgency=low + + [ Chris Leick ] + * proofreading of the manpage pot + * German manpage translation update (Closes: #673294) + + [ David Kalnischkies ] + * buildlib/podomain.mak: + - ensure that all sources end up in the srclist so that we don't + forget to extract half of the translation strings + * buildlib/inttypes.h.in: + - remove inttypes.h compatibility as providing such a c99 types + compatibility conflicts with the usage of c99 type long long + * apt-pkg/contrib/mmap.cc: + - have a dummy SyncToFd around in case of ReadOnly access to a + compressed file as we otherwise on Close() do not delete[] the + char buffer but munmap() it… (Closes: #673815) + * debian/control: + - moving debiandoc-sgml to Build-Depends-Indep was one step too much + for the buildds as we still build two sgml files in arch:any + * debian/rules: + - move internal-solver as 'apt' to his friend dump-solver in + /usr/lib/apt/solvers to avoid writing a manpage for it + + -- Michael Vogt Tue, 22 May 2012 16:14:22 +0200 + +apt (0.9.4) unstable; urgency=low + + [ David Kalnischkies ] + * methods/http.cc: + - after many years of pointless discussions disable http/1.1 pipelining + by default as many webservers and proxies seem to be unable to conform + to specification must's (rfc2616 section 8.1.2.2) (LP: #996151) + - add spaces around PACKAGE_VERSION to fix FTBFS with -std=c++11 + * apt-pkg/pkgcachegen.cc: + - make IsDuplicatedDescription static so that it is really private + as we don't need a symbol for it as it is not in a header + * Makefile, buildlib/*.mak: + - reshuffle dependencies so that parallel building seems to work + - separate manpages from the rest of the doc building + * prepare-release: + - apt-inst version isn't apt versions, so don't override variable + * debian/rules: + - apt-utils packages manpages, so it should depend on build-doc + - make apt and apt-utils packages depend on manpages instead of full doc + * debian/control: + - move doxygen and debiandoc-sgml to Build-Depends-Indep as docs + are no longer build in the same target as the manpages + * apt-pkg/acquire-methods.cc: + - factor out into private Dequeue() to fix access to deleted pointer + * apt-pkg/contrib/fileutl.cc: + - ensure that we close compressed fds, wait for forks and such even if + the FileFd itself is set to not autoclose the given Fd + * cmdline/apt-get.cc: + - use the host architecture, not the build architecture for matching + of [architecture restrictions] in Build-Depends (Closes: #672927) + * doc/makefile: + - build manpages with the correct l10n.gentext.default.language setting + to get the correct section titles provided by docbook + * doc/po/de.po: + - updated german manpage translation by Chris Leick, thanks! + * apt-pkg/packagemanager.cc: + - do not run into loop on new-pre-depends-breaks (Closes: #673536) + * doc/*.xml: + - add a few translator notes and reword some paragraphs to ensure that + translators and users alike can better understand them (Closes: #669409) + - in mark all options with