apt-listdifferences/0000700000000000000000000000000012230130730011654 5ustar apt-listdifferences/colordiff-git.patch0000600000000000000000000000464112206175533015451 0ustar description: gitify colordiff author: Michael Gilbert --- a/colordiff 2012-12-28 09:35:44.000000000 +0000 +++ b/colordiff-git 2013-08-15 03:38:00.255714484 +0000 @@ -7,6 +7,10 @@ # # # Copyright (C)2002-2012 Dave Ewart (davee@sungate.co.uk) # # # +# colordiff-git modifications # +# # +# Copyright (C) 2013 Michael Gilbert (mgilbert@debian.org) # +# # ######################################################################## # # # This program is free software; you can redistribute it and/or modify # @@ -53,14 +57,15 @@ $colour{darkred} = "\033[0;31m"; $colour{darkmagenta} = "\033[0;35m"; $colour{darkblack} = "\033[0;30m"; +$colour{bold} = "\033[0;1m"; $colour{off} = "\033[0;0m"; # Default colours if /etc/colordiffrc or ~/.colordiffrc do not exist -my $plain_text = $colour{white}; -my $file_old = $colour{red}; -my $file_new = $colour{blue}; -my $diff_stuff = $colour{magenta}; -my $cvs_stuff = $colour{green}; +my $plain_text = ""; +my $file_old = $colour{darkred}; +my $file_new = $colour{darkgreen}; +my $diff_stuff = $colour{darkcyan}; +my $cvs_stuff = $colour{bold}; # Locations for personal and system-wide colour configurations my $HOME = $ENV{HOME}; @@ -160,13 +165,8 @@ my $enable_verifymode; my $specified_difftype; -GetOptions( - # --enable-verifymode option is for testing behaviour of colordiff - # against standard test diffs - "verifymode" => \$enable_verifymode, - "difftype=s" => \$specified_difftype - # TODO - check that specified type is valid, issue warning if not -); + +$enable_verifymode = 1; if (defined $enable_verifymode) { # When in verify mode, to ensure consistent output we don't source @@ -435,7 +435,13 @@ } } elsif ($diff_type eq 'diffu') { - if (/^-/) { + if (/^---/) { + print "$cvs_stuff"; + } + elsif (/^\+\+\+/) { + print "$cvs_stuff"; + } + elsif (/^-/) { print "$file_old"; } elsif (/^\+/) { apt-listdifferences/apt-listdifferences.10000600000000000000000000000132312215234202015674 0ustar .TH apt-listdifferences 1 2013-08-11 .SH NAME apt-listdifferences \- source differences notification tool .SH SYNOPSIS .B apt-listdifferences [ \-\-apt | \-\-initialize | ] .SH DESCRIPTION .B apt-listdifferences will show the differences, or patch, between the sources for all packages as they get updated. This makes it possible to easily review source changes that have been included in new Debian package updates. .SH OPTIONS .TP \-\-apt, expect a list of packages, one per line, on stdin .TP \-\-initialize, download source database based on existing installed packages .TP , a list of Debian package files to use as reference .SH AUTHOR Michael Gilbert apt-listdifferences/TODO0000600000000000000000000000022112203043657012354 0ustar Here are some nice wishlist tasks: * automatically skip or only stat autotools cruft * make changelog part of the diff first for every package apt-listdifferences/apt-listdifferences0000700000000000000000000001312312225120156015542 0ustar #!/usr/bin/python3 # # Copyright (C) 2013 Michael Gilbert # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. import os import sys import apt import subprocess # produce a file listing from a dsc file def get_files(dsc): import deb822 files = [] with open(dsc) as fdsc: data = deb822.Dsc(fdsc) for info in data['Files']: files.append(info['name']) return files # remove old source package files as we go? cleanup = True # colorize output? color = True # binary paths pager_command = '/usr/bin/pager' debdiff_command = '/usr/bin/debdiff' diffstat_command = '/usr/bin/diffstat' colordiff_command = '/usr/bin/colordiff-git' # usage info program_name = os.path.basename(sys.argv[0]) usage = 'usage: %s [ --apt | --initialize | ]' if len(sys.argv) < 2: print(usage%program_name) sys.exit(1) # make sure destination directory exists if os.getuid() == 0: dstdir = '/var/cache/apt/sources' else: dstdir = os.path.expanduser('~/%s'%program_name) if not os.path.exists(dstdir): os.mkdir(dstdir) # set up an appropriate list of packages cache = apt.Cache() if '--apt' in sys.argv: packages = [] for filename in sys.stdin.read().splitlines(): info = os.path.basename(filename)[:-4].split('_') packages.append('%s:%s'%(info[0],info[-1])) elif '--initialize' in sys.argv: packages = [] for package in cache: if package.is_installed: packages.append(package.fullname) else: packages = sys.argv[1:] if packages: print('%s: fetching source packages'%program_name) # step through binary packages and download their sources sources = {} skip = '%s: skipping differences for src:%s - %s' for package in packages: try: installed = cache[package].installed candidate = cache[package].candidate except: name = package.split(':')[0] installed = cache[name].installed candidate = cache[name].candidate if installed: oldversion = installed.source_version else: oldversion = '0' newversion = candidate.source_version source = candidate.source_name if source not in sources: try: candidate.fetch_source(destdir=dstdir, unpack=False) sources[source] = (oldversion, newversion) except ValueError: print(skip%(program_name, source, 'unable to download sources')) except: print('%s: unhandled download exception, exiting'%program_name) sys.exit() # avoid diffing in initialization mode if '--initialize' in sys.argv: sys.exit(0) # step through each source package and do a debdiff diff = bytes() message = 'diffstat %s_%s %s_%s\n\n' havediffstat = os.path.exists(diffstat_command) for source in sorted(sources, key=sources.get): oldversion,newversion = sources[source] installed_dsc = os.path.join(dstdir, '%s_%s.dsc'%(source, oldversion)) candidate_dsc = os.path.join(dstdir, '%s_%s.dsc'%(source, newversion)) if os.path.exists(installed_dsc): command = (debdiff_command, installed_dsc, candidate_dsc) process = subprocess.Popen(command, stdout=subprocess.PIPE) debdiff = process.communicate()[0] if havediffstat: command = (diffstat_command, '-q') process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) diffstat = process.communicate(debdiff)[0] if diffstat: diff += bytes(message%(source, oldversion, source, newversion), 'utf-8') diff += diffstat diff += bytes('\n', 'utf-8') diff += debdiff if cleanup and oldversion != newversion: print('%s: removing old src:%s %s'%(program_name, source, oldversion)) installed_files = get_files(installed_dsc) candidate_files = get_files(candidate_dsc) for installed_file in installed_files: if installed_file not in candidate_files: os.remove(os.path.join(dstdir,installed_file)) os.remove(installed_dsc) else: if oldversion == '0': print(skip%(program_name, source, 'no prior source available')) else: print(skip%(program_name, source, 'differences already seen')) # apply coloring if color: command = (colordiff_command) process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) diff = process.communicate(diff)[0] # page results for user to review if diff: command = (pager_command,'-R') process = subprocess.Popen(command, stdin=subprocess.PIPE) process.communicate(diff) apt-listdifferences/debian/0000700000000000000000000000000012230130730013076 5ustar apt-listdifferences/debian/changelog0000600000000000000000000000132412230130724014755 0ustar apt-listdifferences (1.20131017) unstable; urgency=low * Support missing apt-listdifferences in its apt conffile (closes: #726522). -- Michael Gilbert Fri, 18 Oct 2013 03:45:23 +0000 apt-listdifferences (1.20131009) unstable; urgency=low * Better support for multi-arch. * Add diffstat recommendation (closes: #721858). * Depend on python3-apt instead of python-apt (closes: #721955). * Depend on python3-debian instead of python-debian (closes: #724341). -- Michael Gilbert Wed, 09 Oct 2013 00:20:18 +0000 apt-listdifferences (1.20130824) unstable; urgency=low * Initial Release. -- Michael Gilbert Sat, 24 Aug 2013 18:39:11 +0000 apt-listdifferences/debian/dirs0000600000000000000000000000002712200040023013753 0ustar /var/cache/apt/sources apt-listdifferences/debian/20listdifferences0000600000000000000000000000011212230127763016344 0ustar DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listdifferences --apt || true"; }; apt-listdifferences/debian/po/0000700000000000000000000000000012230130730013514 5ustar apt-listdifferences/debian/po/templates.pot0000644000000000000000000000300712225120775016264 0ustar #, fuzzy msgid "" msgstr "" "Project-Id-Version: apt-listdifferences\n" "Report-Msgid-Bugs-To: apt-listdifferences@packages.debian.org\n" "POT-Creation-Date: 2013-08-14 23:50+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #. Type: boolean #. Description #: ../templates:1001 msgid "Would you like to initialize the apt-listdifferences database now?" msgstr "" #. Type: boolean #. Description #: ../templates:1001 msgid "" "apt-listdifferences can initialize its database of source packages now. " "Depending on your internet connection, this may take a while, but it will " "also provide immediate functionality for the tool." msgstr "" #. Type: boolean #. Description #: ../templates:1001 msgid "" "If you select No, apt-list-differences will instead become functional slowly " "over time as more and more reference source packages get added to its " "database when they are first seen." msgstr "" #. Type: boolean #. Description #: ../templates:2001 msgid "Would you like to remove the apt-listdifferences database?" msgstr "" #. Type: boolean #. Description #: ../templates:2001 msgid "" "The apt-listdifferences database is currently still on disk. You can save a " "lot of space by removing it now, but if you ever plan to reinstall apt-" "listdifferences, the database will need to be fully downloaded again." msgstr "" apt-listdifferences/debian/po/POTFILES.in0000600000000000000000000000004412203013577015302 0ustar [type: gettext/rfc822deb] templates apt-listdifferences/debian/compat0000600000000000000000000000000212200040023014266 0ustar 9 apt-listdifferences/debian/rules0000700000000000000000000000045012221616155014167 0ustar #!/usr/bin/make -f export DH_VERBOSE=1 %: dh $@ --with python3 override_dh_auto_build: patch /usr/bin/colordiff colordiff-git.patch -o colordiff-git gunzip < /usr/share/man/man1/colordiff.1.gz > colordiff-git.1 override_dh_clean: dh_clean colordiff-git colordiff-git.1 debconf-updatepo apt-listdifferences/debian/config0000600000000000000000000000015612202021270014267 0ustar #!/bin/sh set -e . /usr/share/debconf/confmodule db_input high apt-listdifferences/initialize || true db_go apt-listdifferences/debian/source/0000700000000000000000000000000012200040023014366 5ustar apt-listdifferences/debian/source/format0000600000000000000000000000001512200040023015577 0ustar 3.0 (native) apt-listdifferences/debian/install0000600000000000000000000000014112203043561014472 0ustar colordiff-git /usr/bin apt-listdifferences /usr/bin debian/20listdifferences /etc/apt/apt.conf.d apt-listdifferences/debian/postrm0000600000000000000000000000037512202013205014350 0ustar #!/bin/sh set -e . /usr/share/debconf/confmodule if [ "$1" = "purge" ]; then db_input high apt-listdifferences/purge || true db_go db_get apt-listdifferences/purge test "$RET" = "false" || rm -rf /var/cache/apt/sources fi #DEBHELPER# apt-listdifferences/debian/templates0000600000000000000000000000160212224035265015032 0ustar Template: apt-listdifferences/initialize Type: boolean Default: true _Description: Would you like to initialize the apt-listdifferences database now? apt-listdifferences can initialize its database of source packages now. Depending on your internet connection, this may take a while, but it will also provide immediate functionality for the tool. . If you select No, apt-list-differences will instead become functional slowly over time as more and more reference source packages get added to its database when they are first seen. Template: apt-listdifferences/purge Type: boolean Default: false _Description: Would you like to remove the apt-listdifferences database? The apt-listdifferences database is currently still on disk. You can save a lot of space by removing it now, but if you ever plan to reinstall apt-listdifferences, the database will need to be fully downloaded again. apt-listdifferences/debian/copyright0000600000000000000000000000231312200040023015022 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 Upstream-Name: apt-listdifferences Files: * Copyright: 2013 Michael Gilbert License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. apt-listdifferences/debian/control0000600000000000000000000000126712224035345014522 0ustar Source: apt-listdifferences Section: utils Priority: extra Maintainer: Michael Gilbert Build-Depends: debhelper (>= 9), po-debconf, colordiff, python3, patch, Built-Using: colordiff, Standards-Version: 3.9.4 Package: apt-listdifferences Architecture: all Depends: ${misc:Depends}, ${python3:Depends}, devscripts, python3-apt, python3-debian, debian-keyring, Recommends: diffstat, Description: source differences notification tool apt-listdifferences will show the differences, or patch, between the sources for all packages as they get updated. This makes it possible to easily review source changes that have been included in new Debian package updates. apt-listdifferences/debian/manpages0000600000000000000000000000004612203047473014631 0ustar colordiff-git.1 apt-listdifferences.1 apt-listdifferences/debian/postinst0000600000000000000000000000033512203032751014713 0ustar #!/bin/sh set -e . /usr/share/debconf/confmodule if [ "$1" = "configure" ]; then db_get apt-listdifferences/initialize test "$RET" = "false" || test ! -z "$2" || apt-listdifferences --initialize fi #DEBHELPER#