| 1 |
Description: Fix debci by altering available_models |
| 2 |
Quoting Niko, Config::Model::Lister::available_models() argument needs |
| 3 |
to be different when running under autopkgtest to force looking in @INC |
| 4 |
instead of lib/. Basing it on the AUTOPKGTEST_TMP environment variable is probably |
| 5 |
the best choice. |
| 6 |
. |
| 7 |
So @INC is used when AUTOPKGTEST_TMP is true-ish. Its value is not verified. |
| 8 |
Bug-Debian: https://bugs.debian.org/785528 |
| 9 |
Forwarded: NA |
| 10 |
Author: dod |
| 11 |
--- a/lib/Config/Model/Lister.pm |
| 12 |
+++ b/lib/Config/Model/Lister.pm |
| 13 |
@@ -16,7 +16,7 @@ |
| 14 |
sub available_models ($test = 0) { |
| 15 |
my ( %categories, %appli_info, %applications ); |
| 16 |
my %done_cat; |
| 17 |
|
| 18 |
+ my @dir_to_scan = ( $ENV{AUTOPKGTEST_TMP} or not $test ) ? @INC : qw/lib/; |
| 19 |
|
| 20 |
foreach my $dir ( map { glob("$_/Config/Model/*.d") } @dir_to_scan ) { |
| 21 |
my ($cat) = ( $dir =~ m!.*/([\w\-]+)\.d! ); |