diff --git a/scripts/pkg-get.pl b/scripts/pkg-get.pl index 64ea2a8..2b19e10 100755 --- a/scripts/pkg-get.pl +++ b/scripts/pkg-get.pl @@ -13,6 +13,7 @@ use warnings; use strict; use Getopt::Long; use Digest::file qw(digest_file_hex); +use File::Path; my $VERSION = "0.4.8"; my $CFGFILE = "/etc/pkg-get.conf"; @@ -442,7 +443,7 @@ sub doscript { ($pkg{$when . "_install"} eq "yes") or return; my $cmd = ($root) ? "chroot $root " : ""; $cmd .= "/bin/bash $pkg{'path'}/PKGINST $pkg{'name'} $when"; - if (system($cmd) == 0) { + if ((-e "$root$pkg{'path'}/PKGINST") and (system($cmd) == 0)) { $pptasks{$pkg{'name'}} .= " [$when: ok]"; } else { $pptasks{$pkg{'name'}} .= " [$when: failed]"; @@ -815,8 +816,9 @@ sub upinst { if ($root) { foreach my $repo(@repos) { my ($dir, $url) = split(/\|/, $repo); + ( -e "$root$dir" ) or make_path("$root$dir"); + ( -d "$root$dir" ) or next; open(my $host, "$dir/PKGINST") or next; - ( -d "$root$dir" ) or mkdir("$root$dir",0755); open(my $mount, ">$root$dir/PKGINST"); while (<$host>) { print $mount $_; } close($mount);