aboutsummaryrefslogtreecommitdiff
path: root/sboinstall
blob: ae63adb2e5ed328d7c1e5712bd852c947841ed63 (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
#!/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. 
  -r: skip viewing of the SBo README.
  -i: do not run installpkg at the end of the build process.

EOF
}

my %options;
getopts ('hvcdri',\%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];

unshift (@ARGV,'-c') if exists $options{c};
unshift (@ARGV,'-d') if exists $options{d};
unshift (@ARGV,'-r') if exists $options{r};
unshift (@ARGV,'-i') if exists $options{i};

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

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