]> piware.de Git - bin.git/blobdiff - install-manifest
postinst-setup: bump postgresql version
[bin.git] / install-manifest
index dce8daa2ff6df9bc0691b8e84e8450bf498b9d0e..a770d3bc6175be7759e1bb58a14ef4c0a333914e 100755 (executable)
@@ -2,7 +2,9 @@
 
 import urllib, sys, optparse, re, subprocess
 
-kernel_pkg_re = re.compile('linux-(generic|firmware|headers|image|backports|ec2|source|virtual|preempt)')
+kernel_pkg_re = re.compile('^linux-(generic|firmware|headers|image|backports|ec2|source|virtual|preempt)')
+no_remove_re = re.compile('^bcmwl-|^dkms|^grub|^xserver-xorg-video-intel|bootchart|^openssh-client')
+no_install_re = re.compile('^ubiquity|^casper|debian-install|^cryptsetup|^dmsetup|^ecryptfs-utils|^parted|^redboot-tools|^tasksel|^aptitude|^os-prober|^devio')
 
 def parse_argv():
     '''Parse CLI options.
@@ -36,22 +38,21 @@ for l in urllib.urlopen(manifest):
     pkg = l.split()[0]
     if options.keep_kernel and kernel_pkg_re.match(pkg):
         continue
+    if no_install_re.search(pkg):
+        continue
     selection += '%s\tinstall\n' % pkg
 
 # add local kernel packages on --keep-kernel
-if options.keep_kernel:
-    dpkg = subprocess.Popen(['dpkg', '--get-selections'],
-            stdout=subprocess.PIPE)
-    for l in dpkg.stdout:
-        pkg, status = l.split()
-        if status != 'install':
-            continue
-        if kernel_pkg_re.match(pkg):
-            selection += '%s\tinstall\n' % pkg
-
-if subprocess.call(['which', 'dselect'], stdout=subprocess.PIPE) != 0:
-    print >> sys.stderr, 'INFO: installing dselect (needed by this script)'
-    assert subprocess.call(['apt-get', '-y', 'install', 'dselect']) == 0
+dpkg = subprocess.Popen(['dpkg', '--get-selections'],
+        stdout=subprocess.PIPE)
+for l in dpkg.stdout:
+    pkg, status = l.split()
+    if status != 'install':
+        continue
+    if options.keep_kernel and kernel_pkg_re.match(pkg):
+        selection += '%s\tinstall\n' % pkg
+    if no_remove_re.search(pkg):
+        selection += '%s\tinstall\n' % pkg
 
 # now apply the new selections
 assert subprocess.call(['dpkg', '--clear-selections']) == 0
@@ -60,4 +61,4 @@ dpkg.communicate(selection)
 assert dpkg.returncode == 0
 
 # commit!
-subprocess.call(['dselect', 'install'])
+subprocess.call(['apt-get', 'dselect-upgrade'])