Skip to content
Snippets Groups Projects
Commit 5ce5673e authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Ignore packages with -generic after headers or image word in kernels listing.

parent ac0e95a5
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ def clean_kernels():
log(RED + 'Failed to get sudo right.' + DEFAULT, error=True)
return 1
# list installed kernels
p = subprocess.Popen('sudo dpkg --get-selections| grep -v -- -generic | grep linux', stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
p = subprocess.Popen('sudo dpkg --get-selections | grep linux', stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
out, err = p.communicate()
out = out.decode('utf-8') if out else ''
err = err.decode('utf-8') if err else ''
......@@ -41,7 +41,7 @@ def clean_kernels():
return 1
kernels = list()
for line in out.split('\n'):
m = re.match(r'linux-(headers|image)([\w-]*)-([\d\.-]+)', line)
m = re.match(r'linux-(headers|image)(?!-generic)([\w-]*)-([\d\.-]+)', line)
if m:
version = m.groups()[2]
if version[-1] == '-':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment