From 8e0d85c61e9ee6dc3df76c8262fb0b195d0b8a62 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 23 Feb 2010 11:02:46 -0500 Subject: [PATCH] Add 'VCS' key Spec files have a lot of metadata about a project. However one of the most key components is the upstream version control system which was notably lacking. Resolve this by adding a "VCS" key. There is no specification for contents of this key, given that the set of version control systems (and features thereof) are not well-defined. However, recommendations are: * git: This URL should be in a form that can be passed to "git clone", with the additional feature that an optional fragment identifier "#foo" denotes a branch or tag. --- build/files.c | 1 + build/parsePreamble.c | 3 +++ lib/rpmlib.h | 1 + 3 files changed, 5 insertions(+) diff --git a/build/files.c b/build/files.c index 45a23a1..2c3320e 100644 --- a/build/files.c +++ b/build/files.c @@ -2012,6 +2012,7 @@ void initSourceHeader(Spec spec) case RPMTAG_CHANGELOGNAME: case RPMTAG_CHANGELOGTEXT: case RPMTAG_URL: + case RPMTAG_VCS: case RPMTAG_BUILDHOST: case HEADER_I18NTABLE: if (ptr) diff --git a/build/parsePreamble.c b/build/parsePreamble.c index aac0aef..14a6eeb 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -25,6 +25,7 @@ static rpmTag copyTagsDuringParse[] = { RPMTAG_VENDOR, RPMTAG_ICON, RPMTAG_URL, + RPMTAG_VCS, RPMTAG_CHANGELOGTIME, RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGTEXT, @@ -600,6 +601,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, (void) headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1); break; case RPMTAG_URL: + case RPMTAG_VCS: SINGLE_TOKEN_ONLY; (void) headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1); break; @@ -801,6 +803,7 @@ static struct PreambleRec_s const preambleList[] = { {RPMTAG_GROUP, 1, LEN_AND_STR("group")}, {RPMTAG_PACKAGER, 0, LEN_AND_STR("packager")}, {RPMTAG_URL, 0, LEN_AND_STR("url")}, + {RPMTAG_VCS, 0, LEN_AND_STR("vcs")}, {RPMTAG_SOURCE, 0, LEN_AND_STR("source")}, {RPMTAG_PATCH, 0, LEN_AND_STR("patch")}, {RPMTAG_NOSOURCE, 0, LEN_AND_STR("nosource")}, diff --git a/lib/rpmlib.h b/lib/rpmlib.h index d2f5116..fd3fa7b 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -443,6 +443,7 @@ typedef enum rpmTag_e { RPMTAG_DEPENDSDICT = 1145, RPMTAG_SOURCEPKGID = 1146, RPMTAG_DISTTAG = 1155, /* s */ + RPMTAG_VCS = 5034, /* s */ RPMTAG_AUTOINSTALLED = 5094, /* i */ RPMTAG_IDENTITY = 5095, /* s */ /*@-enummemuse@*/