diff options
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 24 | ||||
-rwxr-xr-x | sboinstall | 5 | ||||
-rwxr-xr-x | sboupgrade | 5 |
3 files changed, 22 insertions, 12 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index bb6ca3c..8d9c418 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -425,6 +425,8 @@ sub rewrite_slackbuild { my ($slackbuild,%changes) = @_; copy ($slackbuild,"$slackbuild.orig"); my $libdir_regex = qr/^\s*LIBDIRSUFFIX="64"\s*$/; + my $make_regex = qr/^\s*make(| \Q||\E exit 1)$/; + my $arch_out_regex = qr/\$VERSION-\$ARCH-\$BUILD/; tie my @sb_file,'Tie::File',$slackbuild; FIRST: for my $line (@sb_file) { SECOND: while (my ($key,$value) = each %changes) { @@ -433,8 +435,13 @@ sub rewrite_slackbuild { $line =~ s/64/$value/; } } + if ($key eq 'make') { + if ($line =~ $make_regex) { + $line =~ s/make/make $value/; + } + } if ($key eq 'arch_out') { - if (index ($line,'makepkg') != -1) { + if ($line =~ $arch_out_regex) { $line =~ s/\$ARCH/$value/; } } @@ -485,20 +492,23 @@ sub prep_sbo_file { sub perform_sbo { script_error ('perform_sbo requires five arguments') unless exists $_[4]; - my ($sbo,$location,$arch,$c32,$x32) = @_; + my ($jobs,$sbo,$location,$arch,$c32,$x32) = @_; my $cmd; + my %changes; + unless ($jobs eq 'FALSE') { + $changes{make} = "-j $jobs"; + } if ($arch eq 'x86_64' and ($c32 || $x32) ) { - my %changes; if ($c32) { - %changes = (libdirsuffix => ''); + $changes{libdirsuffix} = ''; } elsif ($x32) { - %changes = (arch_out => 'i486'); + $changes{arch_out} = 'i486'; } - rewrite_slackbuild ("$location/$sbo.SlackBuild",%changes); $cmd = ". /etc/profile.d/32dev.sh && $location/$sbo.SlackBuild"; } else { $cmd = "$location/$sbo.SlackBuild"; } + rewrite_slackbuild ("$location/$sbo.SlackBuild",%changes) if %changes; my $out = system ($cmd); revert_slackbuild ("$location/$sbo.SlackBuild"); die unless $out == 0; @@ -565,7 +575,7 @@ to be setup for multilib.\n"; } my @symlinks = create_symlinks ($location,@downloads); prep_sbo_file ($sbo,$location); - perform_sbo ($sbo,$location,$arch,0,$x32); + perform_sbo ($jobs,$sbo,$location,$arch,0,$x32); return @symlinks; } @@ -25,6 +25,7 @@ Options: -c: do not clean working files/directories after the build. -d: clean distfiles afterward. -i: do not run installpkg at the end of the build process. + -j: specify "-j" setting to make, for SMP systems; overrides conf file. -p: install an SBo as a -compat32 pkg on a multilib x86_64 system. -r: skip viewing of the SBo README. @@ -32,14 +33,14 @@ EOF } my %options; -getopts ('hvcdrip',\%options); +getopts ('hvcdripj:',\%options); show_usage () and exit(0) if exists $options{h}; show_version () and exit(0) if exists $options{v}; show_usage () and exit (0) unless exists $ARGV[0]; -my @opts = ('c','d','r','i','p'); +my @opts = ('c','d','r','i','p','j'); for my $opt (@opts) { unshift (@ARGV,"-$opt") if exists $options{$opt}; } @@ -29,6 +29,7 @@ Options: -d: clean distfiles afterward. -f: force an update, even if the "upgrade" version is the same or lower. -i: do not run installpkg at the end of the build process. + -j: specify "-j" setting to make, for SMP systems; overrides conf file. -N: install any new SBo's listed. -r: skip viewing of the SBo README. @@ -37,7 +38,6 @@ Example: $self -ca EOF -# -j: specify "-j" setting to make, for SMP systems; overrides conf file. } my %options; @@ -49,8 +49,7 @@ show_version () && exit (0) if exists $options{v}; my $noclean = exists $options{c} ? 'FALSE' : $config{NOCLEAN}; my $distclean = exists $options{d} ? 'TRUE' : $config{DISTCLEAN}; my $force = exists $options{f} ? 'TRUE' : 'FALSE'; -#my $jobs = exists $options{j} ? $options{j} : $config{JOBS}; -my $jobs = 'FALSE'; +my $jobs = exists $options{j} ? $options{j} : $config{JOBS}; my $install_new = exists $options{N} ? 'TRUE' : 'FALSE'; my $no_readme = exists $options{r} ? 'TRUE' : 'FALSE'; my $no_install = exists $options{i} ? 'TRUE' : 'FALSE'; |