find-dbgsym-packages: Handle case when no such file was found
So far, find-dbgsym-packages threw a rather confusing error message if
called with a program name instead of a full path to a file:
$ find-dbgsym-packages ls
eu-readelf: cannot open input file: No such file or directory
"eu-readelf" unexpectedly returned exit value 1 at /usr/bin/find-dbgsym-packages line 252.
So let's do two things:
* Proper warning when a file given on the commandline does not exist.
* Check if the name given as parameter is an executable in $PATH if no
such file exists.
Use File::Which for this and add a Recommends on libfile-which-perl
accordingly.
Axel Beckert
5 years ago
|
0 |
debian-goodies (0.84) UNRELEASED; urgency=medium
|
|
1 |
|
|
2 |
* find-dbgsym-packages:
|
|
3 |
+ Proper warning (instead of eu-readelf bailing out) when file given
|
|
4 |
on the commandline does not exist.
|
|
5 |
+ Check if name given as parameter is an executable in $PATH if no
|
|
6 |
such file exists. Use File::Which for this and add a Recommends on
|
|
7 |
libfile-which-perl accordingly.
|
|
8 |
|
|
9 |
-- Axel Beckert <abe@debian.org> Sun, 18 Nov 2018 16:53:41 +0100
|
|
10 |
|
0 | 11 |
debian-goodies (0.83) unstable; urgency=medium
|
1 | 12 |
|
2 | 13 |
[ Jakub Wilk ]
|
18 | 18 |
dctrl-tools,
|
19 | 19 |
elfutils,
|
20 | 20 |
libipc-system-simple-perl,
|
|
21 |
libfile-which-perl,
|
21 | 22 |
man-db,
|
22 | 23 |
perl,
|
23 | 24 |
popularity-contest,
|
|
68 | 69 |
[dctrl-tools]
|
69 | 70 |
find-dbgsym-packages
|
70 | 71 |
- Get list of dbgsym packages from core dump or PID [dctrl-tools,
|
71 | |
elfutils, libipc-system-simple-perl]
|
|
72 |
elfutils, libfile-which-perl, libipc-system-simple-perl]
|
72 | 73 |
popbugs - Display a customized release-critical bug list based on
|
73 | 74 |
packages you use (using popularity-contest data) [python3,
|
74 | 75 |
popularity-contest]
|
24 | 24 |
use autodie qw(:all);
|
25 | 25 |
use v5.14;
|
26 | 26 |
use IPC::System::Simple qw(capturex $EXITVAL);
|
|
27 |
use File::Which;
|
27 | 28 |
|
28 | 29 |
$ENV{LC_ALL} = 'C';
|
29 | 30 |
|
|
145 | 146 |
sub get_build_ids_from_file
|
146 | 147 |
{
|
147 | 148 |
my ($filename) = @_;
|
|
149 |
if ($filename !~ m(/) and not -f $filename) {
|
|
150 |
my $oldfilename = $filename;
|
|
151 |
$filename = which($filename);
|
|
152 |
if (defined($filename)) {
|
|
153 |
warn "I: ./$oldfilename not found, using $filename instead\n";
|
|
154 |
} else {
|
|
155 |
warn "W: ./$oldfilename not found ".
|
|
156 |
"and no '$oldfilename' found in path either, skipping\n";
|
|
157 |
return qw();
|
|
158 |
}
|
|
159 |
}
|
|
160 |
|
|
161 |
unless (-f $filename) {
|
|
162 |
warn "W: $filename not found, skipping\n";
|
|
163 |
return qw();
|
|
164 |
}
|
|
165 |
|
148 | 166 |
if (is_core_file($filename)) {
|
149 | 167 |
return get_build_ids_from_core($filename);
|
150 | 168 |
} else {
|