Move all stuff to old/ and add live-initramfs and initial fai-stuff
[grml-live.git] / old / rewrite / clean_dpkg_status
diff --git a/old/rewrite/clean_dpkg_status b/old/rewrite/clean_dpkg_status
new file mode 100644 (file)
index 0000000..50a4ef8
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+my $filename='/var/lib/dpkg/status';
+
+open FILE, $filename or
+die "Failed to open $filename\n";
+
+while (my $line=<FILE>) {
+
+    chomp($line);
+    my @section=();
+
+    while ($line ne "") {
+        push(@section,$line);
+        $line=<FILE>;
+        chomp($line);
+    }
+
+    if ($section[1] ne 'Status: purge ok not-installed') {
+
+        foreach (@section) {
+            $_ = $_ . "\n";
+            print;
+        }
+
+        print"\n";
+    }
+}