Note: Due to technical difficulties, the Archives are currently not up to date.
GMANE provides an alternative service for most mailing lists. c.f. bug 424647
List Archive: gentoo-perl
Author: sniper
Date: 2005-05-11 20:56:08 +0200 (Wed, 11 May 2005)
New Revision: 16
Added:
chkebuild.pl
Log:
ebuild format checker/parser
Added: chkebuild.pl
===================================================================
--- chkebuild.pl 2005-05-11 18:09:08 UTC (rev 15)
+++ chkebuild.pl 2005-05-11 18:56:08 UTC (rev 16)
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+my $re_path = '(?:.+/)?';
+my $re_pkg = '[-\w+]+?';
+my $re_ver = '(?:[\d\.]+[a-z]?)?';
+my $re_suf = '(?:_(?:alpha|beta|pre|rc|p)(?:\d+)?)?';
+my $re_rev = '(?:r\d+)?';
+my $re_ext = '(?:\.(?:ebuild|tar|gz|tar.gz|zip|bz2|tgz))?';
+my $re_ebuild = qr[($re_path)($re_pkg)-?($re_ver)($re_suf)-?($re_rev)($re_ext)];
+
+print "REGEXP: $re_ebuild\n\n";
+
+my ($ok, $nok, $total) = (0, 0, 0);
+while(<>) {
+ chomp;
+ $total++;
+ if(my($path, $pkg, $ver, $suf, $rev, $ext) = /^$re_ebuild$/) {
+ $ok++;
+ print "$_\tPASS path=$path pkg=$pkg ver=$ver suf=$suf rev=$rev ext=$ext\n";
+ }
+ else {
+ $nok++;
+ print "$_\tFAILED\n";
+ }
+}
+
+print<<END;
+PASS: $ok
+FAILED: $nok
+TOTAL: $total
+
+END
--
gentoo-perl@g.o mailing list
|
|