[Popcon-developers] Bug#386879: popularity-contest - default method needs perl-modules

Petter Reinholdtsen pere at hungry.com
Thu Oct 5 11:51:57 UTC 2006


tags 386879 + patch pending
thanks

[Bastian Blank]
> popcon-upload uses Getopt::Std, which is on perl-modules. So popcon
> does nothing with the deps fullfilled.

Good point.  Thanks for reporting this.

I've commited this patch to fix it.  It should be included in the next
upload.

  * Rewrite argument parsing code in popcon-upload to avoid the
    perl-modules dependency and to keep the disk footprint for popcon
    small. (Closes: #386879)

Index: popcon-upload
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon-upload,v
retrieving revision 1.7
diff -u -3 -p -r1.7 popcon-upload
--- popcon-upload       28 Jul 2006 20:47:07 -0000      1.7
+++ popcon-upload       5 Oct 2006 11:49:25 -0000
@@ -4,12 +4,22 @@

 use strict;
 use IO::Socket;
-use Getopt::Std;

 my %opts;
-getopts("Cdu:f:", \%opts);
+
+# Not using Getopt::Std to avoid perl-modules dependency
+while($#ARGV >= 0 && ($_ = $ARGV[0]) =~ /^-/) {
+        shift @ARGV;
+        if (/^-C$/) { $opts{'C'} = 1; next }
+        if (/^-d$/) { $opts{'d'} = 1; next }
+        if (/^-u$/) { $opts{'u'} = shift; next }
+        if (/^-f$/) { $opts{'f'} = shift; next }
+        &usage("unknown option");
+       exit 1;
+}

 sub usage {
+    print "popcon-upload: error: @_\n" if ($#_ >= 0);
     print <<"EOF";
 Usage: $0 [-Cd] [-u <url>] [-f <file>]
   -C        send submissions in clear text, and not compressed




More information about the Popcon-developers mailing list