metadata: change pkg->{src} field to hold a reference

We often want to access fields of a source packages through pkg->{src}.
Allow accessing them directly instead of resolving the source hash through
srcpackages.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
This commit is contained in:
Matthias Schiffer
2018-01-06 18:01:25 +01:00
parent 47f292ff78
commit 504cb913eb
3 changed files with 34 additions and 35 deletions

View File

@@ -494,7 +494,7 @@ sub install_package {
warn "WARNING: Package '$name' is not available in feed $feed->[1].\n";
return 0;
};
my $src = $pkg->{src};
my $src = $pkg->{src}{name};
my $type = $feed->[0];
$src or $src = $name;
@@ -663,7 +663,7 @@ sub uninstall {
warn "WARNING: $name not installed\n";
next;
};
$pkg->{src} and $name = $pkg->{src};
$pkg->{src} and $name = $pkg->{src}{name};
warn "Uninstalling package '$name'\n";
system("rm -f ./package/feeds/*/$name");
$uninstall = 1;