aboutsummaryrefslogtreecommitdiffstats
path: root/Tools.pm
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-12-05 22:55:33 +0000
committerRomain d'Alverny <rda@mageia.org>2011-12-05 22:55:33 +0000
commit586a59e00d00f2b1347f015911545b722f2d1f8b (patch)
tree0410ef511a253d5f94298c7f130527a4672c230f /Tools.pm
parent9412e3c3beb6d547f0932d4e1c19a9dfb0cd4378 (diff)
downloadisocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.tar
isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.tar.gz
isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.tar.bz2
isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.tar.xz
isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.zip
First import, test suite attempt for built ISOs
Code heavily taken from previous dams work, reorganized in a test suite to better separate test cases. Does basic things already (in t/). Needs more fixes (esp. in t_install_iso/).
Diffstat (limited to 'Tools.pm')
-rw-r--r--Tools.pm35
1 files changed, 35 insertions, 0 deletions
diff --git a/Tools.pm b/Tools.pm
new file mode 100644
index 0000000..2e4ce72
--- /dev/null
+++ b/Tools.pm
@@ -0,0 +1,35 @@
+#
+#
+
+package Tools;
+
+use strict;
+use warnings;
+
+our $VERSION = '0.1';
+
+use base 'Exporter';
+
+#our @EXPORT = qw(parse_mageia_iso_name);
+
+sub parse_mageia_iso_name {
+ my ($name) = @_;
+ my %info = ();
+
+ if ($name =~ m/^(Mageia)-(\d+)(-(alpha|beta|RC)(\d*))?(-(.*))?-(i586|x86_64|dual)?(-(CD|DVD|BD))?(-(build\_\w+))?\.(.*)$/) {
+ $info{"full"} = $name;
+ $info{"name"} = $1 if defined $1;
+ $info{"version"} = $2 if defined $2;
+ $info{"release"} = "$4$5" if defined $4;
+ $info{"variant"} = $7 if defined $7;
+ $info{"arch"} = $8 if defined $8;
+ $info{"medium"} = $10 if defined $10;
+ $info{"build"} = $12 if defined $12;
+ $info{"ext"} = $13 if defined $13;
+
+ }
+
+ return %info;
+}
+
+1;