aboutsummaryrefslogtreecommitdiff
path: root/SBO-Lib/lib/SBO/Lib.pm
diff options
context:
space:
mode:
authorJacob Pipkin <j@dawnrazor.net>2012-11-04 08:53:47 -0600
committerJacob Pipkin <j@dawnrazor.net>2012-11-04 08:53:47 -0600
commitb34346c933cee1a01a3df854becffea2d6f6333b (patch)
tree2a0c6f261b94bbc95d55d58e85678fd93e4ea64e /SBO-Lib/lib/SBO/Lib.pm
parent35db9c2aaea8d7f7b211bc12609840ea2ef5ac64 (diff)
downloadsbotools2-b34346c933cee1a01a3df854becffea2d6f6333b.tar.xz
tee the running of the slackbuild instead of the tar and makepkg via editing the slackbuild
Diffstat (limited to 'SBO-Lib/lib/SBO/Lib.pm')
-rw-r--r--SBO-Lib/lib/SBO/Lib.pm15
1 files changed, 2 insertions, 13 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm
index 2eb996d..d3ba865 100644
--- a/SBO-Lib/lib/SBO/Lib.pm
+++ b/SBO-Lib/lib/SBO/Lib.pm
@@ -457,30 +457,19 @@ sub check_multilib () {
sub rewrite_slackbuild (%) {
my %args = (
SLACKBUILD => '',
- TEMPFN => '',
CHANGES => {},
@_
);
- unless ($args{SLACKBUILD} && $args{TEMPFN}) {
- script_error 'rewrite_slackbuild requires SLACKBUILD and TEMPFN.';
- }
+ $args{SLACKBUILD} or script_error 'rewrite_slackbuild requires SLACKBUILD.';
my $slackbuild = $args{SLACKBUILD};
my $changes = $args{CHANGES};
copy ($slackbuild, "$slackbuild.orig") or
die "Unable to backup $slackbuild to $slackbuild.orig\n";
- my $tar_regex = qr/(un|)tar .*$/;
- my $makepkg_regex = qr/makepkg/;
my $libdir_regex = qr/^\s*LIBDIRSUFFIX="64"\s*$/;
- my $make_regex = qr/^\s*make(| \Q||\E exit 1)$/;
my $arch_regex = qr/\$VERSION-\$ARCH-\$BUILD/;
# tie the slackbuild, because this is the easiest way to handle this.
tie my @sb_file, 'Tie::File', $slackbuild;
for my $line (@sb_file) {
- # get the output of the tar and makepkg commands. hope like hell that v
- # is specified among tar's arguments
- if ($line =~ $tar_regex || $line =~ $makepkg_regex) {
- $line = "$line | tee -a $args{TEMPFN}";
- }
# then check for and apply any other %$changes
if (exists $$changes{libdirsuffix}) {
$line =~ s/64/$$changes{libdirsuffix}/ if $line =~ $libdir_regex;
@@ -613,9 +602,9 @@ sub perform_sbo (%) {
$cmd .= " /bin/sh $location/$sbo.SlackBuild";
my $tempfh = tempfile (DIR => $tempdir);
my $fn = get_tmp_extfn $tempfh;
+ $cmd .= " | tee -a $fn";
rewrite_slackbuild (
SLACKBUILD => "$location/$sbo.SlackBuild",
- TEMPFN => $fn,
CHANGES => \%changes,
);
chdir $location, my $out = system $cmd;