summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-09-09 15:38:08 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-09-09 15:38:08 +0200
commit64b247e1939d43c6d8823c35615576594e4d18f5 (patch)
treef67b5734c899c07df1b1c3ce141903c333c7cd11
parentf1fe904373897893ac7a656f90ad20405871093d (diff)
parent2a19ec29ab5491fdb12a3ccaa1601097fdc83c86 (diff)
* ftparchive/writer.cc:
- write out {Files,Checksum-Sha1,Checksum-Sha256} only if available LP: #633967. Thanks to Colin Watson
-rw-r--r--debian/changelog8
-rw-r--r--ftparchive/writer.cc15
2 files changed, 17 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 08115765c..64f606f77 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+apt (0.8.3ubuntu2) maverick; urgency=low
+
+ * ftparchive/writer.cc:
+ - write out {Files,Checksum-Sha1,Checksum-Sha256} only if
+ available LP: #633967. Thanks to Colin Watson
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 09 Sep 2010 15:30:19 +0200
+
apt (0.8.3ubuntu1) maverick; urgency=low
* merged fixes from debian-sid
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 58e32dade..c280f5ed3 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -708,18 +708,21 @@ bool SourcesWriter::DoPackage(string FileName)
// Add the dsc to the files hash list
string const strippedName = flNotDir(FileName);
std::ostringstream ostreamFiles;
- ostreamFiles << "\n " << string(MD5.Result()) << " " << St.st_size << " "
- << strippedName << "\n " << Tags.FindS("Files");
+ if (Tags.Exists("Files"))
+ ostreamFiles << "\n " << string(MD5.Result()) << " " << St.st_size << " "
+ << strippedName << "\n " << Tags.FindS("Files");
string const Files = ostreamFiles.str();
std::ostringstream ostreamSha1;
- ostreamSha1 << "\n " << string(SHA1.Result()) << " " << St.st_size << " "
- << strippedName << "\n " << Tags.FindS("Checksums-Sha1");
+ if (Tags.Exists("Checksums-Sha1"))
+ ostreamSha1 << "\n " << string(SHA1.Result()) << " " << St.st_size << " "
+ << strippedName << "\n " << Tags.FindS("Checksums-Sha1");
string const ChecksumsSha1 = ostreamSha1.str();
std::ostringstream ostreamSha256;
- ostreamSha256 << "\n " << string(SHA256.Result()) << " " << St.st_size << " "
- << strippedName << "\n " << Tags.FindS("Checksums-Sha256");
+ if (Tags.Exists("Checksums-Sha256"))
+ ostreamSha256 << "\n " << string(SHA256.Result()) << " " << St.st_size << " "
+ << strippedName << "\n " << Tags.FindS("Checksums-Sha256");
string const ChecksumsSha256 = ostreamSha256.str();
// Strip the DirStrip prefix from the FileName and add the PathPrefix