prt-auf: fixed parsing of dependency line when maintainer uses commas instead of spaces

This commit is contained in:
John McQuah 2022-06-17 14:59:37 -04:00
parent 608860f62c
commit 82c2bd8769

View File

@ -353,7 +353,7 @@ sub fill_hashes_from_cache {
$deps = <$cf>; $deps = <$cf>;
chomp($deps, $DESC{$p}, $V_REPO{$p}); chomp($deps, $DESC{$p}, $V_REPO{$p});
$DEPENDS{$p} = ($deps ne "") ? $deps : " "; $DEPENDS{$p} = ($deps ne "") ? $deps : " ";
$DEPENDS{$p} =~ s/,/ /g; $DEPENDS{$p} =~ s/, / /g; $DEPENDS{$p} =~ s/,/ /g;
for (my $i=6; $i<13; $i++) { $ignored = <$cf>; } for (my $i=6; $i<13; $i++) { $ignored = <$cf>; }
} }
close ($cf); close ($cf);
@ -366,7 +366,7 @@ sub fill_hashes_from_pkgfiles {
my ($rver, $rrel, $rdesc, $rdeps) = get_pkgfile_fields($pp); my ($rver, $rrel, $rdesc, $rdeps) = get_pkgfile_fields($pp);
$V_REPO{$p} = ($rver) ? $rver : "0"; $V_REPO{$p} = ($rver) ? $rver : "0";
$DEPENDS{$p} = ($rdeps) ? $rdeps : ""; $DEPENDS{$p} = ($rdeps) ? $rdeps : "";
$DEPENDS{$p} =~ s/,/ /g; $DEPENDS{$p} =~ s/, / /g; $DEPENDS{$p} =~ s/,/ /g;
$DESC{$p} = ($rdesc) ? $rdesc : ""; $DESC{$p} = ($rdesc) ? $rdesc : "";
} }
} }
@ -395,6 +395,7 @@ sub get_pkgfile_fields {
else {} else {}
} close(PF); } close(PF);
$Dependencies =~ s/, / /g; $Dependencies =~ s/,/ /g;
if (shift) { if (shift) {
return $Name, $portpath, $Version, $Release, $descrip, $Dependencies, $url, return $Name, $portpath, $Version, $Release, $descrip, $Dependencies, $url,
$packager, $maintainer, $readme, $preInstall, $postInstall; $packager, $maintainer, $readme, $preInstall, $postInstall;
@ -693,10 +694,10 @@ sub up_inst { # returns scalar references to five arrays
if (who_aliased_to($t)) { if (who_aliased_to($t)) {
$mkcmd{$t} = "echo \"skipped build ($t provided by an alias)\""; $mkcmd{$t} = "echo \"skipped build ($t provided by an alias)\"";
} else { } else {
$mkcmd{$t} = "" if ((port_diff("utd",$t)==0) and !($WANTED{$t}));
$mkcmd{$t} = "" if (($V_INST{$t}) and ($type =~ /^(install|depinst)$/) and ($opkg{$t} !~ /-f/));
$mkcmd{$t} = "echo \"skipped build ($t up to date)\"" if ((-f $builtpkg{$t}) and $mkcmd{$t} = "echo \"skipped build ($t up to date)\"" if ((-f $builtpkg{$t}) and
((-M $builtpkg{$t}) < (-M "$pdirs{$t}/Pkgfile")) and ($opkg{$t} !~ /-f/)); ((-M $builtpkg{$t}) < (-M "$pdirs{$t}/Pkgfile")) and ($opkg{$t} !~ /-f/));
$mkcmd{$t} = "" if ((port_diff("utd",$t)==0) and !($WANTED{$t}));
$mkcmd{$t} = "" if (($V_INST{$t}) and ($type =~ /^(install|depinst)$/) and ($opkg{$t} !~ /-f/));
} }
if ($mkcmd{$t}) { if ($mkcmd{$t}) {
@ -712,7 +713,7 @@ sub up_inst { # returns scalar references to five arrays
$addcmd{$t} =~ s/ -u / / if (port_diff("utd",$t)<0); $addcmd{$t} =~ s/ -u / / if (port_diff("utd",$t)<0);
($opkg{test} eq "no") ? system("$addcmd{$t}") : print "$addcmd{$t}\n"; ($opkg{test} eq "no") ? system("$addcmd{$t}") : print "$addcmd{$t}\n";
$status{$t} .= ( $?>>8 == 0 ) ? "pkgadd ok. " : "pkgadd failed. "; $status{$t} .= ( $?>>8 == 0 ) ? "pkgadd ok. " : "pkgadd failed. ";
unlink($logfile{$t}) if ((-f $logfile{$t}) and ($olog{rm_on_success} eq "yes")); unlink($logfile{$t}) if (($logfile{$t}) and ($olog{rm_on_success} eq "yes"));
} }
if (($status{$t} =~ /pkgadd ok/) and (-f "$pdirs{$t}/post-install") if (($status{$t} =~ /pkgadd ok/) and (-f "$pdirs{$t}/post-install")
and ($opkg{runscripts} eq "yes")) { and ($opkg{runscripts} eq "yes")) {
@ -775,8 +776,8 @@ sub port_edit {
my $EDITOR = ($ENV{EDITOR}) ? $ENV{EDITOR} : "/usr/bin/vi"; my $EDITOR = ($ENV{EDITOR}) ? $ENV{EDITOR} : "/usr/bin/vi";
if ($type eq "readme") { if ($type eq "readme") {
port_edit("cat",$pp,"README") if (-f "$pp/README"); port_edit("cat",$port,"README") if (-f "$pp/README");
port_edit("cat",$pp,"README.md") if (-f "$pp/README.md"); port_edit("cat",$port,"README.md") if (-f "$pp/README.md");
} }
if ($type eq "edit") { if ($type eq "edit") {