From e8cdc56aaf6a12223fb9868784c18c8c0ada6315 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 19 Oct 2005 08:11:04 +0000 Subject: * added APT::Authentication::Trust-CDROM option Patches applied: * michael.vogt@ubuntu.com--2005/apt--trust-cdrom--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-79 * michael.vogt@ubuntu.com--2005/apt--trust-cdrom--0--patch-1 * implemented "TrustCDROM" mode * michael.vogt@ubuntu.com--2005/apt--trust-cdrom--0--patch-2 * added APT::Authentication::TrustCDROM to the configure-index --- doc/examples/configure-index | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/examples') diff --git a/doc/examples/configure-index b/doc/examples/configure-index index dee0c06ff..5ab84fe05 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -72,6 +72,11 @@ APT NoAct "false"; }; + Authentication + { + Trust-CDROM "false"; // consider the CDROM always trusted + }; + GPGV { TrustedKeyring "/etc/apt/trusted.gpg"; -- cgit v1.2.3-70-g09d2 From 4e0ad446347b1f3d70a66001365382db4d8e45f3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 20 Oct 2005 09:31:12 +0000 Subject: * renamed Trust-CDROM to TrustCDROM to make it consistent with ubuntu --- apt-pkg/deb/debmetaindex.cc | 2 +- debian/changelog | 2 +- doc/examples/configure-index | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/examples') diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index ed5cb80d1..85e5b16b3 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -165,7 +165,7 @@ bool debReleaseIndex::IsTrusted() const string VerifiedSigFile = _config->FindDir("Dir::State::lists") + URItoFileName(MetaIndexURI("Release")) + ".gpg"; - if(_config->FindB("APT::Authentication::Trust-CDROM", false)) + if(_config->FindB("APT::Authentication::TrustCDROM", false)) if(URI.substr(0,strlen("cdrom:")) == "cdrom:") return true; diff --git a/debian/changelog b/debian/changelog index 0b4bd00e9..6b858cdcd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,7 +17,7 @@ apt (0.6.42) unstable; urgency=low * fix leak in the mmap code, thanks to Daniel Burrows for the patch (closes: #250583) * support for apt-get [build-dep|source] -t (closes: #152129) - * added "APT::Authentication::Trust-CDROM" option to make the life + * added "APT::Authentication::TrustCDROM" option to make the life for the installer people easier (closes: #334656) * fix crash in apt-ftparchive (thanks to Bastian Blank for the patch) (closes: #334671) diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 5ab84fe05..a93b74349 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -74,7 +74,7 @@ APT Authentication { - Trust-CDROM "false"; // consider the CDROM always trusted + TrustCDROM "false"; // consider the CDROM always trusted }; GPGV -- cgit v1.2.3-70-g09d2 From 7c6e2dc761f736bf203f7770f7a1c4a63f7063d4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 22 Nov 2005 22:11:06 +0000 Subject: * merged http download limit for apt (#146877) --- apt-pkg/acquire.cc | 6 +++++- debian/changelog | 5 +++-- doc/examples/configure-index | 1 + methods/http.cc | 41 +++++++++++++++++++++++++++++++++++++++-- methods/http.h | 5 +++++ 5 files changed, 53 insertions(+), 5 deletions(-) (limited to 'doc/examples') diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 62209e65b..57cf60bfe 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -266,7 +266,11 @@ pkgAcquire::MethodConfig *pkgAcquire::GetConfig(string Access) Worker Work(Conf); if (Work.Start() == false) return 0; - + + /* if a method uses DownloadLimit, we switch to SingleInstance mode */ + if(_config->FindI("Acquire::"+Access+"::DlLimit",0) > 0) + Conf->SingleInstance = true; + return Conf; } /*}}}*/ diff --git a/debian/changelog b/debian/changelog index 2022448a0..34f8cec03 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -apt (0.6.42.4) unstable; urgency=low +apt (0.6.43) unstable; urgency=low * Merge bubulle@debian.org--2005/apt--main--0 up to patch-132: * zh_CN.po: Completed to 510 strings(Closes: #338267) @@ -9,8 +9,9 @@ apt (0.6.42.4) unstable; urgency=low * fix bug in pkgCache::VerIterator::end() (thanks to Daniel Burrows) (closes: #339533) * pkgAcqFile is more flexible now (closes: #57091) + * support a download rate limit for http (closes: #146877) - -- + -- apt (0.6.42.3) unstable; urgency=low diff --git a/doc/examples/configure-index b/doc/examples/configure-index index a93b74349..9e851d753 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -117,6 +117,7 @@ Acquire No-Cache "false"; Max-Age "86400"; // 1 Day age on index files No-Store "false"; // Prevent the cache from storing archives + Dl-Limit "7"; // 7Kb/sec maximum download rate }; ftp diff --git a/methods/http.cc b/methods/http.cc index ba86aa6b6..a5c9601e7 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -58,6 +58,12 @@ unsigned long PipelineDepth = 10; unsigned long TimeOut = 120; bool Debug = false; + +unsigned long CircleBuf::BwReadLimit=0; +unsigned long CircleBuf::BwTickReadData=0; +struct timeval CircleBuf::BwReadTick={0,0}; +const unsigned int CircleBuf::BW_HZ=10; + // CircleBuf::CircleBuf - Circular input buffer /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -65,6 +71,8 @@ CircleBuf::CircleBuf(unsigned long Size) : Size(Size), Hash(0) { Buf = new unsigned char[Size]; Reset(); + + CircleBuf::BwReadLimit = _config->FindI("Acquire::http::Dl-Limit",0)*1024; } /*}}}*/ // CircleBuf::Reset - Reset to the default state /*{{{*/ @@ -90,16 +98,45 @@ void CircleBuf::Reset() is non-blocking.. */ bool CircleBuf::Read(int Fd) { + unsigned long BwReadMax; + while (1) { // Woops, buffer is full if (InP - OutP == Size) return true; - + + // what's left to read in this tick + BwReadMax = CircleBuf::BwReadLimit/BW_HZ; + + if(CircleBuf::BwReadLimit) { + struct timeval now; + gettimeofday(&now,0); + + unsigned long d = (now.tv_sec-CircleBuf::BwReadTick.tv_sec)*1000000 + + now.tv_usec-CircleBuf::BwReadTick.tv_usec; + if(d > 1000000/BW_HZ) { + CircleBuf::BwReadTick = now; + CircleBuf::BwTickReadData = 0; + } + + if(CircleBuf::BwTickReadData >= BwReadMax) { + usleep(1000000/BW_HZ); + return true; + } + } + // Write the buffer segment int Res; - Res = read(Fd,Buf + (InP%Size),LeftRead()); + if(CircleBuf::BwReadLimit) { + Res = read(Fd,Buf + (InP%Size), + BwReadMax > LeftRead() ? LeftRead() : BwReadMax); + } else + Res = read(Fd,Buf + (InP%Size),LeftRead()); + if(Res > 0 && BwReadLimit > 0) + CircleBuf::BwTickReadData += Res; + if (Res == 0) return false; if (Res < 0) diff --git a/methods/http.h b/methods/http.h index c5a4d0e86..541e2952c 100644 --- a/methods/http.h +++ b/methods/http.h @@ -31,6 +31,11 @@ class CircleBuf unsigned long MaxGet; struct timeval Start; + static unsigned long BwReadLimit; + static unsigned long BwTickReadData; + static struct timeval BwReadTick; + static const unsigned int BW_HZ; + unsigned long LeftRead() { unsigned long Sz = Size - (InP - OutP); -- cgit v1.2.3-70-g09d2 From 168e1e4e4e763f7b3442909eb8fa25ea40f2e0ee Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 26 Apr 2006 13:18:00 +0200 Subject: * merged documentation patch (debian #307756) --- debian/changelog | 3 +++ doc/apt-ftparchive.1.xml | 4 ++-- doc/examples/apt-ftparchive.conf | 6 +++--- doc/fr/apt-ftparchive.fr.1.xml | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) (limited to 'doc/examples') diff --git a/debian/changelog b/debian/changelog index c439f0df5..00b46eb22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ apt (0.6.44) unstable; urgency=low patch) Closes: #350025 * Merge from http://www.perrier.eu.org/debian/packages/d-i/level4/apt-main: * bg.po: Added, complete to 512t. Closes: #360262 + * doc/apt-ftparchive.1.xml: + - fix documentation for "SrcPackages" -> "Sources" + (thanks to Bart Martens for the patch, closes: #307756) -- Michael Vogt Tue, 25 Apr 2006 09:34:20 +0200 diff --git a/doc/apt-ftparchive.1.xml b/doc/apt-ftparchive.1.xml index 7c1ae9432..8cfbc72e9 100644 --- a/doc/apt-ftparchive.1.xml +++ b/doc/apt-ftparchive.1.xml @@ -407,10 +407,10 @@ for i in Sections do Sets the Packages file output. - SrcPackages + Sources Sets the Sources file output. At least one of - Packages or SrcPackages is required. + Packages or Sources is required. Contents diff --git a/doc/examples/apt-ftparchive.conf b/doc/examples/apt-ftparchive.conf index 657ec5440..c9d352ab6 100644 --- a/doc/examples/apt-ftparchive.conf +++ b/doc/examples/apt-ftparchive.conf @@ -20,21 +20,21 @@ Default { // Contents file for these in the main section of the sid release BinDirectory "pool/main" { Packages "dists/sid/main/binary-i386/Packages"; - SrcPackages "dists/sid/main/source/Sources"; + Sources "dists/sid/main/source/Sources"; Contents "dists/sid/Contents-i386"; } // This is the same for the contrib section BinDirectory "pool/contrib" { Packages "dists/sid/contrib/binary-i386/Packages"; - SrcPackages "dists/sid/contrib/source/Sources"; + Sources "dists/sid/contrib/source/Sources"; Contents "dists/sid/Contents-i386"; } // This is the same for the non-free section BinDirectory "pool/non-free" { Packages "dists/sid/non-free/binary-i386/Packages"; - SrcPackages "dists/sid/non-free/source/Sources"; + Sources "dists/sid/non-free/source/Sources"; Contents "dists/sid/Contents-i386"; }; diff --git a/doc/fr/apt-ftparchive.fr.1.xml b/doc/fr/apt-ftparchive.fr.1.xml index 61cdfa2ec..9ae6506fc 100644 --- a/doc/fr/apt-ftparchive.fr.1.xml +++ b/doc/fr/apt-ftparchive.fr.1.xml @@ -451,10 +451,10 @@ Indique le fichier -SrcPackages +Sources Indique le fichier « Sources » créé. L'un des deux fichiers, -Packages ou SrcPackages est nécessaire. +Packages ou Sources est nécessaire. @@ -628,4 +628,4 @@ d &manbugs; &traducteur; - \ No newline at end of file + -- cgit v1.2.3-70-g09d2 From d4c5f11f8ef619ec56ae1e532416bb3817442b1c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 27 May 2006 14:13:31 +0200 Subject: * added Debug::pkgDepCache::AutoInstall debug option --- apt-pkg/depcache.cc | 7 ++++++- configure.in | 2 +- doc/examples/configure-index | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'doc/examples') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index dd1c794c9..58d1d25e5 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -16,7 +16,8 @@ #include #include #include - +#include + #include /*}}}*/ @@ -712,6 +713,10 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, if (InstPkg.end() == false) { + if(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true) + std::clog << "Installing " << InstPkg.Name() + << " as dep of " << Pkg.Name() + << std::endl; MarkInstall(InstPkg,true,Depth + 1); // Set the autoflag, after MarkInstall because MarkInstall unsets it diff --git a/configure.in b/configure.in index f24400ed7..96adad597 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.6.44") +AC_DEFINE_UNQUOTED(VERSION,"0.6.44.1") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 9e851d753..b87e85030 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -244,6 +244,7 @@ DPkg Debug { pkgProblemResolver "false"; + pkgDepCache::AutoInstall "false"; // what packages apt install to satify dependencies pkgAcquire "false"; pkgAcquire::Worker "false"; pkgDPkgPM "false"; -- cgit v1.2.3-70-g09d2 From 5e9179a6a301de5e6cb0f99098b467d5c35ab8d5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 25 Jul 2006 11:37:20 +0200 Subject: * apt-pkg/deb/dpkgpm.cc: - ignore lines that can't be split properly from dpkg (DpkgPM::Go) * doc/examples/configure-index: - documentation updates --- apt-pkg/deb/dpkgpm.cc | 8 +++++++- configure.in | 2 +- debian/changelog | 5 +++++ doc/examples/configure-index | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) (limited to 'doc/examples') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 667db8ff2..bf0434ccc 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -624,7 +624,13 @@ bool pkgDPkgPM::Go(int OutStatusFd) */ char* list[5]; - TokSplitString(':', line, list, sizeof(list)/sizeof(list[0])); + if(!TokSplitString(':', line, list, sizeof(list)/sizeof(list[0]))) + // FIXME: dpkg sends multiline error messages sometimes (see + // #374195 for a example. we should support this by + // either patching dpkg to not send multiline over the + // statusfd or by rewriting the code here to deal with + // it. for now we just ignore it and not crash + continue; char *pkg = list[1]; char *action = _strstrip(list[2]); diff --git a/configure.in b/configure.in index 8e1e9bf75..fc4eff203 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.6.44.1-0.1") +AC_DEFINE_UNQUOTED(VERSION,"0.6.45") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --git a/debian/changelog b/debian/changelog index 6813980c5..ae12ac8d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,11 @@ apt (0.6.45) unstable; urgency=low (closes: #379576) * doc/apt-get.8.xml: - fix path to the apt user build (Closes: #375640) + * apt-pkg/deb/dpkgpm.cc: + - make progress reporting more robust against multiline error + messages (first half of a fix for #374195) + * doc/examples/configure-index: + - document Debug::pkgAcquire::Auth * Merged from Christian Perrier bzr branch: * ko.po: Updated to 512t. Closes: #378901 * hu.po: Updated to 512t. Closes: #376330 diff --git a/doc/examples/configure-index b/doc/examples/configure-index index b87e85030..f8abd75ed 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -247,6 +247,7 @@ Debug pkgDepCache::AutoInstall "false"; // what packages apt install to satify dependencies pkgAcquire "false"; pkgAcquire::Worker "false"; + pkgAcquire::Auth "false"; pkgDPkgPM "false"; pkgDPkgProgressReporting "false"; pkgOrderList "false"; -- cgit v1.2.3-70-g09d2 From 9c0b7da119e1078727ffa890ec5fd4b0e0d1e96a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 12 Sep 2006 11:23:42 +0200 Subject: * doc/examples/sources.list: - removed no-longer used non-us line --- debian/changelog | 2 ++ doc/examples/sources.list | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/examples') diff --git a/debian/changelog b/debian/changelog index 05d29662c..474beac58 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ apt (0.6.45.1) unstable; urgency=low * methods/gzip.cc: - don't hang when /var is full (closes: #341537), thanks to Luis Rodrigo Gallardo Cruz for the patch + * doc/examples/sources.list: + - removed non-us.debian.org from the example (closes: #380030,#316196) -- diff --git a/doc/examples/sources.list b/doc/examples/sources.list index 9f2343277..9af1c3c4c 100644 --- a/doc/examples/sources.list +++ b/doc/examples/sources.list @@ -2,7 +2,6 @@ # Remember that you can only use http, ftp or file URIs # CDROMs are managed through the apt-cdrom tool. deb http://http.us.debian.org/debian stable main contrib non-free -deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free deb http://security.debian.org stable/updates main contrib non-free # Uncomment if you want the apt-get source function to work -- cgit v1.2.3-70-g09d2 From efe9ba671b2acb4b7cddedeba2aefc0d4fea01d4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 28 Sep 2006 11:22:44 +0200 Subject: * doc/examples/configure-index: - document the buildDeps debug option --- doc/examples/configure-index | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/examples') diff --git a/doc/examples/configure-index b/doc/examples/configure-index index f8abd75ed..0f0abc30c 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -251,6 +251,7 @@ Debug pkgDPkgPM "false"; pkgDPkgProgressReporting "false"; pkgOrderList "false"; + BuildDeps "false"; pkgInitialize "false"; // This one will dump the configuration space NoLocking "false"; -- cgit v1.2.3-70-g09d2 From c70496f94c8a16072b0b7a7906dec4b1aa4f306e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Nov 2006 12:07:06 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - added "Dpkg::StopOnError" variable that controls if apt will abort on errors from dpkg --- apt-pkg/deb/dpkgpm.cc | 23 ++++++++++++++++------- debian/changelog | 5 ++++- doc/examples/configure-index | 4 ++++ 3 files changed, 24 insertions(+), 8 deletions(-) (limited to 'doc/examples') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c7a6b921f..3204fc1bb 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -711,14 +711,23 @@ bool pkgDPkgPM::Go(int OutStatusFd) // Check for an error code. if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0) { - RunScripts("DPkg::Post-Invoke"); - if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV) - return _error->Error("Sub-process %s received a segmentation fault.",Args[0]); - - if (WIFEXITED(Status) != 0) - return _error->Error("Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status)); + // if it was set to "keep-dpkg-runing" then we won't return + // here but keep the loop going and just report it as a error + // for later + bool stopOnError = _config->FindB("Dpkg::StopOnError",true); - return _error->Error("Sub-process %s exited unexpectedly",Args[0]); + if(stopOnError) + RunScripts("DPkg::Post-Invoke"); + + if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV) + _error->Error("Sub-process %s received a segmentation fault.",Args[0]); + else if (WIFEXITED(Status) != 0) + _error->Error("Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status)); + else + _error->Error("Sub-process %s exited unexpectedly",Args[0]); + + if(stopOnError) + return false; } } diff --git a/debian/changelog b/debian/changelog index 24e10dcd5..8da0d6471 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ apt (0.6.46.4) unstable; urgency=low - * add apt-secure.8 to "See also" section + * added apt-secure.8 to "See also" section + * apt-pkg/deb/dpkgpm.cc: + - added "Dpkg::StopOnError" variable that controls if apt + will abort on errors from dpkg -- diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 0f0abc30c..73e20aa43 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -237,6 +237,10 @@ DPkg // Control the size of the command line passed to dpkg. MaxBytes 1024; MaxArgs 350; + + // controls if apt will apport on the first dpkg error or if it + // tries to install as many packages as possible + StopOnError "true"; } /* Options you can set to see some debugging text They correspond to names -- cgit v1.2.3-70-g09d2