[Pkg-xfce-commits] r83 - scripts

Emanuele Rocca ema@costa.debian.org
Tue, 03 May 2005 19:49:46 +0000


Author: ema
Date: 2005-05-03 19:49:46 +0000 (Tue, 03 May 2005)
New Revision: 83

Modified:
   scripts/get-goodies.pl
   scripts/goodies-sources.txt
Log:
get-goodies.pl:
- Rename the original tarball if there are discrepancies with our name
- Added 'debug' switch

goodies-sources.txt:
- s/xterminal/xfce4-terminal


Modified: scripts/get-goodies.pl
===================================================================
--- scripts/get-goodies.pl	2005-05-02 17:19:05 UTC (rev 82)
+++ scripts/get-goodies.pl	2005-05-03 19:49:46 UTC (rev 83)
@@ -2,11 +2,17 @@
 # Copyright (C) 2005 Emanuele Rocca <ema@debian.org>
 # This code is released under the terms of the GNU GPL
 #
-# vim:textwidth=0 background=light
+# vim:textwidth=0 
 
 use strict;
+use warnings;
 use File::Basename;
 
+my $debug = 0;
+if ($debug) {
+	print "WARNING: Debug mode. Change the \$debug variable to 0 if you want to really do something.\n";
+}
+
 my $debian_dirs = "../goodies";
 my $tarballs_dir = "$debian_dirs/tarballs";
 my $sources_file = "goodies-sources.txt";
@@ -24,9 +30,20 @@
 	! -d "$debian_dirs/$pkg" and next;
 	my $wget_command = "";
 	my $filename = basename($tarball);
+	
+	$filename =~ /(.*)-/;
+	my $orig_tarball_name = $1;
+
 	my $debian_filename = $filename;
 	$debian_filename =~ s/-(\d)/_$1/;
 
+	# if the original tarball name is different from our package name, it is necessary to rename it
+	# TODO We should also change the directory name
+	if($orig_tarball_name !~ $pkg) {
+		print "The original tarball name ($orig_tarball_name) doesn't match the Debian one ($pkg)\n";
+		$debian_filename =~ s/^\w*_/${pkg}_/;
+	}
+	
 	if($filename !~ /tar\.gz/) {
 		# assuming bzip2
 		my $decompressed_filename = $filename;
@@ -46,7 +63,7 @@
 	# wget & stuff
 	if ( ! -f "$tarballs_dir/$debian_filename" ) { 
 			print "Trying the following command:\n$wget_command\n";
-			system($wget_command);
+			system($wget_command) if not $debug;
 	}
 	else { print $pkg."'s tarball already present. Skipping\n"; }
 }

Modified: scripts/goodies-sources.txt
===================================================================
--- scripts/goodies-sources.txt	2005-05-02 17:19:05 UTC (rev 82)
+++ scripts/goodies-sources.txt	2005-05-03 19:49:46 UTC (rev 83)
@@ -20,6 +20,6 @@
 xfce4-xkb-plugin http://download.berlios.de/xfce-goodies/xfce4-xkb-plugin-0.3.2.tar.gz
 xfce4-xmms-plugin http://download.berlios.de/xfce-goodies/xfce4-xmms-plugin-0.1.1.tar.bz2
 exo http://download.berlios.de/xfce-goodies/exo-0.3.0.tar.gz
-xterminal http://download.berlios.de/xfce-goodies/Terminal-0.2.4.tar.gz
+xfce4-terminal http://download.berlios.de/xfce-goodies/Terminal-0.2.4.tar.gz
 xfmedia http://spuriousinterrupt.org/projects/xfmedia/files/xfmedia-0.7.1.tar.bz2
 mousepad http://erikharrison.net/software/mousepad-0.2.2.tar.gz