From 218b44d60451419605b48427d9abd1f0eb33e777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Wed, 1 Jun 2016 23:38:00 +0200 Subject: [PATCH] apt: fix deb=file with --diff does not show diff on upgrades (#3826) --- packaging/os/apt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/os/apt.py b/packaging/os/apt.py index aaed23831a1..9937cd89820 100644 --- a/packaging/os/apt.py +++ b/packaging/os/apt.py @@ -381,8 +381,8 @@ def parse_diff(output): # check for start marker from apt-get diff_start = diff.index('Reading state information...') except ValueError: + # show everything diff_start = -1 - diff.insert(0, 'Unexpected apt output for --diff. Showing everything:') try: # check for end marker line from both apt-get and aptitude diff_end = (i for i, item in enumerate(diff) if re.match('[0-9]+ (packages )?upgraded', item)).next() @@ -538,7 +538,7 @@ def install_deb(m, debs, cache, force, install_recommends, allow_unauthenticated if 'prepared' in diff: diff['prepared'] += '\n\n' + out else: - diff = out + diff = parse_diff(out) if "stderr" in retvals: stderr = retvals["stderr"] + err else: