diff options
Diffstat (limited to 'zarb-ml/mageia-dev/2011-December/010333.html')
-rw-r--r-- | zarb-ml/mageia-dev/2011-December/010333.html | 204 |
1 files changed, 204 insertions, 0 deletions
diff --git a/zarb-ml/mageia-dev/2011-December/010333.html b/zarb-ml/mageia-dev/2011-December/010333.html new file mode 100644 index 000000000..7790d1fd0 --- /dev/null +++ b/zarb-ml/mageia-dev/2011-December/010333.html @@ -0,0 +1,204 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [Mageia-dev] [soft-commits] [2359] coding style update (perl_checker) + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:mageia-dev%40mageia.org?Subject=Re%3A%20%5BMageia-dev%5D%20%5Bsoft-commits%5D%20%5B2359%5D%20coding%20style%20update%0A%09%28perl_checker%29&In-Reply-To=%3CCAONrEtaCezTNCJvfXfVDZhDwNy-O7uX8byPLp0djOATv3i1_ag%40mail.gmail.com%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="010352.html"> + <LINK REL="Next" HREF="010340.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[Mageia-dev] [soft-commits] [2359] coding style update (perl_checker)</H1> + <B>Thierry Vignaud</B> + <A HREF="mailto:mageia-dev%40mageia.org?Subject=Re%3A%20%5BMageia-dev%5D%20%5Bsoft-commits%5D%20%5B2359%5D%20coding%20style%20update%0A%09%28perl_checker%29&In-Reply-To=%3CCAONrEtaCezTNCJvfXfVDZhDwNy-O7uX8byPLp0djOATv3i1_ag%40mail.gmail.com%3E" + TITLE="[Mageia-dev] [soft-commits] [2359] coding style update (perl_checker)">thierry.vignaud at gmail.com + </A><BR> + <I>Sat Dec 10 18:59:32 CET 2011</I> + <P><UL> + <LI>Previous message: <A HREF="010352.html">[Mageia-dev] Need for a clear policy on translated man pages +</A></li> + <LI>Next message: <A HREF="010340.html">[Mageia-dev] [soft-commits] [2359] coding style update (perl_checker) +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#10333">[ date ]</a> + <a href="thread.html#10333">[ thread ]</a> + <a href="subject.html#10333">[ subject ]</a> + <a href="author.html#10333">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>On 10 December 2011 18:29, <<A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">root at mageia.org</A>> wrote: +><i> Revision 2359 Author rda Date 2011-12-10 18:29:07 +0100 (Sat, 10 Dec 2011) +</I>><i> +</I>><i> Log Message +</I>><i> +</I>><i> coding style update (perl_checker) +</I> +uh? Tools.pm doesn't currently pass perl_checker + +><i> Modified Paths +</I>><i> +</I>><i> isocheck/trunk/Tools.pm +</I>><i> isocheck/trunk/t/003_is_hybrid.t +</I>><i> isocheck/trunk/t_install_iso/010_check_autorun.t +</I>><i> isocheck/trunk/t_install_iso/012_check_ids.t +</I>><i> isocheck/trunk/t_install_iso/013_check_rpms.t +</I>><i> isocheck/trunk/t_install_iso/016_check_pubkey.t +</I>><i> +</I>><i> Modified: isocheck/trunk/Tools.pm +</I>><i> =================================================================== +</I>><i> --- isocheck/trunk/Tools.pm 2011-12-10 17:27:16 UTC (rev 2358) +</I>><i> +++ isocheck/trunk/Tools.pm 2011-12-10 17:29:07 UTC (rev 2359) +</I>><i> @@ -33,18 +33,18 @@ +</I>><i> +</I>><i> sub parse_mageia_iso_name { +</I>><i> my ($name) = @_; +</I>><i> - my %info = (); +</I>><i> + my %info; +</I>><i> +</I>><i> - if ($name =~ +</I>><i> m/^(Mageia)-(\d+)(-(alpha|beta|RC)(\d*))?(-(.*))?-(i586|x86_64|dual)?(-(CD|DVD|BD))?(-(build\_\w+))?\.(.*)$/) +</I>><i> { +</I>><i> - $info{"full"} = $name; +</I>><i> - $info{"name"} = $1 if defined $1; +</I>><i> - $info{"version"} = $2 if defined $2; +</I>><i> - $info{"release"} = "$4$5" if defined $4; +</I>><i> - $info{"variant"} = $7 if defined $7; +</I>><i> - $info{"arch"} = $8 if defined $8; +</I>><i> - $info{"medium"} = $10 if defined $10; +</I>><i> - $info{"build"} = $12 if defined $12; +</I>><i> - $info{"ext"} = $13 if defined $13; +</I>><i> + if ($name =~ +</I>><i> m/^(Mageia)-(\d+)(-(alpha|beta|RC)(\d*))?(-(.*))?-(i586|x86_64|dual)?(-(CD|DVD|BD))?(-(build_\w+))?\.(.*)$/) +</I>><i> { +</I>><i> + $info{full} = $name; +</I>><i> + $info{name} = $1 if defined $1; +</I>><i> + $info{version} = $2 if defined $2; +</I>><i> + $info{release} = "$4$5" if defined $4; +</I>><i> + $info{variant} = $7 if defined $7; +</I>><i> + $info{arch} = $8 if defined $8; +</I>><i> + $info{medium} = $10 if defined $10; +</I>><i> + $info{build} = $12 if defined $12; +</I>><i> + $info{ext} = $13 if defined $13; +</I> +You don't need all those tests since you already checked if the regexp +matched or not. +You only have to check for ()? groups. +What's more your checks are inconsistant anyway (eg you don't check for $5) + + +just do sg like this: + +sub parse_mageia_iso_name { + my ($name) = @_; + my %info; + + if ((@info{qw(name version release variant arch medium build +ext)}) = $name =~ + m/^(Mageia)-(\d+)-((?:alpha|beta|RC)\d*)?(-(?:.*))?-(i586|x86_64|dual)?(?:-(CD|DVD|BD))?(?:-(build_\w+))?\.(.*)$/) +{ + $info{full} = $name; + } + + return %info; +} + + +><i> Modified: isocheck/trunk/t/003_is_hybrid.t +</I>><i> =================================================================== +</I>><i> --- isocheck/trunk/t/003_is_hybrid.t 2011-12-10 17:27:16 UTC (rev 2358) +</I>><i> +++ isocheck/trunk/t/003_is_hybrid.t 2011-12-10 17:29:07 UTC (rev 2359) +</I>><i> @@ -24,7 +24,7 @@ +</I>><i> +</I>><i> my ($image_path) = @ARGV; +</I>><i> +</I>><i> -ok (is_hybrid($image_path, 0), "Is hybrid"); +</I>><i> +ok is_hybrid($image_path, 0), "Is hybrid"; +</I> +please keep (), it's clearer. just remove the space between "ok" and "(" + + +><i> Modified: isocheck/trunk/t_install_iso/016_check_pubkey.t +</I>><i> =================================================================== +</I>><i> --- isocheck/trunk/t_install_iso/016_check_pubkey.t 2011-12-10 17:27:16 UTC +</I>><i> (rev 2358) +</I>><i> +++ isocheck/trunk/t_install_iso/016_check_pubkey.t 2011-12-10 17:29:07 UTC +</I>><i> (rev 2359) +</I>><i> @@ -39,17 +39,17 @@ +</I>><i> system "ls /media/iso_check/i586/media/ > temp_media_on_iso.log" if -r +</I>><i> "/media/iso_check/i586/media/"; +</I>><i> system "ls /media/iso_check/x86_64/media/ >> temp_media_on_iso.log" if -r +</I>><i> "/media/iso_check/x86_64/media/"; +</I>><i> +</I>><i> -ok (-r "temp_media_on_iso.log", "Got a log for media contents"); +</I>><i> +ok -r "temp_media_on_iso.log", "Got a log for media contents"; +</I>><i> +</I>><i> open(my $file, "temp_media_on_iso.log") if -r "temp_media_on_iso.log"; +</I>><i> +</I>><i> while ($media = <$file>) { +</I> +just reuse cat_() from MDK::Common (simpler, easier to read) +</PRE> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="010352.html">[Mageia-dev] Need for a clear policy on translated man pages +</A></li> + <LI>Next message: <A HREF="010340.html">[Mageia-dev] [soft-commits] [2359] coding style update (perl_checker) +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#10333">[ date ]</a> + <a href="thread.html#10333">[ thread ]</a> + <a href="subject.html#10333">[ subject ]</a> + <a href="author.html#10333">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="https://www.mageia.org/mailman/listinfo/mageia-dev">More information about the Mageia-dev +mailing list</a><br> +</body></html> |