[Collab-qa-commits] r302 - tools/bugs2packagelist

abi at alioth.debian.org abi at alioth.debian.org
Thu Jul 5 08:19:37 UTC 2007


Author: abi
Date: 2007-07-05 08:19:37 +0000 (Thu, 05 Jul 2007)
New Revision: 302

Modified:
   tools/bugs2packagelist/bts2pkglist.pl
Log:
some stupid input parsing.. more on that later

Modified: tools/bugs2packagelist/bts2pkglist.pl
===================================================================
--- tools/bugs2packagelist/bts2pkglist.pl	2007-07-04 15:46:37 UTC (rev 301)
+++ tools/bugs2packagelist/bts2pkglist.pl	2007-07-05 08:19:37 UTC (rev 302)
@@ -5,6 +5,32 @@
 use SOAP::Lite; 
 use Data::Dumper;
 
+sub do_help {
+	print "$0: <user_address> <usertag> <package_list_file>\n";
+}
+
+if($#ARGV < 2 ) {
+        do_help();
+        exit 1;
+}
+
+my $user_mail;
+if ( $ARGV[0] =~ /^\S+@\S+$/ ) {
+	$user_mail = $ARGV[0];
+} else {
+	print "First argument needs to be a mail\n";
+	do_help();
+}
+my $user_tag	= $ARGV[1];
+
+my $pkglist;
+if ( -f $ARGV[2] ) {
+        $pkglist   = $ARGV[2];
+} else {
+        print "Package list ($ARGV[2]) seems not to be a regular file.\n";
+        exit 1;
+}
+
 my $c = new SOAP::Lite
     uri => '/Debbugs/SOAP/Usertag',
     proxy => 'http://bugs.debian.org/cgi-bin/soap.cgi'




More information about the Collab-qa-commits mailing list