From: Michael Vogt Date: Wed, 17 Oct 2012 08:12:41 +0000 (+0200) Subject: merged from debian-sid X-Git-Tag: 1.1.exp1~59 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/32ed73df439850ee47e5e5edb8bfe1fe647ed794?hp=-c merged from debian-sid --- 32ed73df439850ee47e5e5edb8bfe1fe647ed794 diff --combined apt-pkg/contrib/fileutl.cc index 960616f33,90e49cbfa..4c224337e --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@@ -852,26 -852,6 +852,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 */ @@@ -1768,13 -1748,11 +1768,11 @@@ bool FileFd::Close( /* */ bool FileFd::Sync() { - #ifdef _POSIX_SYNCHRONIZED_IO if (fsync(iFd) != 0) { Flags |= Fail; return _error->Errno("sync",_("Problem syncing the file")); } - #endif return true; } /*}}}*/ diff --combined apt-pkg/indexcopy.cc index ddf1909b7,aa1f01a4a..c0a085316 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@@ -350,9 -350,6 +350,6 @@@ bool IndexCopy::ReconstructChop(unsigne */ void IndexCopy::ConvertToSourceList(string CD,string &Path) { - char S[300]; - snprintf(S,sizeof(S),"binary-%s",_config->Find("Apt::Architecture").c_str()); - // Strip the cdrom base path Path = string(Path,CD.length()); if (Path.empty() == true) @@@ -388,7 -385,13 +385,13 @@@ return; string Binary = string(Path,Slash+1,BinSlash - Slash-1); - if (Binary != S && Binary != "source") + if (strncmp(Binary.c_str(), "binary-", strlen("binary-")) == 0) + { + Binary.erase(0, strlen("binary-")); + if (APT::Configuration::checkArchitecture(Binary) == false) + continue; + } + else if (Binary != "source") continue; Path = Dist + ' ' + Comp; @@@ -494,17 -497,20 +497,20 @@@ bool SourceCopy::RewriteEntry(FILE *Tar bool SigVerify::Verify(string prefix, string file, indexRecords *MetaIndex) { const indexRecords::checkSum *Record = MetaIndex->Lookup(file); + bool const Debug = _config->FindB("Debug::aptcdrom",false); - // we skip non-existing files in the verifcation to support a cdrom - // with no Packages file (just a Package.gz), see LP: #255545 - // (non-existing files are not considered a error) + // we skip non-existing files in the verifcation of the Release file + // as non-existing files do not harm, but a warning scares people and + // makes it hard to strip unneeded files from an ISO like uncompressed + // indexes as it is done on the mirrors (see also LP: #255545 ) if(!RealFileExists(prefix+file)) { - _error->Warning(_("Skipping nonexistent file %s"), string(prefix+file).c_str()); + if (Debug == true) + cout << "Skipping nonexistent in " << prefix << " file " << file << std::endl; return true; } - if (!Record) + if (!Record) { _error->Warning(_("Can't find authentication record for: %s"), file.c_str()); return false; @@@ -516,7 -522,7 +522,7 @@@ return false; } - if(_config->FindB("Debug::aptcdrom",false)) + if(Debug == true) { cout << "File: " << prefix+file << endl; cout << "Expected Hash " << Record->Hash.toStr() << endl; @@@ -648,12 -654,16 +654,12 @@@ bool SigVerify::RunGPGV(std::string con { if (File == FileGPG) { - #define SIGMSG "-----BEGIN PGP SIGNED MESSAGE-----\n" - char buffer[sizeof(SIGMSG)]; FILE* gpg = fopen(File.c_str(), "r"); if (gpg == NULL) return _error->Errno("RunGPGV", _("Could not open file %s"), File.c_str()); - char const * const test = fgets(buffer, sizeof(buffer), gpg); fclose(gpg); - if (test == NULL || strcmp(buffer, SIGMSG) != 0) + if (!StartsWithGPGClearTextSignature(File)) return _error->Error(_("File %s doesn't start with a clearsigned message"), File.c_str()); - #undef SIGMSG } @@@ -806,9 -816,14 +812,14 @@@ bool TranslationsCopy::CopyTranslations (*I).c_str() + CDROM.length()); string TargetF = _config->FindDir("Dir::State::lists") + "partial/"; TargetF += URItoFileName(S); + FileFd Target; if (_config->FindB("APT::CDROM::NoAct",false) == true) + { TargetF = "/dev/null"; - FileFd Target(TargetF,FileFd::WriteAtomic); + Target.Open(TargetF,FileFd::WriteExists); + } else { + Target.Open(TargetF,FileFd::WriteAtomic); + } FILE *TargetFl = fdopen(dup(Target.Fd()),"w"); if (_error->PendingError() == true) return false; diff --combined debian/changelog index ca7f46f27,cd073ebb9..45829eeff --- a/debian/changelog +++ b/debian/changelog @@@ -1,16 -1,184 +1,197 @@@ +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 + + -- 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 ] diff --combined test/integration/framework index 965f984ca,1c4872c8e..11f1c7be2 --- a/test/integration/framework +++ b/test/integration/framework @@@ -91,6 -91,7 +91,7 @@@ runapt() } aptconfig() { runapt apt-config $*; } aptcache() { runapt apt-cache $*; } + aptcdrom() { runapt apt-cdrom $*; } aptget() { runapt apt-get $*; } aptftparchive() { runapt apt-ftparchive $*; } aptkey() { runapt apt-key $*; } @@@ -467,7 -468,7 +468,7 @@@ insertpackage() local PRIORITY="${6:-optional}" local ARCHS="" for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do - if [ "$arch" = "all" ]; then + if [ "$arch" = 'all' -o "$arch" = 'none' ]; then ARCHS="$(getarchitectures)" else ARCHS="$arch" @@@ -481,9 -482,9 +482,9 @@@ Priority: $PRIORITY Section: other Installed-Size: 42 - Maintainer: Joe Sixpack - Architecture: $arch - Version: $VERSION + Maintainer: Joe Sixpack " >> $FILE + test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE + echo "Version: $VERSION Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} @@@ -523,17 -524,18 +524,18 @@@ insertinstalledpackage() local VERSION="$3" local DEPENDENCIES="$4" local PRIORITY="${5:-optional}" + local STATUS="${6:-install ok installed}" local FILE='rootdir/var/lib/dpkg/status' local INFO='rootdir/var/lib/dpkg/info' for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do echo "Package: $NAME - Status: install ok installed + Status: $STATUS Priority: $PRIORITY Section: other Installed-Size: 42 Maintainer: Joe Sixpack - Architecture: $arch Version: $VERSION" >> $FILE + test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE echo "Description: an autogenerated dummy ${NAME}=${VERSION}/installed If you find such a package installed on your system, @@@ -688,30 -690,20 +690,30 @@@ signreleasefiles() } changetowebserver() { - if which weborf > /dev/null; then - weborf -xb aptarchive/ 2>&1 > /dev/null & + if [ -n "$1" ] && ! test -x ${BUILDDIRECTORY}/aptwebserver; then + msgdie 'Need the aptwebserver when passing arguments' + fi + + local LOG='/dev/null' + if test -x ${BUILDDIRECTORY}/aptwebserver; then + cd aptarchive + LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver $@ 2> $LOG > $LOG & + addtrap "kill $!;" + cd - > /dev/null + elif which weborf > /dev/null; then + weborf -xb aptarchive/ 2> $LOG > $LOG & addtrap "kill $!;" elif which gatling > /dev/null; then cd aptarchive - gatling -p 8080 -F -S 2>&1 > /dev/null & + gatling -p 8080 -F -S 2> $LOG > $LOG & addtrap "kill $!;" cd - > /dev/null elif which lighttpd > /dev/null; then echo "server.document-root = \"$(readlink -f ./aptarchive)\" server.port = 8080 server.stat-cache-engine = \"disable\"" > lighttpd.conf - lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' - lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null & + lighttpd -t -f lighttpd.conf 2> $LOG > $LOG || msgdie 'Can not change to webserver: our lighttpd config is invalid' + lighttpd -D -f lighttpd.conf 2> $LOG > $LOG & addtrap "kill $!;" else msgdie 'You have to install weborf or lighttpd first' @@@ -724,6 -716,21 +726,21 @@@ return 0 } + changetocdrom() { + mkdir -p rootdir/media/cdrom/.disk + local CD="$(readlink -f rootdir/media/cdrom)" + echo "acquire::cdrom::mount \"${CD}\";" > rootdir/etc/apt/apt.conf.d/00cdrom + echo 'acquire::cdrom::autodetect 0;' >> rootdir/etc/apt/apt.conf.d/00cdrom + echo -n "$1" > ${CD}/.disk/info + if [ ! -d aptarchive/dists ]; then + msgdie 'Flat file archive cdroms can not be created currently' + return 1 + fi + mv aptarchive/dists $CD + ln -s "$(readlink -f ./incoming)" $CD/pool + find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list' -delete + } + checkdiff() { local DIFFTEXT="$($(which diff) -u $* | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')" if [ -n "$DIFFTEXT" ]; then @@@ -746,6 -753,11 +763,11 @@@ testfileequal() fi } + testempty() { + msgtest "Test for no output of" "$*" + test -z "$($* 2>&1)" && msgpass || msgfail + } + testequal() { local COMPAREFILE=$(mktemp) addtrap "rm $COMPAREFILE;" @@@ -806,7 -818,7 +828,7 @@@ testnopackage() testdpkginstalled() { msgtest "Test for correctly installed package(s) with" "dpkg -l $*" - local PKGS="$(dpkg -l $* | 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]'