use Cwd 'abs_path';
chdir "$FindBin::Bin/..";
-$ENV{TOPDIR}=getcwd();
+$ENV{TOPDIR} //= getcwd();
+chdir $ENV{TOPDIR};
$ENV{GIT_CONFIG_PARAMETERS}="'core.autocrlf=false'";
$ENV{GREP_OPTIONS}="";
return 0;
}
+# TODO: do_install_package etc. should deal with source packages rather
+# than binary packages
sub do_install_package($$) {
my $feed = shift;
my $pkg = shift;
- my $path = $pkg->{makefile};
+
+ my $path;
+ $pkg->{src} and $path = $pkg->{src}{makefile};
if($path) {
$path =~ s/\/Makefile$//;
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;
};
# install all dependencies referenced from the source package
- foreach my $vpkg (@{$feed_src->{$src}}) {
- foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) {
- next if $dep =~ /@/;
- $dep =~ s/^\+//;
- $dep =~ s/^.+://;
- $dep =~ s/\/.+$//;
- next unless $dep;
- install_package($feed, $dep, 0) == 0 or $ret = 1;
- }
+ foreach my $dep (
+ @{$feed_src->{$src}{builddepends}},
+ @{$feed_src->{$src}{"builddepends/host"}},
+ map { @{$_->{depends}} } @{$feed_src->{$src}{packages}}
+ ) {
+ next if $dep =~ /@/;
+ $dep =~ s/^\+//;
+ $dep =~ s/^.+://;
+ $dep =~ s/\/.+$//;
+ next unless $dep;
+ install_package($feed, $dep, 0) == 0 or $ret = 1;
}
return $ret;
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;