X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bin%2Fdebbugs-loadsql;h=8222bbdfef026e014706824798099e6e17c0142e;hb=edcc5af87bab7f8fb7888c50a2a9d223f9f0124b;hp=56c4f912562f38a759d17f60e73785ef3f5bbf23;hpb=4c3eca26cf5d3f8173ff55181a532c5b5f5c0bd9;p=debbugs.git diff --git a/bin/debbugs-loadsql b/bin/debbugs-loadsql index 56c4f91..8222bbd 100755 --- a/bin/debbugs-loadsql +++ b/bin/debbugs-loadsql @@ -131,8 +131,16 @@ Display this manual. use vars qw($DEBUG); +# if we're running out of git, we want to use the git base directory as the +# first INC directory. If you're not running out of git, or someone has given a +# non-absolute INC, don't do that. +use FindBin; +use if (-d $FindBin::Bin.'/../.git/' && $INC[0] =~ m#^/#), + lib => $FindBin::Bin.'/../'; + use Debbugs::Common (qw(checkpid lockpid get_hashname getparsedaddrs), qw(getbugcomponent make_list getsourcemaintainers), + qw(getbuglocation), qw(walk_bugs), qw(hash_slice open_compressed_file),); use Debbugs::Config qw(:config); @@ -158,7 +166,7 @@ my %options = verbose => 0, quiet => 0, quick => 0, - service => $config{debbugs_db}, + service => $config{database}, progress => 0, ); @@ -354,7 +362,7 @@ sub add_versions { if (not defined $src_pkgs{$versions[$i][0]}) { $src_pkgs{$versions[$i][0]} = $s->resultset('SrcPkg')-> - get_src_pkg_id($versions[$i][0]); + get_or_create_src_pkg_id($versions[$i][0]); } $sp = $src_pkgs{$versions[$i][0]}; # There's probably something wrong if the source package @@ -430,12 +438,13 @@ FILE: for my $file (@v) { not defined $srcver or not defined $binname or not defined $binver or + not defined $binarch or $srcname !~ /^$config{package_name_re}$/o or $binname !~ /^$config{package_name_re}$/o or $srcver !~ /^$config{package_version_re}$/o or $binver !~ /^$config{package_version_re}$/o ) { - print STDERR "malformed debinfo: $file\n"; + print STDERR "malformed debinfo: $file\n$_\n"; next FILE; } push @file_debinfos,