Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11711 - in /trunk: libzypp/zypp/sat/SolvAttr.cc libzypp/zypp/sat/SolvAttr.h sat-solver/src/knownid.h sat-solver/tools/repo_repomdxml.c
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Tue, 18 Nov 2008 18:06:53 -0000
  • Message-id: <20081118180653.B52839E4C5@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Tue Nov 18 19:06:53 2008
New Revision: 11711

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11711&view=rev
Log:
- adapt the attributes to support the new rpmmd spec better
so we get the API at least
- backup, interfaces in ZYpp tomorrow

Modified:
trunk/libzypp/zypp/sat/SolvAttr.cc
trunk/libzypp/zypp/sat/SolvAttr.h
trunk/sat-solver/src/knownid.h
trunk/sat-solver/tools/repo_repomdxml.c

Modified: trunk/libzypp/zypp/sat/SolvAttr.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SolvAttr.cc?rev=11711&r1=11710&r2=11711&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/SolvAttr.cc (original)
+++ trunk/libzypp/zypp/sat/SolvAttr.cc Tue Nov 18 19:06:53 2008
@@ -114,11 +114,15 @@
const SolvAttr SolvAttr::productUrlType ( PRODUCT_URL_TYPE );

// repository
- const SolvAttr SolvAttr::repositoryTimestamp ( REPOSITORY_TIMESTAMP );
- const SolvAttr SolvAttr::repositoryExpire ( REPOSITORY_EXPIRE );
- const SolvAttr SolvAttr::repositoryUpdates ( REPOSITORY_UPDATES );
- const SolvAttr SolvAttr::repositoryProducts ( REPOSITORY_PRODUCTS );
- const SolvAttr SolvAttr::repositoryKeywords ( REPOSITORY_KEYWORDS );
+ const SolvAttr SolvAttr::repositoryTimestamp ( REPOSITORY_TIMESTAMP );
+ const SolvAttr SolvAttr::repositoryExpire ( REPOSITORY_EXPIRE );
+ const SolvAttr SolvAttr::repositoryUpdates ( REPOSITORY_UPDATES );
+ const SolvAttr SolvAttr::repositoryUpdateLabel ( REPOSITORY_UPDATE_LABEL );
+ const SolvAttr SolvAttr::repositoryUpdateCpeid ( REPOSITORY_UPDATE_CPEID );
+ const SolvAttr SolvAttr::repositoryProducts ( REPOSITORY_PRODUCTS );
+ const SolvAttr SolvAttr::repositoryProductLabel( REPOSITORY_PRODUCT_LABEL );
+ const SolvAttr SolvAttr::repositoryProductCpeid( REPOSITORY_PRODUCT_CPEID );
+ const SolvAttr SolvAttr::repositoryKeywords ( REPOSITORY_KEYWORDS );

} // namespace sat
/////////////////////////////////////////////////////////////////

Modified: trunk/libzypp/zypp/sat/SolvAttr.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SolvAttr.h?rev=11711&r1=11710&r2=11711&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/SolvAttr.h (original)
+++ trunk/libzypp/zypp/sat/SolvAttr.h Tue Nov 18 19:06:53 2008
@@ -149,8 +149,12 @@
static const SolvAttr repositoryTimestamp;
static const SolvAttr repositoryExpire;
static const SolvAttr repositoryUpdates;
+ static const SolvAttr repositoryUpdateLabel;
+ static const SolvAttr repositoryUpdateCpeid;
static const SolvAttr repositoryKeywords;
static const SolvAttr repositoryProducts;
+ static const SolvAttr repositoryProductLabel;
+ static const SolvAttr repositoryProductCpeid;
static const SolvAttr repositoryRevision;
//@}


