#!/usr/bin/perl # # vim: set ts=4:noet # # sbosnap # script to pull down / update a local copy of the slackbuilds.org tree. # # authors: Jacob Pipkin # Luke Williams # Andreas Guldstrand # license: WTFPL use 5.16.0; use strict; use warnings FATAL => 'all'; use SBO::Lib qw/ fetch_tree update_tree %config /; use File::Basename; use Getopt::Long; my $sbo_home = $config{SBO_HOME}; my $self = basename($0); sub show_usage { print < \$help, 'version|v' => \$vers); show_usage() and exit 0 if $help; show_version() and exit 0 if $vers; # check for a command and, if found, execute it my $command; if ($ARGV[0] =~ /fetch|update/) { $command = $ARGV[0]; } else { show_usage() and exit 1; } if ($command eq 'fetch') { fetch_tree() } elsif ($command eq 'update') { update_tree() } exit 0;