OSDN Git Service

Don't write installation records for unavailable packages.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 2 Mar 2010 21:07:00 +0000 (21:07 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 2 Mar 2010 21:07:00 +0000 (21:07 +0000)
ChangeLog
src/tarproc.cpp

index e061525..5d0cef3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,19 @@
 2010-03-02  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
+       Don't write installation records for unavailable packages.
+
+       * src/tarproc.cpp (pkgTarArchiveInstaller): In constructor, ensure
+       archive is ready for processing, before initialising an installation
+       manifest record.
+
+2010-03-02  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
        Rationalise path identification for XML file locations.
 
        * src/sysroot.cpp (pkgXmlDocument::LoadSystemMap): Use `xmlfile()'
        function to locate `sysroot' map file; free memory when done.
        (pkgXmlDocument::UpdateSystemMap): Likewise.
+       (sigpath): Static global variable disused; delete it.
 
 2010-03-01  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
index 242522e..d3d093e 100644 (file)
@@ -398,7 +398,7 @@ pkgTarArchiveInstaller( pkgXmlNode *pkg ):pkgTarArchiveProcessor( pkg )
    * we add a package installation record to the sysroot entry in the
    * XML database, and mark that sysroot entry as 'modified'.
    */
-  if( (tarname != NULL) && (sysroot != NULL) )
+  if( (tarname != NULL) && (sysroot != NULL) && stream->IsReady() )
   {
     /* The installation record must identify, as a minimum,
      * the canonical name of the package being installed.
@@ -418,6 +418,11 @@ pkgTarArchiveInstaller( pkgXmlNode *pkg ):pkgTarArchiveProcessor( pkg )
 
     /* Set the 'modified' flag for, and attach the installation
      * record to, the relevant sysroot record.
+     *
+     * FIXME: We should defer this until AFTER the archive has
+     * been successfully processed, (in the destructor, perhaps?),
+     * cleaning up, and not updating the installation manifest,
+     * in the event of an archive processing failure.
      */
     sysroot->SetAttribute( modified_key, yes_value );
     sysroot->AddChild( installed );