From ba831a4ce62bc256e0e1cd15047444ac75cb7ae6 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Sat, 21 Jul 2001 10:34:04 +0000 Subject: add sourcerpm tag --- rpmtools.pm | 2 +- rpmtools.spec | 5 ++++- rpmtools.xs | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rpmtools.pm b/rpmtools.pm index 4cd3f0e..5a96fd6 100644 --- a/rpmtools.pm +++ b/rpmtools.pm @@ -101,7 +101,7 @@ sub new { my %tags; @tags{@_} = (); bless { flags => [ qw(name version release size arch serial group requires provides), - grep { exists $tags{$_} } qw(sense files obsoletes conflicts conffiles) ], + grep { exists $tags{$_} } qw(sense files obsoletes conflicts conffiles sourcerpm) ], info => {}, depslist => [], provides => {}, diff --git a/rpmtools.spec b/rpmtools.spec index 180bcb8..1aeed61 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,5 +1,5 @@ %define name rpmtools -%define release 9mdk +%define release 10mdk # do not modify here, see Makefile in the CVS %define version 3.0 @@ -54,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/perl5/man/*/* %changelog +* Sat Jul 21 2001 Warly 3.0-10mdk +- add sourcerpm tag. + * Wed Jul 18 2001 François Pons 3.0-9mdk - changed rpm requires by including release with test. - allow bootstrap with current version and not installed one. diff --git a/rpmtools.xs b/rpmtools.xs index d8f7d36..25d2abf 100644 --- a/rpmtools.xs +++ b/rpmtools.xs @@ -29,6 +29,7 @@ #define HDFLAGS_CONFLICTS 0x00800000 #define HDFLAGS_FILES 0x01000000 #define HDFLAGS_CONFFILES 0x02000000 +#define HDFLAGS_SOURCERPM 0x04000000 char *get_name(Header header, int_32 tag) { @@ -87,6 +88,7 @@ int get_bflag(AV* flag) { if (!strncmp(str, "obsoletes", 9)) bflag |= HDFLAGS_OBSOLETES; else if (!strncmp(str, "conflicts", 9)) bflag |= HDFLAGS_CONFLICTS; else if (!strncmp(str, "conffiles", 9)) bflag |= HDFLAGS_CONFFILES; + else if (!strncmp(str, "sourcerpm", 9)) bflag |= HDFLAGS_SOURCERPM; break; case 11: if (!strncmp(str, "description", 11)) bflag |= HDFLAGS_DESCRIPTION; @@ -206,6 +208,8 @@ HV* get_info(Header header, int bflag, HV* provides) { hv_store(header_info, "conflicts", 9, get_table_sense(header, RPMTAG_CONFLICTNAME, bflag & HDFLAGS_SENSE ? RPMTAG_CONFLICTFLAGS : 0, bflag & HDFLAGS_SENSE ? RPMTAG_CONFLICTVERSION : 0, 0), 0); + if (bflag & HDFLAGS_SOURCERPM) + hv_store(header_info, "sourcerpm", 9, newSVpv(get_name(header, RPMTAG_SOURCERPM), 0), 0); if (provides || (bflag & (HDFLAGS_FILES | HDFLAGS_CONFFILES))) { /* at this point, there is a need to parse all files to update provides of needed files, or to store them. */ -- cgit v1.2.1