test: specinfo.pl (NEW) - this gets NVR properly for subpackages

glen glen at pld-linux.org
Sat Mar 17 12:39:15 CET 2007


Author: glen                         Date: Sat Mar 17 11:39:15 2007 GMT
Module: test                          Tag: HEAD
---- Log message:
- this gets NVR properly for subpackages

---- Files affected:
test:
   specinfo.pl (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: test/specinfo.pl
diff -u /dev/null test/specinfo.pl:1.1
--- /dev/null	Sat Mar 17 12:39:15 2007
+++ test/specinfo.pl	Sat Mar 17 12:39:10 2007
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use RPM4;
+
+my $specfile = shift or die "$0 specfile.spec
+
+output NVR for specfile
+";
+
+my $spec = RPM4::specnew($specfile, undef, undef, undef, 1, 1) or die "unable to parse $specfile\n";
+my $h = $spec->srcheader();
+my ($name, $version, $release, $type) = ($h->fullname);
+printf("PACKAGE_NAME %s\n", $name);
+printf("PACKAGE_VERSION %s\n", $version);
+printf("PACKAGE_RELEASE %s\n", $release);
+print $h->queryformat("%{NAME}-%{VERSION}-%{RELEASE}\n");
================================================================


More information about the pld-cvs-commit mailing list