X-Git-Url: https://piware.de/gitweb/?p=bin.git;a=blobdiff_plain;f=install-manifest;h=1fd337c23a72b366d417815bab427f3865c015cb;hp=b6d7bc4c82f304cec4185ced4e78b937cf0922ee;hb=6c8261c08d6e3f0666f91da3339a98176cb945b2;hpb=6c5e192b2c2f243c332099dbaaad3691abb967ad diff --git a/install-manifest b/install-manifest index b6d7bc4..1fd337c 100755 --- a/install-manifest +++ b/install-manifest @@ -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') +no_install_re = re.compile('^ubiquity|^casper|debian-install') def parse_argv(): '''Parse CLI options. @@ -36,18 +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 +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 if subprocess.call(['which', 'dselect'], stdout=subprocess.PIPE) != 0: print >> sys.stderr, 'INFO: installing dselect (needed by this script)'