prt-auf: do not allow subsequent dups to redefine the hashes for version, description, dependencies

This commit is contained in:
John McQuah 2022-09-26 11:52:08 -04:00
parent 519d085a4b
commit 2babaeacda

View File

@ -247,9 +247,9 @@ sub parse_prt_conf {
}
}
$opkg{runscripts} = $1 if /^runscripts\s+(yes|no)/;
$opkg{makecommand} = $1 if /^makecommand\s+(.*)#/;
$opkg{addcommand} = $1 if /^addcommand\s+(.*)#/;
$opkg{removecommand} = $1 if /^removecommand\s+(.*)#/;
$opkg{makecommand} = $1 if /^makecommand\s+(.*)(#|$)/;
$opkg{addcommand} = $1 if /^addcommand\s+(.*)(#|$)/;
$opkg{removecommand} = $1 if /^removecommand\s+(.*)(#|$)/;
$olog{write} = $1 if /^writelog\s+(enabled|disabled)/;
$olog{mode} = $1 if /^logmode\s+(append|overwrite)/;
$olog{rm_on_success} = $1 if /^rmlog_on_success\s+(no|yes)/;
@ -364,12 +364,14 @@ sub fill_hashes_from_pkgfiles {
foreach my $pp (@allports) {
my $p = (split /\//, $pp)[-1];
my ($rver, $rrel, $rdesc, $rdeps) = get_pkgfile_fields($pp);
$V_REPO{$p} = ($rver) ? $rver : "0";
$V_REPO{$p} .= ($rrel) ? "-$rrel" : "-1";
$DEPENDS{$p} = ($rdeps) ? $rdeps : "";
$DEPENDS{$p} =~ s/, / /g; $DEPENDS{$p} =~ s/,/ /g;
$DESC{$p} = ($rdesc) ? $rdesc : "";
if (! $V_REPO{$p}) { # only populate hashes with the first port found
my ($rver, $rrel, $rdesc, $rdeps) = get_pkgfile_fields($pp);
$V_REPO{$p} = ($rver) ? $rver : "0";
$V_REPO{$p} .= ($rrel) ? "-$rrel" : "-1";
$DEPENDS{$p} = ($rdeps) ? $rdeps : "";
$DEPENDS{$p} =~ s/, / /g; $DEPENDS{$p} =~ s/,/ /g;
$DESC{$p} = ($rdesc) ? $rdesc : "";
}
}
}