aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Youri/Package/RPM.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Youri/Package/RPM.pm')
-rw-r--r--lib/Youri/Package/RPM.pm33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/Youri/Package/RPM.pm b/lib/Youri/Package/RPM.pm
new file mode 100644
index 0000000..cdb1680
--- /dev/null
+++ b/lib/Youri/Package/RPM.pm
@@ -0,0 +1,33 @@
+# $Id: /local/youri/soft/trunk/lib/Youri/Package/URPM.pm 2257 2006-07-05T09:22:47.088572Z guillaume $
+package Youri::Package::RPM;
+
+=head1 NAME
+
+Youri::Package::RPM - Base class for all RPM-based package implementation
+
+=head1 DESCRIPTION
+
+This bases class factorize code between various RPM-based package
+implementation.
+
+=cut
+
+use strict;
+use warnings;
+use base 'Youri::Package';
+
+sub get_pattern {
+ my ($class, $name, $version, $release, $arch) = @_;
+
+ return
+ ($name ? quotemeta($name) : '[\w-]+' ).
+ '-' .
+ ($version ? quotemeta($version) : '[^-]+' ).
+ '-' .
+ ($release ? quotemeta($release) : '[^-]+' ).
+ '\.' .
+ ($arch ? quotemeta($arch) : '\w+' ).
+ '\.rpm';
+}
+
+1;