diff -Nru debian-goodies-0.79/bash_completion/debian-goodies.pkgnames debian-goodies-0.80/bash_completion/debian-goodies.pkgnames --- debian-goodies-0.79/bash_completion/debian-goodies.pkgnames 2015-01-20 17:59:38.000000000 +0000 +++ debian-goodies-0.80/bash_completion/debian-goodies.pkgnames 2018-07-14 00:12:31.000000000 +0000 @@ -7,6 +7,5 @@ COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) return 0 -} - +} && complete -F _pkg_names which-pkg-broke dhomepage debget diff -Nru debian-goodies-0.79/checkrestart debian-goodies-0.80/checkrestart --- debian-goodies-0.79/checkrestart 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/checkrestart 2018-07-14 00:03:45.000000000 +0000 @@ -57,7 +57,7 @@ location = os.path.join(d, sd, cmd) if os.path.exists(location): return location - return 1 + return False def checksystemd(): # Check if systemd is installed in the system @@ -529,6 +529,9 @@ # Or about files under /drm if f.startswith('/drm'): return 0 + # Or about files under /i915 + if f.startswith('/i915'): + return 0 # Or about files under /var/tmp and /var/local/tmp if f.startswith('/var/tmp/') or f.startswith('/var/local/tmp/'): return 0 diff -Nru debian-goodies-0.79/debian/bash-completion debian-goodies-0.80/debian/bash-completion --- debian-goodies-0.79/debian/bash-completion 1970-01-01 00:00:00.000000000 +0000 +++ debian-goodies-0.80/debian/bash-completion 2018-07-14 00:03:49.000000000 +0000 @@ -0,0 +1,2 @@ +bash_completion/debian-goodies.pkgnames +debmany/bash_completion/debmany diff -Nru debian-goodies-0.79/debian/changelog debian-goodies-0.80/debian/changelog --- debian-goodies-0.79/debian/changelog 2017-11-24 04:05:49.000000000 +0000 +++ debian-goodies-0.80/debian/changelog 2018-07-14 00:38:24.000000000 +0000 @@ -1,3 +1,49 @@ +debian-goodies (0.80) unstable; urgency=medium + + [ Axel Beckert ] + * Declare compliance with Debian Policy 4.1.5. (No changes needed.) + * Fix copy & paste error in man page for dhomepage(1). + * Update Vcs-* headers for move to salsa.debian.org. + * Remove trailing blank line from debian/changelog. + * Bump debhelper compatibility level to 11. + + Update versioned debhelper build-dependency accordingly. + * checkrestart: Fix logic error resulting in trying to call lsof even if + it wasn't found. (Closes: #888276) + * State in long package description that hard dependencies of single + tools are listed in Recommends. + * Install bash completions with dh_bash-completion. + + Move according files from debian/install to debian/bash-completion. + + Call dh_bash-completion after dh_auto_install. + + Add bash-completion as build-dependency. + * Add symlinks named which-pkg-broke, dhomepage and debget to + debian-goodies.pkgnames to make their bash completion work + again. (Closes: #892310) + * debian-goodies.pkgnames: Only run "complete -F" if function definition + was successful. + * Drop "have debmany &&" to make debmany's bash-completion work again. + + [ Paul Wise ] + * find-dbgsym-packages: + + Add support for finding dbgsyms for executables and libraries + + Ignore debug symbols that are in already installed packages + + Detect debug symbols packages with no or bad meta-data + * Use 'set -e' in shell scripts instead of 'sh -e' in shebangs + * Fix some typos + + [ Francesco Poli ] + * checkrestart: Fix false positive with Intel graphics card since Linux + kernel version 4.15. (Closes: #894460) + + [ Jakub Wilk ] + * which-pkg-broke: Massive speedup due to calling apt-cache less often. + (Closes: #883896) + + [ Marcel Partap ] + * debmany: Support gzip compressed text files even if the pager does not + support them. (Closes: #892211) + + -- Axel Beckert Sat, 14 Jul 2018 02:38:24 +0200 + debian-goodies (0.79) unstable; urgency=low [ Axel Beckert ] @@ -59,7 +105,7 @@ - Make some sanity checks to try to prevent simple errors - Add usage function - Make it try to download the manual page based on user's locale - and, if it fails, use the default (english) locale, as the + and, if it fails, use the default (English) locale, as the manual page claims [ Nicolas Braud-Santoni ] @@ -620,7 +666,7 @@ files which are associated with a given package - adjust command line options in usage() (Closes: 497611) - * dpigs: Use script snipet provided by Aaron M. Ucko to make it possible + * dpigs: Use script snippet provided by Aaron M. Ucko to make it possible to group by source package, use a new (-S, --source) option. (Closes: 511349) * debget: @@ -1103,4 +1149,3 @@ * Initial Release. -- Matt Zimmerman Sat, 21 Sep 2002 23:19:11 -0400 - diff -Nru debian-goodies-0.79/debian/compat debian-goodies-0.80/debian/compat --- debian-goodies-0.79/debian/compat 2017-10-27 16:52:04.000000000 +0000 +++ debian-goodies-0.80/debian/compat 2018-07-13 18:46:59.000000000 +0000 @@ -1 +1 @@ -10 +11 diff -Nru debian-goodies-0.79/debian/control debian-goodies-0.80/debian/control --- debian-goodies-0.79/debian/control 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/debian/control 2018-07-14 00:03:49.000000000 +0000 @@ -3,11 +3,12 @@ Priority: optional Maintainer: Javier Fernández-Sanguino Peña Uploaders: Axel Beckert -Build-Depends: debhelper (>= 10), +Build-Depends: bash-completion, + debhelper (>= 11~), help2man -Vcs-Git: https://anonscm.debian.org/git/collab-maint/debian-goodies.git -Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/debian-goodies.git -Standards-Version: 4.1.1 +Vcs-Git: https://salsa.debian.org/debian/debian-goodies.git +Vcs-Browser: https://salsa.debian.org/debian/debian-goodies +Standards-Version: 4.1.5 Rules-Requires-Root: no Package: debian-goodies @@ -81,3 +82,8 @@ Package name in brackets denote (non-essential) dependencies of the scripts. Packages names with an asterisk ("*") denote optional dependencies, all other are hard dependencies. + . + Hard dependencies of single tools are listed in the Recommends field + of the package and optional dependencies of single tools in the + Suggests field -- as common with many "collection" style Debian + packages. diff -Nru debian-goodies-0.79/debian/copyright debian-goodies-0.80/debian/copyright --- debian-goodies-0.79/debian/copyright 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/debian/copyright 2018-07-13 23:59:46.000000000 +0000 @@ -82,6 +82,7 @@ Files: find-dbgsym-packages Copyright: 2017 Stefan Fritsch + 2017 Paul Wise License: GPL-2+ Files: find-dbgsym-packages.pod diff -Nru debian-goodies-0.79/debian/install debian-goodies-0.80/debian/install --- debian-goodies-0.79/debian/install 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/debian/install 2018-07-14 00:03:49.000000000 +0000 @@ -1,3 +1,2 @@ -bash_completion/debian-goodies.pkgnames debmany/bash_completion/debmany usr/share/bash-completion/completions checkrestart usr/sbin dgrep dglob debget dpigs debman dman popbugs which-pkg-broke which-pkg-broke-build dhomepage debmany/debmany check-enhancements find-dbgsym-packages usr/bin diff -Nru debian-goodies-0.79/debian/links debian-goodies-0.80/debian/links --- debian-goodies-0.79/debian/links 2016-10-28 14:33:43.000000000 +0000 +++ debian-goodies-0.80/debian/links 2018-07-14 00:24:18.000000000 +0000 @@ -1,3 +1,4 @@ +# dgrep variants usr/bin/dgrep usr/bin/degrep usr/bin/dgrep usr/bin/dfgrep usr/bin/dgrep usr/bin/dzegrep @@ -8,3 +9,7 @@ usr/share/man/man1/dgrep.1.gz usr/share/man/man1/dzegrep.1.gz usr/share/man/man1/dgrep.1.gz usr/share/man/man1/dzfgrep.1.gz usr/share/man/man1/dgrep.1.gz usr/share/man/man1/dzgrep.1.gz +# bash-completion targets +usr/share/bash-completion/completions/debian-goodies.pkgnames usr/share/bash-completion/completions/which-pkg-broke +usr/share/bash-completion/completions/debian-goodies.pkgnames usr/share/bash-completion/completions/dhomepage +usr/share/bash-completion/completions/debian-goodies.pkgnames usr/share/bash-completion/completions/debget diff -Nru debian-goodies-0.79/debian/rules debian-goodies-0.80/debian/rules --- debian-goodies-0.79/debian/rules 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/debian/rules 2018-07-14 00:03:49.000000000 +0000 @@ -15,5 +15,9 @@ -N ./check-enhancements | \ sed -e 's/DESCRIPTION/SYNOPSIS/' > check-enhancements.1 +override_dh_auto_install: + dh_auto_install + dh_bash-completion + override_dh_auto_clean: for prog in $(PODDOC); do rm -f $$prog.1; done diff -Nru debian-goodies-0.79/debman debian-goodies-0.80/debman --- debian-goodies-0.79/debman 2015-01-20 17:59:38.000000000 +0000 +++ debian-goodies-0.80/debman 2018-06-05 09:45:13.000000000 +0000 @@ -1,4 +1,5 @@ -#! /bin/bash -e +#! /bin/bash +set -e # debman - read a man page from an uninstalled Debian package file (.deb) diff -Nru debian-goodies-0.79/debmany/bash_completion/debmany debian-goodies-0.80/debmany/bash_completion/debmany --- debian-goodies-0.79/debmany/bash_completion/debmany 2015-01-20 17:59:38.000000000 +0000 +++ debian-goodies-0.80/debmany/bash_completion/debmany 2018-07-14 00:30:03.000000000 +0000 @@ -7,7 +7,6 @@ # all parameters, # packages or filenames and folders. # -have debmany && _debmany() { local cur prev setf diff -Nru debian-goodies-0.79/debmany/debmany debian-goodies-0.80/debmany/debmany --- debian-goodies-0.79/debmany/debmany 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/debmany/debmany 2018-07-14 00:03:38.000000000 +0000 @@ -413,7 +413,12 @@ else # other file (usr/share/doc) debug "Opening other file: "`printf "$othercmdline" "$PWD/$return"` # comment - eval $(printf "$othercmdline" "$PWD/$return") + if [[ "$return" =~ \.gz$ ]] + then + eval $(printf "gzip -dc $PWD/$return | $othercmdline") + else + eval $(printf "$othercmdline" "$PWD/$return") + fi fi else cd "$curdir" diff -Nru debian-goodies-0.79/dglob debian-goodies-0.80/dglob --- debian-goodies-0.79/dglob 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/dglob 2018-06-05 09:45:13.000000000 +0000 @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e # dglob - Expand package names matching a pattern and conditions diff -Nru debian-goodies-0.79/dgrep.pod debian-goodies-0.80/dgrep.pod --- debian-goodies-0.79/dgrep.pod 2016-10-28 14:33:43.000000000 +0000 +++ debian-goodies-0.80/dgrep.pod 2018-06-05 09:45:13.000000000 +0000 @@ -36,7 +36,7 @@ =item B<-d> I, B<--directories>=I B searches only in the "normal" files of a package. It skips all -directories and symlinks. Therefor the options of +directories and symlinks. Therefore the options of grep that are specific to directories are not supported. =back diff -Nru debian-goodies-0.79/dhomepage.1 debian-goodies-0.80/dhomepage.1 --- debian-goodies-0.79/dhomepage.1 2017-10-27 16:06:27.000000000 +0000 +++ debian-goodies-0.80/dhomepage.1 2018-05-30 20:47:29.000000000 +0000 @@ -35,7 +35,7 @@ Print help message .TP -\fB\-\-help\fR +\fB\-\-version\fR Print version message .SH EXIT STATUS diff -Nru debian-goodies-0.79/dman debian-goodies-0.80/dman --- debian-goodies-0.79/dman 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/dman 2018-06-05 09:45:13.000000000 +0000 @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e ############################################################################### # This is the Ubuntu manpage repository generator and interface. @@ -113,7 +114,7 @@ TESTED_URLS="" # be careful not to add too many entries in this loop, as each hit can -# take some time for the rountrip +# take some time for the round-trip for URL in "$BASE_URL/$DISTRIB_CODENAME/$PAGE$LOCDOT.gz" \ "$BASE_URL/$DISTRIB_CODENAME/$PAGE.en.gz" \ "$BASE_URL/$DISTRIB_CODENAME/$PAGE.gz" \ diff -Nru debian-goodies-0.79/find-dbgsym-packages debian-goodies-0.80/find-dbgsym-packages --- debian-goodies-0.79/find-dbgsym-packages 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/find-dbgsym-packages 2018-07-13 17:48:24.000000000 +0000 @@ -4,6 +4,7 @@ # program/library. # # Copyright (C) 2017 Stefan Fritsch +# Copyright (C) 2017 Paul Wise # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +24,7 @@ use warnings FATAL => 'all'; use autodie qw(:all); use v5.14; -use IPC::System::Simple qw(capture); +use IPC::System::Simple qw(capturex); $ENV{LC_ALL} = 'C'; @@ -37,17 +38,20 @@ if ($arg =~ /^\d+$/) { %build_ids = get_build_ids_from_pid($arg); } else { - %build_ids = get_build_ids_from_core($arg); + %build_ids = get_build_ids_from_file($arg); } foreach my $id (keys %build_ids) { - my $name = $build_ids{$id}; + my ($path, $name) = @{$build_ids{$id}}; next if $name =~ /^linux-vdso[.]so[.]/; my @p = get_debs_from_id($id); if (scalar @p == 0) { - warn "Cannot find debug package for $name ($id)\n"; + @p = get_debs_from_path($path); + if (scalar @p == 0) { + warn "Cannot find debug package for $name ($id)\n"; + } } elsif (scalar @p > 1) { warn "Multiple packages for $name ($id): @p\n"; } @@ -70,7 +74,6 @@ my %ids; foreach my $line (split(/\n/, $output)) { - chomp $line; # 0x7fa9b8017000+0x39e9a0 79450f6e36287865d093ea209b85a222209925ff@0x7fa9b8017280 /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/debug/.build-id/79/450f6e36287865d093ea209b85a222209925ff.debug libc.so.6 # 0x7f7f7235e000+0x17000 - /usr/share/locale/de/LC_MESSAGES/bash.mo - /usr/share/locale/de/LC_MESSAGES/bash.mo # 0x7ffd4098a000+0x2000 de7dac2df9f596f46fa94a387858ef25170603ec@0x7ffd4098a7d0 . - [vdso: 1740] @@ -80,14 +83,19 @@ \s+ ([[:xdigit:]]{40} [@] 0x[[:xdigit:]]+ | - ) \s+ - \S+ + (\S+) \s+ - \S+ + (\S+) \s+ - (\S.*) + (\S+)? $}ix) { my $id = $1; - my $name = $2; + my $path = $2; + my $debug = $3; + my $name = $4 // $path; + if ($debug ne '-') { + next; + } if ($name =~ /\[vdso: \d+\]/) { next; } @@ -99,7 +107,11 @@ } else { die "BUG: id='$id'"; } - $ids{$id} = $name; + if ($path eq '-' || $path eq '.') { + $path = $name; + $path =~ s{ \(deleted\)$}{}; + } + $ids{$id} = [$path, $name]; } else { warn "Cannot parse eu-unstrip output: '$line'\n"; } @@ -107,10 +119,55 @@ return (%ids); } +sub get_files_from_elf +{ + my ($filename) = @_; + my @libs = ($filename); + my $output = capturex(qw(ldd --), $filename); + + foreach my $line (split(/\n/, $output)) { + chomp $line; + my ($name, $path); + if ($line =~ /^\t.+ => (.+) \(0x[0-9a-f]+\)$/) { + push @libs, $1; + } elsif ($line =~ /^\t(.+) \(0x[0-9a-f]+\)$/) { + push @libs, $1; + } else { + warn "Cannot parse ldd output: '$line'\n"; + } + } + + return @libs; +} + +sub get_build_ids_from_file +{ + my ($filename) = @_; + if (is_core_file($filename)) { + return get_build_ids_from_core($filename); + } else { + my @filenames = get_files_from_elf($filename); + my %build_ids; + foreach my $filename (@filenames) { + next if $filename =~ /^linux-vdso\.so\./; + %build_ids = (%build_ids, get_build_ids_from_elf($filename)); + } + return %build_ids; + } +} + +sub get_build_ids_from_elf +{ + my ($filename) = @_; + my $output = capturex(qw(eu-unstrip --list-only --executable), $filename); + + return parse_eu_unstrip($output); +} + sub get_build_ids_from_core { my ($filename) = @_; - my $output = capture("eu-unstrip -n --core=\Q$filename\E"); + my $output = capturex(qw(eu-unstrip --list-only --core), $filename); return parse_eu_unstrip($output); } @@ -118,7 +175,7 @@ sub get_build_ids_from_pid { my ($pid) = @_; - my $output = capture("eu-unstrip -n -p \Q$pid\E"); + my $output = capturex(qw(eu-unstrip --list-only --pid), $pid); chomp $output; return parse_eu_unstrip($output); @@ -130,29 +187,73 @@ my $output; eval { - $output = capture("grep-aptavail -s Package -F Build-IDs \Q$id\E"); + $output = capturex(qw(grep-aptavail --no-field-names --show-field Package --field Build-IDs --pattern), $id); }; if ($@) { return; } - my %pkgs; + my %pkgs = map { $_ => 1 } split(/\n/, $output); + return sort keys %pkgs; +} + +sub get_debs_from_path +{ + my ($path) = @_; + + my $output; + eval { + ($output, undef) = capturex(qw(dpkg-query --search --), $path); + }; + if ($@) { + return; + } + + my %pkgs = (); foreach my $line (split(/\n/, $output)) { - chomp $line; - if ($line =~ /^Package:\s*(\S+)$/) { + if ($line =~ /^(.*): /) { $pkgs{$1} = 1; } else { - warn "Cannot parse grep-aptavail output: '$line'\n"; + warn "Cannot parse dpkg-query output: '$line'\n"; } } - return sort keys %pkgs; + my @pkgs = sort keys %pkgs; + my @strip_pkgs = map { s{:.*}{}; s{\d.*$}{}r } @pkgs; + + eval { + ($output, undef) = capturex(qw(dpkg-query --showformat ${source:Package}\n --show --), @pkgs); + }; + if ($@) { + return; + } + + my %dbg_pkgs = (); + foreach my $src_pkg (split(/\n/, $output)) { + my $output; + eval { + $output = capturex(qw(grep-aptavail --no-field-names --show-field Package --field Package --pattern -dbg --and --whole-pkg --field Source:Package --pattern), $src_pkg); + }; + if ($@) { + warn "No dbg package for source '$src_pkg'\n"; + next; + } + my %src_dbg_pkgs = map { $_ => 1 } split(/\n/, $output); + my @src_dbg_pkgs = keys %src_dbg_pkgs; + my @src_strip_pkgs = map { my $pkg = $_; grep { /^$pkg-dbg/ } @src_dbg_pkgs } @pkgs; + @src_strip_pkgs = map { my $pkg = $_; grep { /^$pkg.*-dbg/ } @src_dbg_pkgs } @pkgs unless @src_strip_pkgs; + @src_strip_pkgs = map { my $pkg = $_; grep { /^$pkg-dbg/ } @src_dbg_pkgs } @strip_pkgs unless @src_strip_pkgs; + @src_strip_pkgs = map { my $pkg = $_; grep { /^$pkg.*-dbg/ } @src_dbg_pkgs } @strip_pkgs unless @src_strip_pkgs; + @src_dbg_pkgs = @src_strip_pkgs if @src_strip_pkgs; + map { $dbg_pkgs{$_} = 1; } @src_dbg_pkgs; + }; + + return sort keys %dbg_pkgs; } sub is_core_file { my ($filename) = (@_); - # warn qq{eu-readelf -n \Q$filename\E}; - my $output = capture("eu-readelf -h \Q$filename\E"); + my $output = capturex(qw(eu-readelf --file-header --), $filename); if ($output =~ /^\s*Type:\s*CORE/m) { return 1; } diff -Nru debian-goodies-0.79/find-dbgsym-packages.pod debian-goodies-0.80/find-dbgsym-packages.pod --- debian-goodies-0.79/find-dbgsym-packages.pod 2017-11-22 03:01:46.000000000 +0000 +++ debian-goodies-0.80/find-dbgsym-packages.pod 2018-07-13 17:48:24.000000000 +0000 @@ -2,16 +2,16 @@ =head1 NAME -find-dbgsym-packages - gets list of dbgsym packages from core dump or PID +find-dbgsym-packages - gets list of dbgsym packages from executable, library, core dump or process =head1 SYNOPSIS -B I [I …] +B I [I …] =head1 DESCRIPTION B lists all I<*-dbgsym> packages required to -properly debug processes given by a list of core dump or PID numbers. +properly debug processes given by a list of executables, libraries, core dumps or PID numbers. =head1 PREREQUISITES @@ -32,6 +32,10 @@ libcap2-dbgsym libtinfo5-dbg zsh-dbgsym $ find-dbgsym-packages /var/crash/1000/15865-1000-1000-11-1511059476-c6--bin-zsh.core libcap2-dbgsym libtinfo5-dbg zsh-dbgsym + $ find-dbgsym-packages /bin/ls + coreutils-dbgsym libpcre3-dbg libselinux1-dbgsym + $ find-dbgsym-packages /lib/x86_64-linux-gnu/libselinux.so.1 + libpcre3-dbg libselinux1-dbgsym =head1 AUTHOR diff -Nru debian-goodies-0.79/which-pkg-broke debian-goodies-0.80/which-pkg-broke --- debian-goodies-0.79/which-pkg-broke 2016-10-28 14:33:43.000000000 +0000 +++ debian-goodies-0.80/which-pkg-broke 2018-07-13 18:31:49.000000000 +0000 @@ -9,9 +9,9 @@ from string import * from stat import * -def pkgdeps(pkg): +def pkgdeps(pkgs): apt_cache = subprocess.Popen( - ['apt-cache', 'depends', pkg], + ['apt-cache', 'depends', *pkgs], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, env={} # force POSIX locale @@ -27,21 +27,14 @@ apt_cache.wait() return deps -def alldeps(pkg, ignore): - deps = {} - imm_deps = pkgdeps(pkg) - for i in imm_deps: - if ignore.get(i) is None: - deps[i] = 1 - ignore[i] = 1 - childeps = alldeps(i, ignore) - for c in childeps: - deps[c] = 1 - ignore[i] = 1 - - dlist = list(deps.keys()) - return dlist - +def alldeps(pkg): + seen = set() + todo = set([pkg]) + while todo: + new = pkgdeps(todo) + seen |= todo + todo = set(new) - seen + return seen def localarchitectures(): architectures = [] @@ -88,8 +81,7 @@ return times def what_broke(pname): - pkgs = [ pname ] - pkgs.extend(alldeps(sys.argv[1], {})) + pkgs = alldeps(pname) architectures = localarchitectures()