summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/deb/debsrcrecords.cc28
-rw-r--r--apt-pkg/deb/debsrcrecords.h10
-rw-r--r--apt-pkg/deb/dpkgpm.cc23
-rw-r--r--debian/changelog34
-rw-r--r--doc/apt-get.8.xml2
-rw-r--r--doc/apt.83
-rw-r--r--doc/examples/configure-index4
7 files changed, 70 insertions, 34 deletions
diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
index cac36c2e6..e1c6427e8 100644
--- a/apt-pkg/deb/debsrcrecords.cc
+++ b/apt-pkg/deb/debsrcrecords.cc
@@ -18,6 +18,8 @@
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/configuration.h>
+
+using std::max;
/*}}}*/
// SrcRecordParser::Binaries - Return the binaries field /*{{{*/
@@ -34,31 +36,19 @@ const char **debSrcRecordParser::Binaries()
if (Bins.empty() == true || Bins.length() >= 102400)
return 0;
- // Workaround for #236688. Only allocate a new buffer if the field
- // is large, to avoid a performance penalty
- char *BigBuf = NULL;
- char *Buf;
- if (Bins.length() > sizeof(Buffer))
- {
- BigBuf = new char[Bins.length()];
- Buf = BigBuf;
- }
- else
+ if (Bins.length() >= BufSize)
{
- Buf = Buffer;
+ delete [] Buffer;
+ // allocate new size based on buffer (but never smaller than 4000)
+ BufSize = max((unsigned long)4000, max(Bins.length()+1,2*BufSize));
+ Buffer = new char[BufSize];
}
- strcpy(Buf,Bins.c_str());
- if (TokSplitString(',',Buf,StaticBinList,
+ strcpy(Buffer,Bins.c_str());
+ if (TokSplitString(',',Buffer,StaticBinList,
sizeof(StaticBinList)/sizeof(StaticBinList[0])) == false)
- {
- if (BigBuf != NULL)
- delete BigBuf;
return 0;
- }
- if (BigBuf != NULL)
- delete BigBuf;
return (const char **)StaticBinList;
}
/*}}}*/
diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h
index f899993df..f4e2cb46c 100644
--- a/apt-pkg/deb/debsrcrecords.h
+++ b/apt-pkg/deb/debsrcrecords.h
@@ -24,9 +24,10 @@ class debSrcRecordParser : public pkgSrcRecords::Parser
FileFd Fd;
pkgTagFile Tags;
pkgTagSection Sect;
- char Buffer[10000];
char *StaticBinList[400];
unsigned long iOffset;
+ char *Buffer;
+ unsigned long BufSize;
public:
@@ -49,10 +50,9 @@ class debSrcRecordParser : public pkgSrcRecords::Parser
};
virtual bool Files(vector<pkgSrcRecords::File> &F);
- debSrcRecordParser(string File,pkgIndexFile const *Index) :
- Parser(Index),
- Fd(File,FileFd::ReadOnly),
- Tags(&Fd,102400) {};
+ debSrcRecordParser(string File,pkgIndexFile const *Index)
+ : Parser(Index), Fd(File,FileFd::ReadOnly), Tags(&Fd,102400),
+ Buffer(0), BufSize(0) {}
};
#endif
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 887d2f254..ac13357ff 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,42 @@
+apt (0.6.46.4) unstable; urgency=low
+
+ * 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
+ * apt-pkg/deb/debsrcrecords.{cc,h}:
+ - make the Buffer grow dynmaically (closes: #400874)
+ * Merged from Christian Perrier bzr branch:
+ - uk.po: New Ukrainian translation: 483t28f3u
+ - el.po: Update to 503t9f2u
+ - de.po: Updates and corrections.
+
+ --
+
apt (0.6.46.3) unstable; urgency=low
* apt-pkg/deb/dpkgpm.cc:
- make progress reporting robust against multiline error
messages
- --
+ * Merged from Christian Perrier bzr branch:
+ - ca.po: Updated to 514t
+ - be.po: Updated to 514t
+ - it.po: Updated to 514t
+ - hu.po: Updated to 514t
+ - zh_TW.po: Updated to 514t
+ - ar.po: Updated to 293t221u.
+ - ru.po: Updated to 514t. Closes: #392466
+ - nb.po: Updated to 514t. Closes: #392466
+ - pt.po: Updated to 514t. Closes: #393199
+ - fr.po: One spelling error corrected: s/accèder/accéder
+ - km.po: Updated to 514t.
+ - ko.po: Updated to 514t.
+ - bg.po: Updated to 514t.
+ - de.po: Updated to 514t.
+ - en_GB.po: Updated to 514t.
+
+ -- Michael Vogt <mvo@debian.org> Thu, 2 Nov 2006 11:37:58 +0100
apt (0.6.46.2) unstable; urgency=low
diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml
index b98d58737..17f663a35 100644
--- a/doc/apt-get.8.xml
+++ b/doc/apt-get.8.xml
@@ -467,7 +467,7 @@
<refsect1><title>See Also</title>
<para>&apt-cache;, &apt-cdrom;, &dpkg;, &dselect;, &sources-list;,
- &apt-conf;, &apt-config;,
+ &apt-conf;, &apt-config;, &apt-secure;,
The APT User's guide in &guidesdir;, &apt-preferences;, the APT Howto.</para>
</refsect1>
diff --git a/doc/apt.8 b/doc/apt.8
index 3fb214a3b..6f39c5387 100644
--- a/doc/apt.8
+++ b/doc/apt.8
@@ -32,7 +32,8 @@ None.
.BR apt-cache (8),
.BR apt-get (8),
.BR apt.conf (5),
-.BR sources.list (5)
+.BR sources.list (5),
+.BR apt-secure (8)
.SH DIAGNOSTICS
apt returns zero on normal operation, decimal 100 on error.
.SH BUGS
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