Update of /cvsroot/fink/fink
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv6204

Modified Files:
        .cvsignore ChangeLog MANIFEST MANIFEST.SKIP install.sh 
        setup.sh 
Added Files:
        fink-dpkg-status-cleanup.in 
Log Message:
New utility script %p/sbin/fink-dpkg-status-cleanup-lockwait to remove
entries for purged packages from the dpkg status file


Index: .cvsignore
===================================================================
RCS file: /cvsroot/fink/fink/.cvsignore,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- .cvsignore  17 Mar 2006 06:42:03 -0000      1.8
+++ .cvsignore  28 Jun 2006 01:12:20 -0000      1.9
@@ -1,5 +1,7 @@
 config*
 fink
+fink-dpkg-status-cleanup
+fink-dpkg-status-cleanup-lockwait
 fink-virtual-pkgs
 fink-instscripts
 fink-scanpackages

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/ChangeLog,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -d -r1.425 -r1.426
--- ChangeLog   20 Jun 2006 01:15:22 -0000      1.425
+++ ChangeLog   28 Jun 2006 01:12:20 -0000      1.426
@@ -1,3 +1,12 @@
+2006-06-27  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * fink-dpkg-status-cleanup.in: Template for new utility script to
+       remove purged packages from dpkg status file.
+       * setup.sh: create fink-dpkg-status-cleanup script from template
+       and also a fink-dpkg-status-cleanup-lockwait wrapper for it.
+       * install.sh: -cleanup and -cleanup-lockwait go in %p/sbin
+       * .cvsignore, MANIFEST*: Adjust for new files.
+       
 2006-06-19  Daniel Macks  <[EMAIL PROTECTED]>
 
        * bootstrap: Gotta import a module before using its methods.

--- NEW FILE: fink-dpkg-status-cleanup.in ---
#!/usr/bin/perl
# -*- mode: Perl; tab-width: 4; -*-
# vim: ts=4 sw=4 noet

use warnings;
use strict;

my $basepath = "@PREFIX@";              # Path prefix for dpkg
my $debug = 0;

my $status_file = $basepath . '/var/lib/dpkg/status';
my $status_back = $status_file . '.' . time . '.' . $$;
my $status_temp = $status_file . '.new';

umask 0022;

open my $status_old, '<', $status_file or die "Couldn't read $status_file: 
$!\n";
open my $status_new, '>', $status_temp or die "Couldn't write $status_temp: 
$!\n";

$debug && print "processing $status_file -> $status_temp\n";

my $para = '';
my $omit = 0;
my ($cnt_omit, $cnt_keep) = (0,0);
while (defined(my $line = <$status_old>)) {
    $para .= $line;
    if ($line =~ /\As*\Z/ or eof($status_old)) {
                # end of paragraph...store if not flagged to omit
                if ($omit) {
                        $cnt_omit++;
                        $debug && print "=====\nomit:\n-----\n$para";
                } else {
                        $cnt_keep++;
                        $debug && print "=====\nkeep:\n-----\n$para";
                        print $status_new $para;  # write to new database
                }
                $omit = 0;
                $para = '';
    } else {
                # some random paragraph line...
                if ($line eq "Status: purge ok not-installed\n") {
                        $omit = 1;  # package is purged...flag to omit it
                }
    }
}

close $status_old;
close $status_new;

$debug && print "=====\nrename $status_file -> $status_back\n";
rename $status_file, $status_back or die "Couldn't rename $status_file to 
$status_back\n";

$debug && print "rename $status_temp -> $status_file\n";
rename $status_temp, $status_file or die "Couldn't install $status_temp as 
$status_file\n";

print "$status_file cleaned:\n\tkeep $cnt_keep\n\tomit $cnt_omit\nold version 
saved as $status_back\n";
exit 0;

Index: install.sh
===================================================================
RCS file: /cvsroot/fink/fink/install.sh,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- install.sh  24 Mar 2006 19:06:32 -0000      1.46
+++ install.sh  28 Jun 2006 01:12:20 -0000      1.47
@@ -38,7 +38,7 @@
 mkdir -p "$basepath"
 chmod 755 "$basepath"
 
-for dir in bin \
+for dir in bin sbin \
        lib lib/perl5 lib/perl5/Fink \
        lib/perl5/Fink/{Text,Notify,Checksum,Finally} \
        lib/fink lib/fink/update \
@@ -66,6 +66,7 @@
                {dpkg,apt-get}-lockwait; do
        install -c -p -m 755 $bin "$basepath/bin/"
 done
+install -c -m 755 fink-dpkg-status-cleanup fink-dpkg-status-cleanup-lockwait 
"$basepath/sbin/"
 
 # copy all perl modules
 for subdir in . Fink Fink/{Text,Notify,Checksum,Finally} ; do

Index: MANIFEST
===================================================================
RCS file: /cvsroot/fink/fink/MANIFEST,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- MANIFEST    15 Jun 2006 19:13:00 -0000      1.3
+++ MANIFEST    28 Jun 2006 01:12:20 -0000      1.4
@@ -18,6 +18,7 @@
 TODO.shlibs
 bootstrap
 dpkg-checkall.sh
+fink-dpkg-status-cleanup.in
 fink.in
 fink.8.in
 fink.conf.5.in

Index: setup.sh
===================================================================
RCS file: /cvsroot/fink/fink/setup.sh,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- setup.sh    17 Mar 2006 06:42:07 -0000      1.23
+++ setup.sh    28 Jun 2006 01:12:20 -0000      1.24
@@ -54,9 +54,13 @@
 echo "Creating postinstall script..."
 sed "s|@PREFIX@|$basepath|g" <postinstall.pl.in >postinstall.pl
 
+echo "Creating dpkg helper script..."
+sed "s|@PREFIX@|$basepath|g" <fink-dpkg-status-cleanup.in 
>fink-dpkg-status-cleanup
+
 echo "Creating lockwait wrappers..."
-sed -e "s|@PREFIX@|$basepath|g" -e "s|@PROG@|dpkg|g" <lockwait.in 
>dpkg-lockwait
-sed -e "s|@PREFIX@|$basepath|g" -e "s|@PROG@|apt-get|g" <lockwait.in 
>apt-get-lockwait
+for prog in dpkg apt-get fink-dpkg-status-cleanup; do
+       sed -e "s|@PREFIX@|$basepath|g" -e "s|@PROG@|$prog|g" <lockwait.in 
>$prog-lockwait
+done
 
 echo "Creating g++ wrappers..."
 for gccvers in 3.3 4.0; do

Index: MANIFEST.SKIP
===================================================================
RCS file: /cvsroot/fink/fink/MANIFEST.SKIP,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- MANIFEST.SKIP       24 Mar 2006 19:29:25 -0000      1.2
+++ MANIFEST.SKIP       28 Jun 2006 01:12:20 -0000      1.3
@@ -7,6 +7,8 @@
 
 ^apt-get-lockwait$
 ^dpkg-lockwait$
+^fink-dpkg-status-cleanup$
+^fink-dpkg-status-cleanup-lockwait$
 ^fink-instscripts$
 ^fink-virtual-pkgs$
 ^fink.conf.5$


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to