aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/metadata.pm
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-01-08 12:17:30 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-01-13 19:54:44 +0100
commit47d6b05ad328e80e4ee05e48aa95462f3518c014 (patch)
treec1caa85b174473b25be2f5889cf4857529f13caf /scripts/metadata.pm
parent565de8b8a8b3532d07abba7a083763ac31ca28ee (diff)
downloadupstream-47d6b05ad328e80e4ee05e48aa95462f3518c014.tar.gz
upstream-47d6b05ad328e80e4ee05e48aa95462f3518c014.tar.bz2
upstream-47d6b05ad328e80e4ee05e48aa95462f3518c014.zip
metadata: always resolve dependencies through provides list
Instead of adding virtual packages to the normal package list, keep a separate list for provides, make each package provide itself, and resolve all dependencies through this list. This allows to use PROVIDES to replace existing packages. Fixes FS#837. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Diffstat (limited to 'scripts/metadata.pm')
-rw-r--r--scripts/metadata.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 5d829ebbcd..7c82cec809 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -2,9 +2,10 @@ package metadata;
use base 'Exporter';
use strict;
use warnings;
-our @EXPORT = qw(%package %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
+our @EXPORT = qw(%package %vpackage %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
our %package;
+our %vpackage;
our %srcpackage;
our %category;
our %features;
@@ -177,6 +178,7 @@ sub parse_target_metadata($) {
sub clear_packages() {
%package = ();
+ %vpackage = ();
%srcpackage = ();
%category = ();
%features = ();
@@ -230,6 +232,9 @@ sub parse_package_metadata($) {
$pkg->{override} = $override;
$package{$1} = $pkg;
push @{$src->{packages}}, $pkg;
+
+ $vpackage{$1} or $vpackage{$1} = [];
+ unshift @{$vpackage{$1}}, $pkg;
};
/^Feature:\s*(.+?)\s*$/ and do {
undef $pkg;
@@ -264,12 +269,8 @@ sub parse_package_metadata($) {
/^Provides: \s*(.+)\s*$/ and do {
my @vpkg = split /\s+/, $1;
foreach my $vpkg (@vpkg) {
- $package{$vpkg} or $package{$vpkg} = {
- name => $vpkg,
- vdepends => [],
- src => $src,
- };
- push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
+ $vpackage{$vpkg} or $vpackage{$vpkg} = [];
+ push @{$vpackage{$vpkg}}, $pkg;
}
};
/^Menu-Depends: \s*(.+)\s*$/ and $pkg->{mdepends} = [ split /\s+/, $1 ];