SVN: toys/rsget.pl: Makefile RSGet/FileList.pm data data/mu_font_db.png mu_font_db.png rsget.pl
sparky
sparky at pld-linux.org
Thu Aug 27 18:33:03 CEST 2009
Author: sparky
Date: Thu Aug 27 18:33:03 2009
New Revision: 10500
Added:
toys/rsget.pl/Makefile
toys/rsget.pl/data/
toys/rsget.pl/data/mu_font_db.png
- copied unchanged from rev 10473, toys/rsget.pl/mu_font_db.png
Removed:
toys/rsget.pl/mu_font_db.png
Modified:
toys/rsget.pl/RSGet/FileList.pm
toys/rsget.pl/rsget.pl
Log:
- almost(?) prepared for release
Added: toys/rsget.pl/Makefile
==============================================================================
--- (empty file)
+++ toys/rsget.pl/Makefile Thu Aug 27 18:33:03 2009
@@ -0,0 +1,29 @@
+
+DATADIR = /usr/share/rsget.pl
+BINDIR = /usr/bin
+
+VER = $(shell sed '4!d' .svn/entries)
+PKGDIR = rsget.pl-$(VER)
+
+all:
+
+pkg:
+ rm -f {RSGet,Get,Link,data}/*~
+ install -d $(PKGDIR)/{RSGet,Get,Link,data}
+ install rsget.pl $(PKGDIR)
+ cp Makefile $(PKGDIR)
+ cp RSGet/*.pm $(PKGDIR)/RSGet
+ cp Get/* $(PKGDIR)/Get
+ cp Link/* $(PKGDIR)/Link
+ cp data/* $(PKGDIR)/data
+ tar -cjf $(PKGDIR).tar.bz2 $(PKGDIR)
+
+install:
+ rm -f {RSGet,Get,Link,data}/*~
+ install -d $(DESTDIR)$(DATADIR)/{RSGet,Get,Link,data} $(DESTDIR)$(BINDIR)
+ install rsget.pl $(DESTDIR)$(BINDIR)
+ cp RSGet/*.pm $(DESTDIR)$(DATADIR)/RSGet
+ cp Get/* $(DESTDIR)$(DATADIR)/Get
+ cp Link/* $(DESTDIR)$(DATADIR)/Link
+ cp data/* $(DESTDIR)$(DATADIR)/data
+
Modified: toys/rsget.pl/RSGet/FileList.pm
==============================================================================
--- toys/rsget.pl/RSGet/FileList.pm (original)
+++ toys/rsget.pl/RSGet/FileList.pm Thu Aug 27 18:33:03 2009
@@ -5,9 +5,19 @@
use URI::Escape;
use RSGet::Tools;
our $file = 'get.list';
+my $file_swp = '.get.list.swp';
our $reread = 1;
our %uri_options; # options to be saved
+sub set_file
+{
+ my $file = shift;
+ die "Can't read '$file'\n" unless -r $file;
+ p "Using '$file' file list\n";
+ my $make_swp = $settings{make_swp} || '.${file}.swp';
+ $file_swp = eval "\"$make_swp\"";
+ p "Using '$file_swp' as file lock\n";
+}
sub need_update
{
$reread = 1;
@@ -196,7 +206,7 @@
}
close $list;
- unless ( -e ".${file}.swp" ) {
+ unless ( -e $file_swp ) {
open my $newlist, '>', $file . ".tmp";
print $newlist @newlist;
print $newlist @added_text;
Modified: toys/rsget.pl/rsget.pl
==============================================================================
--- toys/rsget.pl/rsget.pl (original)
+++ toys/rsget.pl/rsget.pl Thu Aug 27 18:33:03 2009
@@ -24,14 +24,17 @@
my $http = undef;
while ( my $arg = shift @ARGV ) {
if ( $arg eq '-i' ) {
- RSGet::Dispatch::add_interface( shift @ARGV || die "argument missing" );
+ my $ifs = shift @ARGV || die "argument missing";
+ RSGet::Dispatch::add_interface( $ifs );
} elsif ( $arg eq '-s' ) {
require RSGet::MicroHTTP;
- $http = new RSGet::MicroHTTP( shift @ARGV || die "port missing" );
- p "HTTP server " . ( $http ? "started" : "failed" ) ;
+ my $port = shift @ARGV || die "port missing";
+ $http = new RSGet::MicroHTTP( $port );
+ p "HTTP server " . ( $http ? "started on port $port" : "failed" ) ;
} elsif ( $arg eq '-o' ) {
my $data = shift @ARGV;
my $o = eval "{ $data }";
+ die "Can't process settings: $@\n" if $@;
if ( $o and ref $o ) {
hadd \%settings, %$o;
}
@@ -39,8 +42,7 @@
$RSGet::FileList::file = $arg;
}
}
-p "Using '$RSGet::FileList::file' file list\n";
-die "Can't read the list\n" unless -r $RSGet::FileList::file;
+RSGet::FileList::set_file( $RSGet::FileList::file );
if ( keys %settings ) {
p "Settings:";
More information about the pld-cvs-commit
mailing list