#!/usr/bin/env perl # # vim: set ts=4:noet # # sboinstall # script to install a SlackBuild by name # # authors: Jacob Pipkin # Luke Williams # license: WTFPL use 5.16.0; use strict; use warnings FATAL => 'all'; use SBO::Lib; use Getopt::Long qw(:config bundling); use File::Basename; my $self = basename($0); sub show_usage() { print < \$help, 'version|v' => \$vers, 'noclean|c=s' => \$noclean, 'distclean|d=s' => \$distclean, 'noinstall|i' => \$no_install, 'jobs|j=s' => \$jobs, 'compat32|p' => \$compat32, 'nointeractive|r' => \$non_int, 'norequirements|R' => \$no_reqs, ); show_usage and exit 0 if $help; show_version and exit 0 if $vers; show_usage and exit 0 unless exists $ARGV[0]; $noclean = $noclean eq 'TRUE' ? 1 : 0; $distclean = $distclean eq 'TRUE' ? 1 : 0; # setup any options unshift @ARGV, $noclean ? '-cTRUE' : '-cFALSE'; unshift @ARGV, $distclean ? '-dTRUE' : '-dFALSE'; unshift @ARGV, '-i' if $no_install; unshift @ARGV, '-p' if $compat32; unshift @ARGV, '-r' if $non_int; unshift @ARGV, '-R' if $no_reqs; unshift @ARGV, "-j$jobs" if $jobs; system '/usr/sbin/sboupgrade', '-oN', @ARGV; exit 0;