[Reproducible-commits] [misc] 01/01: unreproducible-installed: Add --with-uninstalled.
Valentin Lorentz
progval-guest at moszumanska.debian.org
Wed Aug 19 14:57:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
progval-guest pushed a commit to branch master
in repository misc.
commit 4d2423d0efe08f3abd7cbfd169e25e898c9582b5
Author: Valentin Lorentz <progval at progval.net>
Date: Wed Aug 19 16:58:15 2015 +0200
unreproducible-installed: Add --with-uninstalled.
---
unreproducible-installed | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/unreproducible-installed b/unreproducible-installed
index 8e39a07..984238d 100755
--- a/unreproducible-installed
+++ b/unreproducible-installed
@@ -73,6 +73,8 @@ filter_group.add_argument('--exclude-status', type=str, action='append',
filter_group.add_argument('--with-issue', type=str, action='append',
help='Keep only packages with the given issue. Use this option multiple '
'times to make it an OR clause.')
+filter_group.add_argument('--with-uninstalled', action='store_true',
+ help='Show uninstalled packages too.')
def find_data(args):
"""Search for the reproducible.json file and load it."""
@@ -138,19 +140,28 @@ def filter_packages(args, notes):
if apt:
def get_installed_packages(args):
- installed = {x.name
- for x in apt.cache.Cache()
- if x.installed}
- return installed
+ if args.with_uninstalled:
+ packages = {x.name
+ for x in apt.cache.Cache()}
+ else:
+ packages = {x.name
+ for x in apt.cache.Cache()
+ if x.installed}
+ return packages
else:
# Fallback in case python-apt is not installed.
def get_installed_packages(args):
- dpkg_output = subprocess.check_output(['dpkg', '-l'], universal_newlines=True)
- dpkg_list = dpkg_output.split('\n')
- installed = {x.split(' ')[1].split(':')[0] # keep the second field, strip arch
- for x in dpkg_list
- if x.startswith('i')} # ignore headers
- return installed
+ if args.with_uninstalled:
+ apt_output = subprocess.check_output(['apt-cache', 'search', '.*'], universal_newlines=True)
+ apt_list = apt_output.split('\n')
+ packages = {x.split(' ')[0].split(':')[0] for x in apt_list}
+ else:
+ dpkg_output = subprocess.check_output(['dpkg', '-l'], universal_newlines=True)
+ dpkg_list = dpkg_output.split('\n')
+ packages = {x.split(' ')[1].split(':')[0] # keep the second field, strip arch
+ for x in dpkg_list
+ if x.startswith('i')} # ignore headers
+ return packages
def main(args):
if yaml:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git
More information about the Reproducible-commits
mailing list