Package: lintian4python
Version: 0.28.4
Severity: normal
Hi,
The upcoming version of Lintian will deprecate "debfiles" (both the
collection and the "$info->debfiles" method provided by
Lintian::Collect::Source). You can find a list of possibly affected
files in [1]. You can reading more about the rationale behind the
deprecation in [2].
*When* 2.5.28 is released, please apply the following changes to your
lintian checks:
* All method that previously (in)directly required the "debfiles"
collection will now require "unpacked" instead. Please update
the "Needs-Info" accordingly.
* Usage of the "debfiles" method is generally replaced by either
"index" or "index_resolved_path" and the extended API of
Lintian::Path.
- Most of the API is currently only available in the Lintian git
repository and will first be made available in version 2.5.28.
Future deprecations:
* The "unpacked" and "control" methods from Lintian::Collect-classes
is also scheduled for deprecation. Though, it may be deferred to
after Lintian/2.5.28.
Example (old code):
use strict; use warnings; use autodie;
use Lintian::Util qw(is_ancestor_of);
my $file = ...;
my $droot = $info->debfiles
my $dfile = $info->debfiles($file);
if ( -f $dfile and is_ancestor_of($droot, $dfile)) {
open(my $fd, '<', $dfile);
...;
close($fd);
}
Example replacement:
use strict; use warnings; use autodie;
my $file = ...;
my $dfile = $info->index_resolved_path("debian/$file");
if ($dfile and $dfile->is_open_ok) {
my $fd = $dfile->open;
...;
close($fd);
}
Other notable new API methods in Lintian::Path for accessing
the file contents:
* file_contents (slurp the file, check with is_open_ok)
* fs_path (path to the underlying file, check with is_open_ok
before opening it or passing to a method or an external tool)
~Niels
[1]:
>From lintian4python_0.28.4_all.deb:
.../checks/python/depends.desc:Needs-Info: debfiles
.../checks/python/helpers.pm: if (-e $info->debfiles('pyversions')) {
.../checks/python/helpers.pm: if (-e $info->debfiles('pycompat')) {
.../checks/python/helpers.pm: my $rules = $info->debfiles('rules');
...checks/python/helpers.pm: my $droot = $info->debfiles;
.../checks/python/helpers.desc:Needs-Info: changelog-file, bin-pkg-control,
debfiles, unpacked
.../checks/python/watch.desc:Needs-Info: debfiles
.../checks/python/watch.pm: my $wfile = $info->debfiles('watch');
[2]
http://nthykier.wordpress.com/2014/09/27/lintian-upcoming-api-making-it-easier-to-write-correct-and-safe-code/
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]