aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Pipkin <d4wnr4z0r@yahoo.com>2012-05-28 12:59:52 -0500
committerJacob Pipkin <d4wnr4z0r@yahoo.com>2012-05-28 12:59:52 -0500
commit8acd43fa1224cb3a1177d3ae87320d2f3f24fb81 (patch)
treec936c5a3844f658bf2e8f52e501d2ba15911aa86
parentfabd847c24098e84922467ad72dddea5f9f68e16 (diff)
downloadsbotools2-8acd43fa1224cb3a1177d3ae87320d2f3f24fb81.tar.xz
fix bug where grok_readme didn't return if no reqs were found, fix bug where grok_readme looked for not -compat32 packages when looking for installed deps of a compat32 sbo, make grok_readme call sboupgrade -oN directly instead of sboinstall
-rwxr-xr-xsboupgrade13
1 files changed, 8 insertions, 5 deletions
diff --git a/sboupgrade b/sboupgrade
index 81caf6b..57557e2 100755
--- a/sboupgrade
+++ b/sboupgrade
@@ -94,6 +94,7 @@ sub grok_readme {
$readme =~ s/\n//g;
my $string = $3 if $readme =~
/([Tt]his|$sbo|)\s+[Rr]equires(|:)\s+([^\.]+)/;
+ return unless defined $string;
# remove anything in brackets or parens
$string =~ s/\[[^\]]+\]//g;
$string =~ s/\([^\)]+\)//g;
@@ -114,7 +115,8 @@ sub grok_readme {
my @have;
FIRST: for my $dep (@deps) {
SECOND: for my $key (keys @installed) {
- if ($dep eq $installed[$key]{name}) {
+ my $tempname = $compat32 eq 'TRUE' ? "$dep-compat32" : $dep;
+ if ($tempname eq $installed[$key]{name}) {
push (@have, $dep);
last SECOND;
}
@@ -127,18 +129,19 @@ sub grok_readme {
# compared against installed slackbuilds again, since we're recursive
# and may have installed the requirement in question as a requirement
# of an earlier requirement, etc
+ my $tempname = $compat32 eq 'TRUE' ? "$need-compat32" : $need;
my @inst = get_installed_sbos ();
SECOND: for my $key (keys @inst) {
- next FIRST if $need eq $inst[$key]{name};
+ next FIRST if $tempname eq $inst[$key]{name};
}
print "\n". $readme_orig;
- print "\nIt looks this slackbuild requires $need; shall I attempt to ";
+ print "\nIt looks this slackbuild requires $tempname; shall I attempt to ";
print "install it first? [y] ";
my $test = <STDIN>;
$test = 'y' if $test eq "\n";
if ($test =~ /^[Yy]/) {
- my $cmd = "/usr/sbin/sboinstall";
- my @args;
+ my $cmd = "/usr/sbin/sboupgrade";
+ my @args = ('-oN');
# populate args so that they carry over correctly
push (@args, "-c") if exists $options{c};
push (@args, "-d") if exists $options{d};