From: Klaus Kaempf Date: Fri, 15 Aug 2008 13:01:46 +0000 (+0000) Subject: - follow /etc/products.d/baseproduct and mark product as 'product:type = base' X-Git-Tag: BASE-SuSE-Code-12_1-Branch~561 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70b71febfd94caba1dda779fb1a1244bb7c7d31e;p=platform%2Fupstream%2Flibsolv.git - follow /etc/products.d/baseproduct and mark product as 'product:type = base' --- diff --git a/package/libsatsolver.changes b/package/libsatsolver.changes index 696d7d5..7abee27 100644 --- a/package/libsatsolver.changes +++ b/package/libsatsolver.changes @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Fri Aug 15 15:00:32 CEST 2008 - kkaempf@suse.de + +- follow /etc/products.d/baseproduct and mark product as 'base' + +------------------------------------------------------------------- Fri Aug 15 14:26:29 CEST 2008 - kkaempf@suse.de - Implement pre-code11 fallback for products, parse /etc/*-release diff --git a/tools/repo_products.c b/tools/repo_products.c index 2312958..22635ed 100644 --- a/tools/repo_products.c +++ b/tools/repo_products.c @@ -28,6 +28,9 @@ #include "tools_util.h" #include "repo_content.h" + +static ino_t baseproduct = 0; + struct parsedata { Repo *repo; char *tmp; @@ -225,6 +228,9 @@ repo_add_product(struct parsedata *pd, Repodata *data, FILE *fp, int code11) if (!fstat(fileno(fp), &st)) { repodata_set_num(data, handle, SOLVABLE_INSTALLTIME, st.st_ctime); + /* this is where /baseproduct points to */ + if (st.st_ino == baseproduct) + repodata_set_str(data, handle, PRODUCT_TYPE, "base"); } else { @@ -292,6 +298,14 @@ parse_dir(DIR *dir, const char *path, struct parsedata *pd, Repodata *repodata, struct dirent *entry; char *suffix = code11 ? ".prod" : "-release"; int slen = code11 ? 5 : 8; /* strlen(".prod") : strlen("-release") */ + struct stat st; + + /* check for /baseproduct on code11 and remember its target inode */ + if (code11 + && stat(join2(path, "/", "baseproduct"), &st) == 0) /* follow symlink */ + { + baseproduct = st.st_ino; + } while ((entry = readdir(dir))) {