Skip to content

Commit

Permalink
Bug 61: Fix duplicated dependencies (undefine loop variables and matc…
Browse files Browse the repository at this point in the history
…h packages with names in uppercase)
  • Loading branch information
gdsotirov committed Sep 8, 2019
1 parent f531c82 commit e330e4c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions db/scripts/load-deps.pl
Expand Up @@ -69,15 +69,19 @@ sub register_deps {

my @lines = split(/\n/, $out);
foreach my $ln (@lines) {
$dep_name = undef;
$dep_sign = undef;
$dep_ver = undef;
# only package name
if ( $ln =~ /^([a-z_+\-0-9]+)$/ ) {
if ( $ln =~ /^([a-zA-Z_+\-0-9]+)$/ ) {
$dep_name = $1;
} # with sign and version
elsif ( $ln =~ /^([a-z_+\-0-9]+)\s*([><=]+)\s*(.+)$/ ) {
elsif ( $ln =~ /^([a-zA-Z_+\-0-9]+)\s*([><=]+)\s*(.+)$/ ) {
$dep_name = $1;
$dep_sign = $2;
$dep_ver = $3;
}
# TODO: Alternativies?

if ( $dep_name ) {
$sth->execute($pkg->{id}, $type, $dep_name, $dep_sign, $dep_ver);
Expand Down

0 comments on commit e330e4c

Please sign in to comment.