Update of /cvsroot/fink/fink/perlmod/Fink
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23144

Modified Files:
        ChangeLog PkgVersion.pm 
Log Message:
If setting buildlock fails, attempt to remove lockpkg so it doesn't
get left in "unpacked" state in dpkg's status db.


Index: PkgVersion.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v
retrieving revision 1.337
retrieving revision 1.338
diff -u -d -r1.337 -r1.338
--- PkgVersion.pm       5 Jan 2005 09:43:52 -0000       1.337
+++ PkgVersion.pm       6 Jan 2005 21:47:34 -0000       1.338
@@ -2849,14 +2849,8 @@
        print "Setting build lock...\n";
        my $debfile = 
$buildpath.'/'.$lockpkg.'_'.$timestamp.'_'.$debarch.'.deb';
        my $lock_failed = &execute("dpkg -i $debfile");
-       rm_f $debfile or
-               &print_breaking("WARNING: Can't remove binary package file ".
-                                               "$debfile. ".
-                                               "This is not fatal, but you may 
want to remove ".
-                                               "the file manually to save disk 
space. ".
-                                               "Continuing with normal 
procedure.");
        if ($lock_failed) {
-               die <<EOMSG
+               &print_breaking(<<EOMSG);
 Can't set build lock for $pkgname ($pkgvers)
 
 If any of the above dpkg error messages mention problems with
@@ -2869,8 +2863,23 @@
 wasted compiling time! Packages that had been completely built before
 this error occurred will not have to be recompiled.
 EOMSG
+
+               # Failure due to depenendecy problems leaves lockpkg in an
+               # "unpacked" state, so try to remove it entirely.
+               &execute("dpkg -r $lockpkg") or
+                       &print_breaking('You can probably ignore the above 
errors from "dpkg -r"');
        }
 
+       # Even if installation fails, no reason to keep this around
+       rm_f $debfile or
+               &print_breaking("WARNING: Can't remove binary package file ".
+                                               "$debfile. ".
+                                               "This is not fatal, but you may 
want to remove ".
+                                               "the file manually to save disk 
space. ".
+                                               "Continuing with normal 
procedure.");
+
+       die("buildlock failure") if $lock_failed;
+
        # successfully get lock, so record ourselves
        $self->{_lockpkg} = $lockpkg;
 

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.793
retrieving revision 1.794
diff -u -d -r1.793 -r1.794
--- ChangeLog   6 Jan 2005 21:29:04 -0000       1.793
+++ ChangeLog   6 Jan 2005 21:47:34 -0000       1.794
@@ -1,5 +1,9 @@
 2005-1-05  Daniel Macks  <[EMAIL PROTECTED]>
 
+       * PkgVersion.pm: Try not to leave partially-installed buildlock pkg.
+
+2005-1-05  Daniel Macks  <[EMAIL PROTECTED]>
+
        * SelfUpdate.pm: Do 'apt-get update' *before* rebuilding aptdb.
 
 2005-1-05  Daniel Macks  <[EMAIL PROTECTED]>



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to