Skip to content

Commit

Permalink
* Ok, so I didn't really do a good job with the last version. This still
Browse files Browse the repository at this point in the history
  isn't quite ready for Debianization, but it's good enough to be run
  manually from the command line.
* Added -v option to show current version and exit (updated TODO).
* Changed the order the option parsing code. For some reason I had written
  the config-file parsing to execute PRIOR to parsing the command line
  options, even though some of the options would cause the program to exit
  immediately... go figure.

git-svn-id: file:///var/lib/svn/sidmirror/trunk@8 a5708ca9-3ca5-466d-bfd8-a0b0b83e70ac
  • Loading branch information
demonbane committed Oct 23, 2007
1 parent 5dda194 commit dea3319
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 30 deletions.
6 changes: 3 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* document the static-includes bit
* document the static-includes bit (or maybe just move it into the config file?)
* document in general. A man page would be good.
* provide a Makefile to handle installation
* optimize the damn search code... that's been bugging me for YEARS...
* add a -v option to use $version for something...
* optimize the damned search code... that's been bugging me for YEARS...
* fix up the Debian bits to make it into a USABLE package
17 changes: 15 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
sidmirror (0.11-1) UNRELEASED; urgency=low
sidmirror (0.11-2) unstable; urgency=low

* Ok, so I didn't really do a good job with the last version. This still
isn't quite ready for Debianization, but it's good enough to be run
manually from the command line.
* Added -v option to show current version and exit (updated TODO).
* Changed the order the option parsing code. For some reason I had written
the config-file parsing to execute PRIOR to parsing the command line
options, even though some of the options would cause the program to exit
immediately... go figure.

-- Alex Malinovich <demonbane@the-love-shack.net> Tue, 23 Oct 2007 13:03:11 -0700

sidmirror (0.11-1) unstable; urgency=low

* Initial setup of Debian package. Still have a few kinks to work out, but
this will do for now.
Expand All @@ -23,4 +36,4 @@ sidmirror (0.11-1) UNRELEASED; urgency=low
immediately.
* Added new debian files to SVN.

-- Alex Malinovich <demonbane@the-love-shack.net> Tue, 23 Oct 2007 12:55:29 -0700
-- Alex Malinovich <demonbane@the-love-shack.net> Tue, 23 Oct 2007 13:03:03 -0700
54 changes: 29 additions & 25 deletions sidmirror.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,35 @@
use Fcntl;
use Config::File;

$autorun = 0;
$force = 0;

while (@ARGV) {
my $option = shift (@ARGV);
if ($option eq "--help" || $option eq "-h") {
print "Usage: sidmirror [OPTION]\n";
print "Update local Debian Sid mirror.\n\n";
print " -h, --help display this screen and exit\n";
print " -a, --auto run in automated mode; no user intervention required\n";
print " -f, --force ignore lockfile and run anyway (DANGEROUS!)\n";
print " -v, --version display version and exit\n\n";
exit 0;
}elsif ($option eq "-a" || $option eq "--auto") {
$autorun = 1;
}elsif ($option eq "-f" || $option eq "--force") {
$force = 1;
}elsif ($option eq "-v" || $option eq "--version") {
print "sidmirror $version\n";
exit 0;
}elsif ($option =~ /^\w/) {
$server = $option;
}else {
print STDERR "sidmirror: invalid option -- $option\n";
print STDERR "Try \`sidmirror --help\' for more information.\n";
exit 1;
}
}

if (-e "/etc/sidmirror.conf") {
my $config_hash = Config::File::read_config_file("/etc/sidmirror.conf");

Expand Down Expand Up @@ -77,31 +106,6 @@
exit 0;
}

$autorun = 0;
$force = 0;

while (@ARGV) {
my $option = shift (@ARGV);
if ($option eq "--help" || $option eq "-h") {
print "Usage: sidmirror [OPTION]\n";
print "Update local Debian Sid mirror.\n\n";
print " -h, --help display this screen and exit\n";
print " -a, --auto run in automated mode; no user intervention required\n";
print " -f, --force ignore lockfile and run anyway (DANGEROUS!)\n\n";
exit 0;
}elsif ($option eq "-a" || $option eq "--auto") {
$autorun = 1;
}elsif ($option eq "-f" || $option eq "--force") {
$force = 1;
}elsif ($option =~ /^\w/) {
$server = $option;
}else {
print STDERR "sidmirror: invalid option -- $option\n";
print STDERR "Try \`sidmirror --help\' for more information.\n";
exit 1;
}
}

chdir $installpath || die ("Unable to enter InstallPath!\n");

###############################################################
Expand Down

0 comments on commit dea3319

Please sign in to comment.