From 06429cda11fdb490f39ae047a982a11ffd3ce66e Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Fri, 27 Jun 2008 13:50:38 +0000 Subject: [PATCH] - add support for the package's URL [bnc#402434] - unset CDPATH in repo2solv.sh [bnc#402597] --- src/knownid.h | 6 ++++++ tools/repo2solv.sh | 1 + tools/repo_rpmdb.c | 6 +++++- tools/repo_rpmmd.c | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/knownid.h b/src/knownid.h index 06bb435..45fe459 100644 --- a/src/knownid.h +++ b/src/knownid.h @@ -10,6 +10,11 @@ * */ +/* + * Warning: you're free to append new entries, but insert/delete breaks + * the ABI! + */ + #undef KNOWNID #ifdef KNOWNID_INITIALIZE # define KNOWNID(a, b) b @@ -82,6 +87,7 @@ KNOWNID(SOLVABLE_SUMMARY, "solvable:summary"), KNOWNID(SOLVABLE_DESCRIPTION, "solvable:description"), KNOWNID(SOLVABLE_AUTHORS, "solvable:authors"), KNOWNID(SOLVABLE_GROUP, "solvable:group"), +KNOWNID(SOLVABLE_URL, "solvable:url"), KNOWNID(SOLVABLE_KEYWORDS, "solvable:keywords"), KNOWNID(SOLVABLE_LICENSE, "solvable:license"), KNOWNID(SOLVABLE_BUILDTIME, "solvable:buildtime"), diff --git a/tools/repo2solv.sh b/tools/repo2solv.sh index 7e3421e..25862d4 100755 --- a/tools/repo2solv.sh +++ b/tools/repo2solv.sh @@ -21,6 +21,7 @@ test_susetags() { set -e LANG=C +unset CDPATH parser_options=${PARSER_OPTIONS:-} diff --git a/tools/repo_rpmdb.c b/tools/repo_rpmdb.c index a432390..00e9f8a 100644 --- a/tools/repo_rpmdb.c +++ b/tools/repo_rpmdb.c @@ -30,7 +30,7 @@ #include "util.h" #include "repo_rpmdb.h" -#define RPMDB_COOKIE_VERSION 1 +#define RPMDB_COOKIE_VERSION 2 #define TAG_NAME 1000 #define TAG_VERSION 1001 @@ -44,6 +44,7 @@ #define TAG_VENDOR 1011 #define TAG_LICENSE 1014 #define TAG_GROUP 1016 +#define TAG_URL 1020 #define TAG_ARCH 1022 #define TAG_FILESIZES 1028 #define TAG_FILEMODES 1030 @@ -896,6 +897,9 @@ rpm2solv(Pool *pool, Repo *repo, Repodata *repodata, Solvable *s, RpmHead *rpmhe str = headstring(rpmhead, TAG_LICENSE); if (str) repodata_set_poolstr(repodata, handle, SOLVABLE_LICENSE, str); + str = headstring(rpmhead, TAG_URL); + if (str) + repodata_set_str(repodata, handle, SOLVABLE_URL, str); u32 = headint32(rpmhead, TAG_BUILDTIME); if (u32) repodata_set_num(repodata, handle, SOLVABLE_BUILDTIME, u32); diff --git a/tools/repo_rpmmd.c b/tools/repo_rpmmd.c index 3a843a2..9ca3ac9 100644 --- a/tools/repo_rpmmd.c +++ b/tools/repo_rpmmd.c @@ -39,6 +39,7 @@ enum state { /* resobject attributes */ STATE_SUMMARY, STATE_DESCRIPTION, + STATE_URL, STATE_INSNOTIFY, STATE_DELNOTIFY, STATE_VENDOR, @@ -147,6 +148,7 @@ static struct stateswitch stateswitches[] = { { STATE_SOLVABLE, "summary", STATE_SUMMARY, 1 }, { STATE_SOLVABLE, "description", STATE_DESCRIPTION, 1 }, + { STATE_SOLVABLE, "url", STATE_URL, 1 }, //{ STATE_SOLVABLE, "???", STATE_INSNOTIFY, 1 }, //{ STATE_SOLVABLE, "??", STATE_DELNOTIFY, 1 }, { STATE_SOLVABLE, "vendor", STATE_VENDOR, 1 }, @@ -833,6 +835,10 @@ endElement(void *userData, const char *name) pd->lang = 0; set_desciption_author(pd->data, handle, pd->content); break; + case STATE_URL: + if (pd->content[0]) + repodata_set_str(pd->data, handle, SOLVABLE_URL, pd->content); + break; case STATE_SOURCERPM: set_sourcerpm(pd->data, s, handle, pd->content); break; -- 2.7.4