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.
This commit is contained in:
Colin Walters 2010-02-23 11:02:46 -05:00 committed by Dmitry V. Levin
parent ee9e17c3ad
commit 8e0d85c61e
3 changed files with 5 additions and 0 deletions

View File

@ -2012,6 +2012,7 @@ void initSourceHeader(Spec spec)
case RPMTAG_CHANGELOGNAME: case RPMTAG_CHANGELOGNAME:
case RPMTAG_CHANGELOGTEXT: case RPMTAG_CHANGELOGTEXT:
case RPMTAG_URL: case RPMTAG_URL:
case RPMTAG_VCS:
case RPMTAG_BUILDHOST: case RPMTAG_BUILDHOST:
case HEADER_I18NTABLE: case HEADER_I18NTABLE:
if (ptr) if (ptr)

View File

@ -25,6 +25,7 @@ static rpmTag copyTagsDuringParse[] = {
RPMTAG_VENDOR, RPMTAG_VENDOR,
RPMTAG_ICON, RPMTAG_ICON,
RPMTAG_URL, RPMTAG_URL,
RPMTAG_VCS,
RPMTAG_CHANGELOGTIME, RPMTAG_CHANGELOGTIME,
RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGNAME,
RPMTAG_CHANGELOGTEXT, 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); (void) headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1);
break; break;
case RPMTAG_URL: case RPMTAG_URL:
case RPMTAG_VCS:
SINGLE_TOKEN_ONLY; SINGLE_TOKEN_ONLY;
(void) headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1); (void) headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1);
break; break;
@ -801,6 +803,7 @@ static struct PreambleRec_s const preambleList[] = {
{RPMTAG_GROUP, 1, LEN_AND_STR("group")}, {RPMTAG_GROUP, 1, LEN_AND_STR("group")},
{RPMTAG_PACKAGER, 0, LEN_AND_STR("packager")}, {RPMTAG_PACKAGER, 0, LEN_AND_STR("packager")},
{RPMTAG_URL, 0, LEN_AND_STR("url")}, {RPMTAG_URL, 0, LEN_AND_STR("url")},
{RPMTAG_VCS, 0, LEN_AND_STR("vcs")},
{RPMTAG_SOURCE, 0, LEN_AND_STR("source")}, {RPMTAG_SOURCE, 0, LEN_AND_STR("source")},
{RPMTAG_PATCH, 0, LEN_AND_STR("patch")}, {RPMTAG_PATCH, 0, LEN_AND_STR("patch")},
{RPMTAG_NOSOURCE, 0, LEN_AND_STR("nosource")}, {RPMTAG_NOSOURCE, 0, LEN_AND_STR("nosource")},

View File

@ -443,6 +443,7 @@ typedef enum rpmTag_e {
RPMTAG_DEPENDSDICT = 1145, RPMTAG_DEPENDSDICT = 1145,
RPMTAG_SOURCEPKGID = 1146, RPMTAG_SOURCEPKGID = 1146,
RPMTAG_DISTTAG = 1155, /* s */ RPMTAG_DISTTAG = 1155, /* s */
RPMTAG_VCS = 5034, /* s */
RPMTAG_AUTOINSTALLED = 5094, /* i */ RPMTAG_AUTOINSTALLED = 5094, /* i */
RPMTAG_IDENTITY = 5095, /* s */ RPMTAG_IDENTITY = 5095, /* s */
/*@-enummemuse@*/ /*@-enummemuse@*/