- add support for the package's URL [bnc#402434]
authorMichael Schroeder <mls@suse.de>
Fri, 27 Jun 2008 13:50:38 +0000 (13:50 +0000)
committerMichael Schroeder <mls@suse.de>
Fri, 27 Jun 2008 13:50:38 +0000 (13:50 +0000)
- unset CDPATH in repo2solv.sh [bnc#402597]

src/knownid.h
tools/repo2solv.sh
tools/repo_rpmdb.c
tools/repo_rpmmd.c

index 06bb435..45fe459 100644 (file)
  *
  */
 
+/*
+ * 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"),
index 7e3421e..25862d4 100755 (executable)
@@ -21,6 +21,7 @@ test_susetags() {
 set -e 
 
 LANG=C
+unset CDPATH
 parser_options=${PARSER_OPTIONS:-}
 
 
index a432390..00e9f8a 100644 (file)
@@ -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);
index 3a843a2..9ca3ac9 100644 (file)
@@ -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;