aboutsummaryrefslogtreecommitdiffstats
path: root/xs2.xs
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2014-08-27 16:15:29 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-09-12 23:11:56 +0200
commit47f12646b34ad10fca581e8946ade89f18765483 (patch)
tree3f526418bb2fe32524d6ca208d5f39e9f510a6b5 /xs2.xs
parent3db43b0cf315a4c0c7b78787f637db04045f90ed (diff)
downloadperl-URPM-47f12646b34ad10fca581e8946ade89f18765483.tar
perl-URPM-47f12646b34ad10fca581e8946ade89f18765483.tar.gz
perl-URPM-47f12646b34ad10fca581e8946ade89f18765483.tar.bz2
perl-URPM-47f12646b34ad10fca581e8946ade89f18765483.tar.xz
perl-URPM-47f12646b34ad10fca581e8946ade89f18765483.zip
rename "suggests" field to "recommends"
as this really what it is
Diffstat (limited to 'xs2.xs')
-rw-r--r--xs2.xs28
1 files changed, 28 insertions, 0 deletions
diff --git a/xs2.xs b/xs2.xs
new file mode 100644
index 0000000..1f281ca
--- /dev/null
+++ b/xs2.xs
@@ -0,0 +1,28 @@
+static void
+update_obsoletes(const URPM__Package pkg, HV *obsoletes) {
+ if (pkg->h) {
+ struct rpmtd_s td;
+
+ /* update all provides */
+ if (headerGet(pkg->h, RPMTAG_OBSOLETENAME, &td, HEADERGET_DEFAULT)) {
+ unsigned int i;
+ for (i = 0; i < rpmtdCount(&td); ++i)
+ update_hash_entry(obsoletes, rpmtdNextString(&td), 0, 1, 0, pkg);
+ }
+ } else {
+ char *ps, *s;
+
+ if ((s = pkg->obsoletes) != NULL && *s != 0) {
+ char *es;
+
+ ps = strchr(s, '@');
+ while(ps != NULL) {
+ *ps = 0; es = strchr(s, '['); if (!es) es = strchr(s, ' '); *ps = '@';
+ update_hash_entry(obsoletes, s, es != NULL ? es-s : ps-s, 1, 0, pkg);
+ s = ps + 1; ps = strchr(s, '@');
+ }
+ es = strchr(s, '['); if (!es) es = strchr(s, ' ');
+ update_hash_entry(obsoletes, s, es != NULL ? es-s : 0, 1, 0, pkg);
+ }
+ }
+