[maemo-commits] [maemo-commits] r14885 - in projects/haf/trunk/apt: . apt-pkg debian
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Thu Dec 6 18:35:53 EET 2007
- Previous message: [maemo-commits] r14884 - in projects/haf/trunk/apt: . cmdline debian
- Next message: [maemo-commits] r14886 - in projects/haf/trunk/apt: . apt-pkg debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: marivoll Date: 2007-12-06 18:35:44 +0200 (Thu, 06 Dec 2007) New Revision: 14885 Added: projects/haf/trunk/apt/gpgvinfo.patch Modified: projects/haf/trunk/apt/README.maemo projects/haf/trunk/apt/apt-pkg/acquire-item.cc projects/haf/trunk/apt/apt-pkg/acquire-item.h projects/haf/trunk/apt/apt-pkg/acquire.cc projects/haf/trunk/apt/debian/changelog Log: * Applied ggpvinfo.patch Modified: projects/haf/trunk/apt/README.maemo =================================================================== --- projects/haf/trunk/apt/README.maemo 2007-12-06 16:21:49 UTC (rev 14884) +++ projects/haf/trunk/apt/README.maemo 2007-12-06 16:35:44 UTC (rev 14885) @@ -25,3 +25,7 @@ - ignoretimeconflict.patch Don't fail to add or use keys when the clock is wrong. + +- gpgvinfo.patch + +Store a foo.gpg.info with the results of verifying signatures. Modified: projects/haf/trunk/apt/apt-pkg/acquire-item.cc =================================================================== --- projects/haf/trunk/apt/apt-pkg/acquire-item.cc 2007-12-06 16:21:49 UTC (rev 14884) +++ projects/haf/trunk/apt/apt-pkg/acquire-item.cc 2007-12-06 16:35:44 UTC (rev 14885) @@ -1028,8 +1028,31 @@ URItoFileName(RealURI) + ".gpg"; Rename(SigFile,VerifiedSigFile); chmod(VerifiedSigFile.c_str(),0644); + + // Record what gpgv had to say about it + + string SigInfoFile = _config->FindDir("Dir::State::lists") + + URItoFileName(RealURI) + ".gpg.info"; + string GPGVOutput = LookupTag (Message,"GPGVOutput"); + FILE *f = fopen (SigInfoFile.c_str(), "w"); + if (f) + { + fputs (GPGVOutput.c_str(), f); + fputc ('\n', f); + fclose (f); + } + else + std::cerr << "Can't write info file: " + << SigInfoFile << ": " + << strerror (errno) << "\n"; } +bool pkgAcqMetaIndex::IsMyFile (string file) +{ + return (Item::IsMyFile (file) + || file == flNotDir (DestFile) + ".gpg.info"); +} + void pkgAcqMetaIndex::QueueIndexes(bool verify) { for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin(); Modified: projects/haf/trunk/apt/apt-pkg/acquire-item.h =================================================================== --- projects/haf/trunk/apt/apt-pkg/acquire-item.h 2007-12-06 16:21:49 UTC (rev 14884) +++ projects/haf/trunk/apt/apt-pkg/acquire-item.h 2007-12-06 16:35:44 UTC (rev 14885) @@ -243,6 +243,8 @@ /** \return \b true if this object is being fetched from a trusted source. */ virtual bool IsTrusted() {return false;}; + virtual bool IsMyFile(string file) { return file == flNotDir (DestFile); }; + /** \brief Initialize an item. * * Adds the item to the list of items known to the acquire @@ -743,6 +745,7 @@ pkgAcquire::MethodConfig *Cnf); virtual string Custom600Headers(); virtual string DescURI() {return RealURI; }; + virtual bool IsMyFile (string file); /** \brief Create a new pkgAcqMetaIndex. */ pkgAcqMetaIndex(pkgAcquire *Owner, Modified: projects/haf/trunk/apt/apt-pkg/acquire.cc =================================================================== --- projects/haf/trunk/apt/apt-pkg/acquire.cc 2007-12-06 16:21:49 UTC (rev 14884) +++ projects/haf/trunk/apt/apt-pkg/acquire.cc 2007-12-06 16:35:44 UTC (rev 14885) @@ -436,8 +436,8 @@ // Look in the get list ItemCIterator I = Items.begin(); for (; I != Items.end(); I++) - if (flNotDir((*I)->DestFile) == Dir->d_name) - break; + if ((*I)->IsMyFile (Dir->d_name)) + break; // Nothing found, nuke it if (I == Items.end()) Modified: projects/haf/trunk/apt/debian/changelog =================================================================== --- projects/haf/trunk/apt/debian/changelog 2007-12-06 16:21:49 UTC (rev 14884) +++ projects/haf/trunk/apt/debian/changelog 2007-12-06 16:35:44 UTC (rev 14885) @@ -4,6 +4,7 @@ * Applied http-tablet-identification.patch * Applied mmap.patch * Applied ignoretimeconflict.patch + * Applied ggpvinfo.patch -- Marius Vollmer <mvo at zagadka.de> Thu, 06 Dec 2007 17:15:19 +0200 Added: projects/haf/trunk/apt/gpgvinfo.patch =================================================================== --- projects/haf/trunk/apt/gpgvinfo.patch 2007-12-06 16:21:49 UTC (rev 14884) +++ projects/haf/trunk/apt/gpgvinfo.patch 2007-12-06 16:35:44 UTC (rev 14885) @@ -0,0 +1,72 @@ +Index: apt-pkg/acquire-item.cc +=================================================================== +--- apt-pkg/acquire-item.cc (revision 14875) ++++ apt-pkg/acquire-item.cc (working copy) +@@ -1028,8 +1028,31 @@ + URItoFileName(RealURI) + ".gpg"; + Rename(SigFile,VerifiedSigFile); + chmod(VerifiedSigFile.c_str(),0644); ++ ++ // Record what gpgv had to say about it ++ ++ string SigInfoFile = _config->FindDir("Dir::State::lists") + ++ URItoFileName(RealURI) + ".gpg.info"; ++ string GPGVOutput = LookupTag (Message,"GPGVOutput"); ++ FILE *f = fopen (SigInfoFile.c_str(), "w"); ++ if (f) ++ { ++ fputs (GPGVOutput.c_str(), f); ++ fputc ('\n', f); ++ fclose (f); ++ } ++ else ++ std::cerr << "Can't write info file: " ++ << SigInfoFile << ": " ++ << strerror (errno) << "\n"; + } + ++bool pkgAcqMetaIndex::IsMyFile (string file) ++{ ++ return (Item::IsMyFile (file) ++ || file == flNotDir (DestFile) + ".gpg.info"); ++} ++ + void pkgAcqMetaIndex::QueueIndexes(bool verify) + { + for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin(); +Index: apt-pkg/acquire-item.h +=================================================================== +--- apt-pkg/acquire-item.h (revision 14875) ++++ apt-pkg/acquire-item.h (working copy) +@@ -243,6 +243,8 @@ + /** \return \b true if this object is being fetched from a trusted source. */ + virtual bool IsTrusted() {return false;}; + ++ virtual bool IsMyFile(string file) { return file == flNotDir (DestFile); }; ++ + /** \brief Initialize an item. + * + * Adds the item to the list of items known to the acquire +@@ -743,6 +745,7 @@ + pkgAcquire::MethodConfig *Cnf); + virtual string Custom600Headers(); + virtual string DescURI() {return RealURI; }; ++ virtual bool IsMyFile (string file); + + /** \brief Create a new pkgAcqMetaIndex. */ + pkgAcqMetaIndex(pkgAcquire *Owner, +Index: apt-pkg/acquire.cc +=================================================================== +--- apt-pkg/acquire.cc (revision 14875) ++++ apt-pkg/acquire.cc (working copy) +@@ -436,8 +436,8 @@ + // Look in the get list + ItemCIterator I = Items.begin(); + for (; I != Items.end(); I++) +- if (flNotDir((*I)->DestFile) == Dir->d_name) +- break; ++ if ((*I)->IsMyFile (Dir->d_name)) ++ break; + + // Nothing found, nuke it + if (I == Items.end())
- Previous message: [maemo-commits] r14884 - in projects/haf/trunk/apt: . cmdline debian
- Next message: [maemo-commits] r14886 - in projects/haf/trunk/apt: . apt-pkg debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]