From: Michael Vogt Date: Wed, 8 Jun 2011 10:03:34 +0000 (+0200) Subject: merge lp:~mvo/apt/sha512-template to add support for sha512 X-Git-Tag: 0.9.0~91^2~2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/12cd178d6eb61306cc99e5e07c463c800d406771?ds=inline;hp=--cc merge lp:~mvo/apt/sha512-template to add support for sha512 --- 12cd178d6eb61306cc99e5e07c463c800d406771 diff --cc apt-pkg/acquire-method.cc index e9e102488,bf3beafa2..8c353beb2 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@@ -146,65 -162,81 +146,69 @@@ void pkgAcqMethod::URIDone(FetchResult { if (Queue == 0) abort(); - - char S[1024] = ""; - char *End = S; - - End += snprintf(S,sizeof(S),"201 URI Done\nURI: %s\n",Queue->Uri.c_str()); + + std::cout << "201 URI Done\n" + << "URI: " << Queue->Uri << "\n"; if (Res.Filename.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Filename: %s\n",Res.Filename.c_str()); - + std::cout << "Filename: " << Res.Filename << "\n"; + if (Res.Size != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Size: %lu\n",Res.Size); - + std::cout << "Size: " << Res.Size << "\n"; + if (Res.LastModified != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Last-Modified: %s\n", - TimeRFC1123(Res.LastModified).c_str()); + std::cout << "Last-Modified: " << TimeRFC1123(Res.LastModified) << "\n"; if (Res.MD5Sum.empty() == false) - { - End += snprintf(End,sizeof(S)-50 - (End - S),"MD5-Hash: %s\n",Res.MD5Sum.c_str()); - End += snprintf(End,sizeof(S)-50 - (End - S),"MD5Sum-Hash: %s\n",Res.MD5Sum.c_str()); - } + std::cout << "MD5-Hash: " << Res.MD5Sum << "\n" + << "MD5Sum-Hash: " << Res.MD5Sum << "\n"; if (Res.SHA1Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"SHA1-Hash: %s\n",Res.SHA1Sum.c_str()); + std::cout << "SHA1-Hash: " << Res.SHA1Sum << "\n"; if (Res.SHA256Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"SHA256-Hash: %s\n",Res.SHA256Sum.c_str()); + std::cout << "SHA256-Hash: " << Res.SHA256Sum << "\n"; + if (Res.SHA512Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"SHA512-Hash: %s\n",Res.SHA512Sum.c_str()); ++ std::cout << "SHA512-Hash: " << Res.SHA512Sum << "\n"; if (UsedMirror.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"UsedMirror: %s\n",UsedMirror.c_str()); - if (Res.GPGVOutput.size() > 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"GPGVOutput:\n"); - for (vector::iterator I = Res.GPGVOutput.begin(); - I != Res.GPGVOutput.end(); I++) - End += snprintf(End,sizeof(S)-50 - (End - S), " %s\n", (*I).c_str()); + std::cout << "UsedMirror: " << UsedMirror << "\n"; + if (Res.GPGVOutput.empty() == false) + { + std::cout << "GPGVOutput:\n"; + for (vector::const_iterator I = Res.GPGVOutput.begin(); + I != Res.GPGVOutput.end(); ++I) + std::cout << " " << *I << "\n"; + } if (Res.ResumePoint != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Resume-Point: %lu\n", - Res.ResumePoint); + std::cout << "Resume-Point: " << Res.ResumePoint << "\n"; if (Res.IMSHit == true) - strcat(End,"IMS-Hit: true\n"); - End = S + strlen(S); - + std::cout << "IMS-Hit: true\n"; + if (Alt != 0) { if (Alt->Filename.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Filename: %s\n",Alt->Filename.c_str()); - + std::cout << "Alt-Filename: " << Alt->Filename << "\n"; + if (Alt->Size != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Size: %lu\n",Alt->Size); - + std::cout << "Alt-Size: " << Alt->Size << "\n"; + if (Alt->LastModified != 0) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Last-Modified: %s\n", - TimeRFC1123(Alt->LastModified).c_str()); - + std::cout << "Alt-Last-Modified: " << TimeRFC1123(Alt->LastModified) << "\n"; + if (Alt->MD5Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-MD5-Hash: %s\n", - Alt->MD5Sum.c_str()); + std::cout << "Alt-MD5-Hash: " << Alt->MD5Sum << "\n"; if (Alt->SHA1Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-SHA1-Hash: %s\n", - Alt->SHA1Sum.c_str()); + std::cout << "Alt-SHA1-Hash: " << Alt->SHA1Sum << "\n"; if (Alt->SHA256Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-SHA256-Hash: %s\n", - Alt->SHA256Sum.c_str()); + std::cout << "Alt-SHA256-Hash: " << Alt->SHA256Sum << "\n"; - + if (Alt->SHA512Sum.empty() == false) - End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-SHA512-Hash: %s\n", - Alt->SHA512Sum.c_str()); ++ std::cout << "Alt-SHA512-Hash: " << Alt->SHA512Sum << "\n"; + if (Alt->IMSHit == true) - strcat(End,"Alt-IMS-Hit: true\n"); + std::cout << "Alt-IMS-Hit: true\n"; } - - strcat(End,"\n"); - if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S)) - exit(100); + + std::cout << "\n" << std::flush; // Dequeue FetchItem *Tmp = Queue; diff --cc debian/changelog index 71f64dc23,986b6f876..b144d35ad --- a/debian/changelog +++ b/debian/changelog @@@ -1,310 -1,4 +1,313 @@@ -apt (0.8.12) UNRELEASED; urgency=low +apt (0.8.15) UNRELEASED; urgency=low + + [ David Kalnischkies ] + * Implement EDSP in libapt-pkg so that all front-ends which + use the internal resolver can now be used also with external + ones as the usage is hidden in between the old API + * provide two edsp solvers in apt-utils: + - 'dump' to quickly output a complete scenario and + - 'apt' to use the internal as an external resolver + * apt-pkg/pkgcache.h: + - clean up mess with the "all" handling in MultiArch to + fix LP: #733741 cleanly for everyone now + * apt-pkg/depcache.cc: + - use a boolean instead of an int for Add/Remove in AddStates + similar to how it works with AddSizes + - let the Mark methods return if their marking was successful + - if a Breaks can't be upgraded, remove it. If it or a Conflict + can't be removed the installation of the breaker fails. + * cmdline/apt-get.cc: + - do not discard the error messages from the resolver and instead + only show the general 'Broken packages' message if nothing else + + [ Stefano Zacchiroli ] + * doc/external-dependency-solver-protocol.txt: + - describe EDSP and the configuration interface around it ++ ++ [ Michael Vogt ] ++ * merge lp:~mvo/apt/sha512-template to add support for sha512 + + -- David Kalnischkies Tue, 17 May 2011 18:43:21 +0200 + +apt (0.8.14.2) UNRELEASED; urgency=low + + [ Julian Andres Klode ] + * apt-pkg/depcache.cc: + - Really release action groups only once (Closes: #622744) + - Make purge work again for config-files (LP: #244598) (Closes: #150831) + * debian/apt.cron.daily: + - Check power after wait, patch by manuel-soto (LP: #705269) + * debian/control: + - Move ${shlibs:Depends} to Pre-Depends, as we do not want APT + unpacked if a library is too old and thus break upgrades + * doc/apt-key.8.xml: + - Document apt-key net-update (LP: #192810) + + [ Christian Perrier ] + * Galician translation update (Miguel Anxo Bouzada). Closes: #626505 + + [ David Kalnischkies ] + * fix a bunch of cppcheck warnings/errors based on a patch by + Niels Thykier, thanks! (Closes: #622805) + * apt-pkg/depcache.cc: + - really include 'rc' packages in the delete count by fixing a + typo which exists since 1999 in the source… (LP: #761175) + - if critical or-group can't be satisfied, exit directly. + * apt-pkg/acquire-method.cc: + - write directly to stdout instead of creating the message in + memory first before writing to avoid hitting limits + - fix order of CurrentURI and UsedMirror in Status() and Log() + * apt-pkg/orderlist.cc: + - let VisitRProvides report if the calls were successful + * apt-pkg/deb/dpkgpm.cc: + - replace obsolete usleep with nanosleep + * debian/apt{,-utils}.symbols: + - update both experimental symbol-files to reflect 0.8.14 state + * debian/rules: + - remove unused embedded jquery by doxygen from libapt-pkg-doc + * cmdline/apt-mark.cc: + - reimplement apt-mark in c++ + - provide a 'showmanual' command (Closes: #582791) + - provide a 'dpkg --set-selections' wrapper to set/release holds + * cmdline/apt-get.cc: + - deprecate mostly undocumented 'markauto' in favor of 'apt-mark' + * cmdline/apt-cache.cc: + - deprecate mostly undocumented 'showauto' in favor of 'apt-mark' + * apt-pkg/pkgcache.cc: + - really ignore :arch in FindPkg() in non-multiarch environment + * doc/po/de.po: + - undo the translation of the command 'dump' in manpage of apt-config + as report by Burghard Grossmann on debian-l10n-german, thanks! + * apt-pkg/deb/debmetaindex.cc: + - do not download TranslationIndex if no Translation-* will be + downloaded later on anyway (Closes: #624218) + * test/versions.lst: + - disable obscure version number tests with versions dpkg doesn't + allow any more as they don't start with a number + * apt-pkg/acquire-worker.cc: + - print filename in the unmatching size warning (Closes: #623137) + * apt-pkg/acquire-item.cc: + - apply fix for poorly worded 'locate file' error message from + Ben Finney, thanks! (Closes: #623171) + * methods/http.cc: + - add config option to ignore a closed stdin to be able to easily + use the method as a simple standalone downloader + - Location header in redirects should be absolute URI, but some + servers just send an absolute path so still deal with it properly + - dequote URL taken from Location in redirects as we will otherwise + quote an already quoted string in the request later (Closes: #602412) + * apt-pkg/contrib/netrc.cc: + - replace non-posix gnu-extension strdupa with strdup + * apt-pkg/packagemanager.cc: + - ensure for Multi-Arch:same packages that they are unpacked in + lock step even in immediate configuration (Closes: #618288) + + -- Michael Vogt Mon, 16 May 2011 14:57:52 +0200 + +apt (0.8.14.1) unstable; urgency=low + + * apt-pkg/acquire-item.cc: + - Only try to rename existing Release files (Closes: #622912) + + -- Julian Andres Klode Sat, 16 Apr 2011 14:36:10 +0200 + +apt (0.8.14) unstable; urgency=low + + [ Julian Andres Klode ] + * apt-pkg/indexcopy.cc: + - Use RealFileExists() instead of FileExists(), allows amongst other + things a directory named Sources to exist on a CD-ROM (LP: #750694). + * apt-pkg/acquire-item.cc: + - Use Release files even if they cannot be verified (LP: #704595) + * cmdline/apt-get.cc: + - Do not install recommends for build-dep (Closes: #454479) (LP: #245273) + * apt-pkg/deb/deblistparser.cc: + - Handle no space before "[" in build-dependencies (LP: #72344) + * apt-pkg/policy.cc: + - Allow pinning by glob() expressions, and regular expressions + surrounded by slashes (the "/" character) (LP: #399474) + (Closes: #121132) + * debian/control: + - Set Standards-Version to 3.9.2 + + [ Michael Vogt ] + * mirror method: + - do not crash if the mirror file fails to download + * apt-pkg/aptconfiguration.cc: + - fix comparing for a empty string + * debian/apt.cron.daily: + - run unattended-upgrades even if there was a error during + the apt-get update (LP: #676295) + + [ David Kalnischkies ] + * apt-pkg/pkgcache.cc: + - use the native Architecture stored in the cache header instead of + loading it from configuration as suggested by Julian Andres Klode + + -- Julian Andres Klode Fri, 15 Apr 2011 14:28:15 +0200 + +apt (0.8.13.2) unstable; urgency=low + + [ David Kalnischkies ] + * apt-pkg/deb/dpkgpm.cc: + - skip --configure if all packages disappeared + * apt-pkg/vendor.cc, apt-pkg/vendorlist.cc: + - mark them as deprecated as they are unused + * apt-pkg/deb/deblistparser.h: + - enable StripMultiArch by default for ParseDepends + * debian/apt.conf.autoremove: + - adapt to new gnumach kernel package naming (Closes: #619337) + * doc/apt_preferences.5.xml: + - correct typo spotted by Charles Plessy (Closes: #619088) + - document ButAutomaticUpgrades together with NotAutomatic + as suggested by Charles Plessy (Closes: #619083) + * apt-pkg/depcache.cc: + - remove pseudo handling leftover from SetReInstall + - do not change protected packages in autoinstall (Closes: #618848) + * apt-pkg/pkgcachegen.cc: + - make "all"->"native" an implementation detail of NewPackage + rather than rewrite it in higher methods + * apt-pkg/cacheiterator.h: + - return "all" instead of native architecture without breaking the abi + (too much) by extending enum instead of using bitflags (LP: #733741) + * apt-pkg/aptconfiguration.cc: + - use dpkg --print-foreign-architectures to get multiarch configuration + if non is specified with APT::Architectures (Closes: #612958) + * cmdline/apt-get.cc: + - do not show simulation notice for non-root commands (Closes: #619072) + - be able to disable resolver with APT::Get::CallResolver and disable + auto installation with APT::Get::AutoSolving + * apt-pkg/deb/deblistparser.cc: + - create foo:any provides for all architectures for an allowed package + + -- Michael Vogt Tue, 05 Apr 2011 09:40:28 +0200 + +apt (0.8.13.1) unstable; urgency=low + + * apt-pkg/acquire-item.cc: Use stat buffer if stat was + successful, not if it failed (Closes: #620546) + + -- Julian Andres Klode Sat, 02 Apr 2011 20:55:35 +0200 + +apt (0.8.13) unstable; urgency=low + + [ Thorsten Spindler ] + * methods/rsh.cc + - fix rsh/ssh option parsing (LP: #678080), thanks to + Ville Mattila + + [ Michael Vogt ] + * apt-pkg/acquire-item.cc: + - mark pkgAcqIndexTrans as Index-File to avoid asking the + user to insert the CD on each apt-get update + * po/sl.po: + - updated, thanks to Andrej Znidarsic + * mirror method: + - when downloading data, show the mirror being used + - randomize mirror list after download in a host specific way + to ensure that the load is evenly spreaded accross the mirrors + - fix some missing "Fail-Ignore" + + -- Michael Vogt Wed, 16 Mar 2011 08:04:42 +0100 + +apt (0.8.12) unstable; urgency=low + + [ Michael Vogt ] + * apt-pkg/deb/debindexfile.cc: + - ignore missing deb-src files in /var/lib/apt/lists, thanks + to Thorsten Spindler (LP: #85590) + * apt-pkg/contrib/fileutl.cc, apt-pkg/deb/dpkgpm.cc: + - honor Dpkg::Chroot-Directory in the RunScripts*() methods + * apt-pkg/contrib/cdromutl.{cc,h}, apt-pkg/cdrom.{cc,h}: + - deal with missing FSTAB_DIR when using libudev to discover cdrom + - add experimental APT::cdrom::CdromOnly option (on by default). + When this is set to false apt-cdrom will handle any removable + deivce (like a usb-stick) as a "cdrom/dvd" source + + [ Christian Perrier ] + * Fix error in French translation of manpages (apt_preferences(5)). + Merci, Rémi Vanicat. Closes: #613689 + * Complete French manpage translation + * Italian translation update (Milo Casagrande). Closes: #614395 + + [ David Kalnischkies ] + * ftparchive/multicompress.cc, apt-inst/deb/debfile.cc: + - support xz compressor to create xz-compressed Indexes and be able + to open data.tar.xz files + - load the supported compressors from configuration + * ftparchive/writer.cc: + - ensure that Date and Valid-Until time strings are not localised + - add options to disable specific checksums for Indexes + - include xz-compressed Packages and Sources files in Release file + * apt-pkg/aptconfiguration.cc: + - support download of xz-compressed indexes files + - support adding new compressors by configuration + * apt-pkg/deb/debsrcrecords.cc: + - support xz-compressed source v3 debian.tar files + - support every compression we have a compressor configured + * ftparchive/contents.cc: + - remove ExtractArchive codecopy from apt-inst/deb/debfile.cc + * apt-inst/deb/debfile.cc: + - support data.tar's compressed with any configured compressor + * cmdline/apt-get.cc: + - reinstall dependencies of reinstalled "garbage" (Closes: #617257) + + [ Steve Langasek ] + * apt-pkg/deb/dpkgpm.cc: + - make sure that for multiarch packages, we are passing the full + qualified package name to dpkg for removals. (Closes: #614298) + * Remove the "pseudopackage" handling of Architecture: all packages for + Multi-Arch; instead, Arch: all packages only satisfy dependencies for + the native arch, except where the Arch: all package is declared + Multi-Arch: foreign. (Closes: #613584) + + -- Michael Vogt Thu, 10 Mar 2011 14:46:48 +0100 + +apt (0.8.11.5) unstable; urgency=low + + [ Christian Perrier ] + * Add missing dot in French translation of manpages. Merci, Olivier + Humbert. + * French translation update + * French manpages translation update + + [ David Kalnischkies ] + * apt-pkg/depcache.cc: + - party revert fix in 0.8.11.2 which marked all packages as manual + installed if the FromUser bit is set in the MarkInstall call. + The default for this bit is true and aptitude depends on the old + behavior so the package is only marked as manual if its not marked + ("old" behavior) or if automatic installation is enabled - which + aptitude disables always (see also #613775) + + -- David Kalnischkies Thu, 17 Feb 2011 15:16:31 +0100 + +apt (0.8.11.4) unstable; urgency=low + + [ David Kalnischkies ] + * apt-pkg/contrib/error.cc: + - ensure that va_list is not invalid in second try + * cmdline/apt-get.cc: + - don't remove new dependencies of garbage packages (Closes: #613420) + + [ Michael Vogt ] + * test/integration/* + - fix dashish in the integration tests + + -- Michael Vogt Wed, 16 Feb 2011 14:36:03 +0100 + +apt (0.8.11.3) unstable; urgency=low + + * apt-pkg/contrib/fileutl.cc: + - really detect bigendian machines by including config.h, + so we can really (Closes: #612986) + * apt-pkg/contrib/mmap.cc: + - Base has as 'valid' failure states 0 and -1 so add a simple + validData method to check for failure states + + -- David Kalnischkies Mon, 14 Feb 2011 16:58:03 +0100 + +apt (0.8.11.2) unstable; urgency=low [ Michael Vogt ] * merged lp:~evfool/apt/fix641673: diff --cc ftparchive/writer.cc index 9f12cbf3d,98ab852ea..eb8938b95 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@@ -17,10 -17,9 +17,10 @@@ #include #include #include +#include #include #include - #include + #include #include #include @@@ -313,9 -308,10 +313,10 @@@ PackagesWriter::PackagesWriter(string c DeLinkLimit = 0; // Process the command line options - DoMD5 = _config->FindB("APT::FTPArchive::MD5",true); - DoSHA1 = _config->FindB("APT::FTPArchive::SHA1",true); - DoSHA256 = _config->FindB("APT::FTPArchive::SHA256",true); - DoSHA256 = _config->FindB("APT::FTPArchive::SHA512",true); + DoMD5 = _config->FindB("APT::FTPArchive::Packages::MD5",DoMD5); + DoSHA1 = _config->FindB("APT::FTPArchive::Packages::SHA1",DoSHA1); + DoSHA256 = _config->FindB("APT::FTPArchive::Packages::SHA256",DoSHA256); ++ DoSHA256 = _config->FindB("APT::FTPArchive::Packages::SHA512",true); DoAlwaysStat = _config->FindB("APT::FTPArchive::AlwaysStat", false); DoContents = _config->FindB("APT::FTPArchive::Contents",true); NoOverride = _config->FindB("APT::FTPArchive::NoOverrideMsg",false); @@@ -440,12 -436,10 +441,14 @@@ bool PackagesWriter::DoPackage(string F unsigned int End = 0; SetTFRewriteData(Changes[End++], "Size", Size); - SetTFRewriteData(Changes[End++], "MD5sum", Db.MD5Res.c_str()); - SetTFRewriteData(Changes[End++], "SHA1", Db.SHA1Res.c_str()); - SetTFRewriteData(Changes[End++], "SHA256", Db.SHA256Res.c_str()); - SetTFRewriteData(Changes[End++], "SHA512", Db.SHA512Res.c_str()); + if (DoMD5 == true) + SetTFRewriteData(Changes[End++], "MD5sum", Db.MD5Res.c_str()); + if (DoSHA1 == true) + SetTFRewriteData(Changes[End++], "SHA1", Db.SHA1Res.c_str()); + if (DoSHA256 == true) + SetTFRewriteData(Changes[End++], "SHA256", Db.SHA256Res.c_str()); ++ if (DoSHA512 == true) ++ SetTFRewriteData(Changes[End++], "SHA512", Db.SHA512Res.c_str()); SetTFRewriteData(Changes[End++], "Filename", NewFileName.c_str()); SetTFRewriteData(Changes[End++], "Priority", OverItem->Priority.c_str()); SetTFRewriteData(Changes[End++], "Status", 0); @@@ -619,17 -610,15 +622,20 @@@ bool SourcesWriter::DoPackage(string Fi // Hash the file char *Start = Buffer; char *BlkEnd = Buffer + St.st_size; - MD5Summation MD5; - MD5.Add((unsigned char *)Start,BlkEnd - Start); + MD5Summation MD5; SHA1Summation SHA1; SHA256Summation SHA256; - SHA512Summation SHA512; - SHA1.Add((unsigned char *)Start,BlkEnd - Start); - SHA256.Add((unsigned char *)Start,BlkEnd - Start); - SHA512.Add((unsigned char *)Start,BlkEnd - Start); ++ SHA256Summation SHA512; + + if (DoMD5 == true) + MD5.Add((unsigned char *)Start,BlkEnd - Start); + if (DoSHA1 == true) + SHA1.Add((unsigned char *)Start,BlkEnd - Start); + if (DoSHA256 == true) + SHA256.Add((unsigned char *)Start,BlkEnd - Start); ++ if (DoSHA512 == true) ++ SHA512.Add((unsigned char *)Start,BlkEnd - Start); // Add an extra \n to the end, just in case *BlkEnd++ = '\n'; @@@ -789,12 -784,10 +801,14 @@@ unsigned int End = 0; SetTFRewriteData(Changes[End++],"Source",Package.c_str(),"Package"); - SetTFRewriteData(Changes[End++],"Files",Files.c_str()); - SetTFRewriteData(Changes[End++],"Checksums-Sha1",ChecksumsSha1.c_str()); - SetTFRewriteData(Changes[End++],"Checksums-Sha256",ChecksumsSha256.c_str()); - SetTFRewriteData(Changes[End++],"Checksums-Sha512",ChecksumsSha512.c_str()); + if (Files.empty() == false) + SetTFRewriteData(Changes[End++],"Files",Files.c_str()); + if (ChecksumsSha1.empty() == false) + SetTFRewriteData(Changes[End++],"Checksums-Sha1",ChecksumsSha1.c_str()); + if (ChecksumsSha256.empty() == false) + SetTFRewriteData(Changes[End++],"Checksums-Sha256",ChecksumsSha256.c_str()); ++ if (ChecksumsSha512.empty() == false) ++ SetTFRewriteData(Changes[End++],"Checksums-Sha512",ChecksumsSha512.c_str()); if (Directory != "./") SetTFRewriteData(Changes[End++],"Directory",Directory.c_str()); SetTFRewriteData(Changes[End++],"Priority",BestPrio.c_str()); @@@ -1025,27 -1007,24 +1039,31 @@@ bool ReleaseWriter::DoPackage(string Fi CheckSums[NewFileName].size = fd.Size(); - MD5Summation MD5; - MD5.AddFD(fd.Fd(), fd.Size()); - CheckSums[NewFileName].MD5 = MD5.Result(); - - fd.Seek(0); - SHA1Summation SHA1; - SHA1.AddFD(fd.Fd(), fd.Size()); - CheckSums[NewFileName].SHA1 = SHA1.Result(); - - fd.Seek(0); - SHA256Summation SHA256; - SHA256.AddFD(fd.Fd(), fd.Size()); - CheckSums[NewFileName].SHA256 = SHA256.Result(); + if (DoMD5 == true) + { + MD5Summation MD5; + MD5.AddFD(fd.Fd(), fd.Size()); + CheckSums[NewFileName].MD5 = MD5.Result(); + fd.Seek(0); + } + if (DoSHA1 == true) + { + SHA1Summation SHA1; + SHA1.AddFD(fd.Fd(), fd.Size()); + CheckSums[NewFileName].SHA1 = SHA1.Result(); + fd.Seek(0); + } + if (DoSHA256 == true) + { + SHA256Summation SHA256; + SHA256.AddFD(fd.Fd(), fd.Size()); + CheckSums[NewFileName].SHA256 = SHA256.Result(); + } + SHA256Summation SHA512; + SHA256.AddFD(fd.Fd(), fd.Size()); + CheckSums[NewFileName].SHA512 = SHA512.Result(); + fd.Close(); return true; @@@ -1056,40 -1035,49 +1074,52 @@@ // --------------------------------------------------------------------- void ReleaseWriter::Finish() { - fprintf(Output, "MD5Sum:\n"); - for(map::const_iterator I = CheckSums.begin(); - I != CheckSums.end(); - ++I) + if (DoMD5 == true) { - fprintf(Output, " %s %16ld %s\n", - (*I).second.MD5.c_str(), - (*I).second.size, - (*I).first.c_str()); + fprintf(Output, "MD5Sum:\n"); + for(map::const_iterator I = CheckSums.begin(); + I != CheckSums.end(); ++I) + { + fprintf(Output, " %s %16ld %s\n", + (*I).second.MD5.c_str(), + (*I).second.size, + (*I).first.c_str()); + } } - - fprintf(Output, "SHA1:\n"); - for(map::const_iterator I = CheckSums.begin(); - I != CheckSums.end(); - ++I) + if (DoSHA1 == true) { - fprintf(Output, " %s %16ld %s\n", - (*I).second.SHA1.c_str(), - (*I).second.size, - (*I).first.c_str()); + fprintf(Output, "SHA1:\n"); + for(map::const_iterator I = CheckSums.begin(); + I != CheckSums.end(); ++I) + { + fprintf(Output, " %s %16ld %s\n", + (*I).second.SHA1.c_str(), + (*I).second.size, + (*I).first.c_str()); + } } - - fprintf(Output, "SHA256:\n"); - for(map::const_iterator I = CheckSums.begin(); - I != CheckSums.end(); - ++I) + if (DoSHA256 == true) { - fprintf(Output, " %s %16ld %s\n", - (*I).second.SHA256.c_str(), - (*I).second.size, - (*I).first.c_str()); + fprintf(Output, "SHA256:\n"); + for(map::const_iterator I = CheckSums.begin(); + I != CheckSums.end(); ++I) + { + fprintf(Output, " %s %16ld %s\n", + (*I).second.SHA256.c_str(), + (*I).second.size, + (*I).first.c_str()); + } } + + fprintf(Output, "SHA512:\n"); + for(map::const_iterator I = CheckSums.begin(); + I != CheckSums.end(); + ++I) + { + fprintf(Output, " %s %32ld %s\n", + (*I).second.SHA512.c_str(), + (*I).second.size, + (*I).first.c_str()); + } + } -