summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-06-14 11:59:13 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-06-14 11:59:13 +0200
commit702c84fb16a65ce0850bb99676edfbeefd656193 (patch)
tree2fcd13af56764d344124db49061d0dc970424179 /apt-pkg/deb
parent8d4b705ab0ef3a0de13a9ff9f1aa47f09112f374 (diff)
parent47026cdea6ba7d145922ce21d5ec478598126b8d (diff)
* apt-pkg/deb/dpkgpm.cc:
- apport integration added, this means that a apport report is written on dpkg failures * merged from debian/unstable, remaining changes: - maintainer field changed * merged the debian/experimental changes back into the debian/sid branch * merged from Christian Perrier: * mr.po: New Marathi translation Closes: #416806 * zh_CN.po: Updated by Eric Pareja Closes: #416822 * tl.po: Updated by Eric Pareja Closes: #416638 * gl.po: Updated by Jacobo Tarrio * da.po: Updated by Claus Hindsgaul * fr.po: Remove a non-breakable space for usability * ru.po: Updated Russian translation. Closes: #405476 * *.po: Unfuzzy after upstream typo corrections * buildlib/archtable: - added support for sh3/sh4 (closes: #424870) - added support for m32r (closes: #394096) * buildlib/systemtable: - added support for lpia * configure.in: - check systemtable for architecture mapping too * fix error in AutocleanInterval, closes: #319339 (thanks to Israel G. Lugo for the patch) * add "purge" commandline argument, closes: #133421) (thanks to Julien Danjou for the patch) * add "purge" commandline argument, closes: #133421) (thanks to Julien Danjou for the patch) * fix FTBFS with gcc 4.3, closes: #417090 (thanks to Martin Michlmayr for the patch) * add --dsc-only option, thanks to K. Richard Pixley * Removed the more leftover #pragma interface/implementation closes: #306937 (thanks to Andreas Henriksson for the patch) * ABI library name change because its build against new glibc * implement SourceVer() in pkgRecords (thanks to Daniel Burrows for the patch!) * apt-pkg/algorithm.cc: - use clog for all debugging - only increase the score of installed applications if they are not obsolete - fix resolver bug on removal triggered by weak-dependencies with or-groups * methods/http.cc: - send apt version in User-Agent * apt-pkg/deb/debrecords.cc: - fix SHA1Hash() return value * apt-pkg/cdrom.cc: - only unmount if APT::CDROM::NoMount is false * methods/cdrom.cc: - only umount if it was mounted by the method before - if decompression of a index fails, delete the index * vi.po: Updated to 515t. Closes: #426976 * eu.po: Updated to 515t. Closes: #423766 * pt.po: 515t. Closes: #423111 * fr.po: Updated by Christian Perrier * Update all PO and the POT. Gives 513t2f for formerly complete translations * Package that contains tall the new features * Removed all #pragma interface/implementation * Branch that contains tall the new features: * translated package descriptions * task install support * automatic dependency removal (thanks to Daniel Burrows) * merged support for the new dpkg "Breaks" field (thanks to Ian Jackson) * handle network failures more gracefully on "update" * support for unattended-upgrades (via unattended-upgrades package) * added apt-transport-https method - 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. * debian/control: - depend on debian-archive-keyring to offer clean upgrade path (closes: #386800) * merged "install-recommends" branch (ABI break): - new "--install-recommends" - install new recommends on "upgrade" if --install-recommends is given - new "--fix-policy" option to install all packages with unmet important dependencies (usefull with --install-recommends to see what not-installed recommends are on the system) - fix of recommended packages display (only show CandidateVersion fix or-group handling) * merged "install-task" branch (use with "apt-get install taskname^") * Applied patch from Daniel Schepler to make apt bin-NMU able. * apt-pkg/acquire-item.cc: - fix reversed logic of the "Acquire::PDiffs" option * apt-pkg/contrib/sha256.cc: - applied patch to fix unaligned access problem. Closes: #367417 (thanks to David Mosberger) * apt-pkg/contrib/sha256.{cc,h},hashes.{cc,h}: support for sha256 (thanks to Anthony Towns) * ftparchive/cachedb.{cc,h},writer.{cc,h}: optimizations (thanks to Anthony Towns) * apt pdiff support from experimental merged * apt-pkg/deb/dpkgpm.cc: wording fixes (thanks to Matt Zimmerman) - fix error in dpkg interaction (closes: #364513, thanks to Martin Dickopp)
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/debrecords.cc28
-rw-r--r--apt-pkg/deb/debrecords.h1
-rw-r--r--apt-pkg/deb/debsrcrecords.cc2
-rw-r--r--apt-pkg/deb/debsrcrecords.h2
4 files changed, 30 insertions, 3 deletions
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index 5421b3db7..8a5b6e215 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -108,18 +108,44 @@ string debRecordParser::LongDesc()
return orig;
}
/*}}}*/
+
+static const char *SourceVerSeparators = " ()";
+
// RecordParser::SourcePkg - Return the source package name if any /*{{{*/
// ---------------------------------------------------------------------
/* */
string debRecordParser::SourcePkg()
{
string Res = Section.FindS("Source");
- string::size_type Pos = Res.find(' ');
+ string::size_type Pos = Res.find_first_of(SourceVerSeparators);
if (Pos == string::npos)
return Res;
return string(Res,0,Pos);
}
/*}}}*/
+// RecordParser::SourceVer - Return the source version number if present /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+string debRecordParser::SourceVer()
+{
+ string Pkg = Section.FindS("Source");
+ string::size_type Pos = Pkg.find_first_of(SourceVerSeparators);
+ if (Pos == string::npos)
+ return "";
+
+ string::size_type VerStart = Pkg.find_first_not_of(SourceVerSeparators, Pos);
+ if(VerStart == string::npos)
+ return "";
+
+ string::size_type VerEnd = Pkg.find_first_of(SourceVerSeparators, VerStart);
+ if(VerEnd == string::npos)
+ // Corresponds to the case of, e.g., "foo (1.2" without a closing
+ // paren. Be liberal and guess what it means.
+ return string(Pkg, VerStart);
+ else
+ return string(Pkg, VerStart, VerEnd - VerStart);
+}
+ /*}}}*/
// RecordParser::GetRec - Return the whole record /*{{{*/
// ---------------------------------------------------------------------
/* */
diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h
index fdf8d762b..df21931a8 100644
--- a/apt-pkg/deb/debrecords.h
+++ b/apt-pkg/deb/debrecords.h
@@ -36,6 +36,7 @@ class debRecordParser : public pkgRecords::Parser
virtual string MD5Hash();
virtual string SHA1Hash();
virtual string SourcePkg();
+ virtual string SourceVer();
// These are some general stats about the package
virtual string Maintainer();
diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
index 7338de15d..fcd9bb901 100644
--- a/apt-pkg/deb/debsrcrecords.cc
+++ b/apt-pkg/deb/debsrcrecords.cc
@@ -36,7 +36,7 @@ const char **debSrcRecordParser::Binaries()
{
delete [] Buffer;
// allocate new size based on buffer (but never smaller than 4000)
- BufSize = max((unsigned long)4000, max((unsigned long)Bins.length()+1,2*BufSize));
+ BufSize = max((unsigned int)4000, max((unsigned int)Bins.length()+1,2*BufSize));
Buffer = new char[BufSize];
}
diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h
index 55fdcb667..8b1237ccd 100644
--- a/apt-pkg/deb/debsrcrecords.h
+++ b/apt-pkg/deb/debsrcrecords.h
@@ -24,7 +24,7 @@ class debSrcRecordParser : public pkgSrcRecords::Parser
char *StaticBinList[400];
unsigned long iOffset;
char *Buffer;
- unsigned long BufSize;
+ unsigned int BufSize;
public: