Gentoo Logo
Gentoo Spaceship




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
Navigation:
Lists: gentoo-perl: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-perl@g.o
From: antoine.raillon@...
Subject: r16 - /
Date: Thu, 12 May 2005 23:56:33 +0200 (CEST)
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

Navigation:
Lists: gentoo-perl: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
r15 - code
Next by thread:
r17 - /
Previous by date:
r15 - code
Next by date:
r17 - /


Updated Jun 17, 2009

Summary: Archive of the gentoo-perl mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.