aboutsummaryrefslogtreecommitdiff
path: root/sboinstall
blob: 69bf273697c7c44405368594107301ea5ef0a2cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env perl
#
# sboinstall
# script to install a SlackBuild by name
#
# author: Jacob Pipkin <j@dawnrazor.net>
# date: Pungenday, the 40th day of Discord in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>

use SBO::Lib;
use Getopt::Std;
use File::Basename;
use strict;
use warnings FATAL => 'all';

my $self = basename ($0);

sub show_usage {
	print <<EOF
Usage: $self [options] sbo

Options:
  -h: this screen.
  -v: version information.
  -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 multicore 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.

EOF
}

my %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 @opts1 = ('c','d','r','i','p');
for my $opt (@opts1) {
	unshift (@ARGV,"-$opt") if exists $options{$opt};
}

my @opts2 = ('j');
for my $opt (@opts2) {
	unshift (@ARGV,"-$opt $options{$opt}") if exists $options{$opt};
}

my $string = '';
for my $arg (@ARGV) {
	$string .= " $arg";
}

system ("/usr/sbin/sboupgrade -oN $string");
exit 0;