Modified: trunk/sat-solver/src/knownid.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/knownid.h?rev=11711&r1=11710&r2=11711&view=diff
==============================================================================
--- trunk/sat-solver/src/knownid.h (original)
+++ trunk/sat-solver/src/knownid.h Tue Nov 18 19:06:53 2008
@@ -166,6 +166,7 @@
KNOWNID(PRODUCT_URL_TYPE, "product:url:type"),
KNOWNID(PRODUCT_FLAGS, "product:flags"),
KNOWNID(PRODUCT_PRODUCTLINE, "product:productline"),
+/* this has to be obsoleted */
KNOWNID(PRODUCT_UPDATEREPOKEY, "product:updaterepokey"),
KNOWNID(PRODUCT_REGISTER_TARGET, "product:regtarget"),
KNOWNID(PRODUCT_REGISTER_RELEASE, "product:regrelease"),
@@ -178,10 +179,17 @@
/* hint when the metadata could be outdated
w/respect to generated timestamp */
KNOWNID(REPOSITORY_EXPIRE, "repository:expire"),
-/* which things does this repo provides updates for, if it does */
+
+/* which things does this repo provides updates for, if it does (array) */
KNOWNID(REPOSITORY_UPDATES, "repository:updates"),
-/* which products this repository is supposed to be for */
+KNOWNID(REPOSITORY_UPDATE_LABEL, "repository:update:label"),
+KNOWNID(REPOSITORY_UPDATE_CPEID, "repository:update:cpeid"),
+
+/* which products this repository is supposed to be for (array) */
KNOWNID(REPOSITORY_PRODUCTS, "repository:products"),
+KNOWNID(REPOSITORY_PRODUCT_LABEL, "repository:product:label"),
+KNOWNID(REPOSITORY_PRODUCT_CPEID, "repository:product:cpeid"),
+
/* keyword (tags) for this repository */
KNOWNID(REPOSITORY_KEYWORDS, "repository:keywords"),
/* revision of the repository. arbitrary string */

Modified: trunk/sat-solver/tools/repo_repomdxml.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_repomdxml.c?rev=11711&r1=11710&r2=11711&view=diff
==============================================================================
--- trunk/sat-solver/tools/repo_repomdxml.c (original)
+++ trunk/sat-solver/tools/repo_repomdxml.c Tue Nov 18 19:06:53 2008
@@ -160,6 +160,12 @@
struct stateswitch *swtab[NUMSTATES];
enum state sbtab[NUMSTATES];
int timestamp;
+ /* handles for collection
+ structures */
+ /* repo updates */
+ Id ruhandle;
+ /* repo products */
+ Id rphandle;
};

/*
@@ -249,7 +255,18 @@
case STATE_KEYWORD: break;
case STATE_CONTENT: break;
case STATE_REVISION: break;
- case STATE_DISTRO: break;
+ case STATE_DISTRO:
+ {
+ /* this is extra metadata about the product this repository
+ was designed for */
+ const char *cpeid = find_attr("cpeid", atts);
+ pd->rphandle = repodata_new_handle(pd->data);
+ /* set the cpeid for the product
+ the label is set in the content of the tag */
+ if (cpeid)
+ repodata_set_poolstr(pd->data, pd->rphandle,
REPOSITORY_PRODUCT_CPEID, cpeid);
+ break;
+ }
case STATE_DATA: break;
case STATE_LOCATION: break;
case STATE_CHECKSUM: break;
@@ -325,7 +342,13 @@
if (pd->content)
repodata_add_poolstr_array(pd->data, SOLVID_META, REPOSITORY_REVISION,
pd->content);
break;
- case STATE_DISTRO: break;
+ case STATE_DISTRO:
+ /* distro tag is used in repomd.xml to say the product this repo is
+ made for */
+ if (pd->content)
+ repodata_set_str(pd->data, pd->rphandle, REPOSITORY_PRODUCT_LABEL,
pd->content);
+ repodata_add_flexarray(pd->data, SOLVID_META, REPOSITORY_PRODUCTS,
pd->rphandle);
+ break;
case STATE_SUSEINFO: break;
case STATE_PRODUCTS: break;
case STATE_KEYWORDS: break;

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages