1
Description: Add Fedora compatible rpm builtin provides
2
Origin: vendor, http://pkgs.fedoraproject.org/cgit/rpm.git/plain/rpm-4.10.90-rpmlib-filesystem-check.patch
11
+ * Temporary support for live-conversion of the filesystem hierarchy
12
+ * mailto: kay@redhat.com, harald@redhat.com
13
+ * https://fedoraproject.org/wiki/Features/UsrMove
15
+ * X-CheckUnifiedSystemdir:
16
+ * /bin, /sbin, /lib, /lib64 --> /usr
18
+ * X-CheckUnifiedBindir:
19
+ * /usr/sbin -> /usr/bin
21
+ * X-CheckMultiArchLibdir:
22
+ * /usr/lib64 /usr/lib/<platform tuple> (e.g. x86_64-linux-gnu)
24
+ * This code is not needed for new installations, it can be removed after
25
+ * updates from older systems are no longer supported: Fedora 19 / RHEL 8.
28
+static int CheckLink(const char *dir, const char *root)
37
+ rasprintf(&d, "%s%s", root, dir);
43
+ /* directory or symlink does not exist, all is fine */
44
+ if (lstat(d, &sbuf) < 0) {
49
+ /* if it is a symlink, all is fine */
50
+ if (S_ISLNK(sbuf.st_mode))
58
+static int CheckFilesystemHierarchy(rpmds * dsp, const char *root)
60
+ static const char *dirs[] = { "bin", "sbin", "lib", "lib64" };
64
+ rpmstrPool pool = rpmdsPool(*dsp);
67
+ for (i = 0; i < sizeof(dirs) / sizeof(dirs[0]); i++) {
68
+ check = CheckLink(dirs[i], root);
77
+ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME,
78
+ "rpmlib(X-CheckUnifiedSystemdir)", "1",
80
+ rpmdsMerge(dsp, ds);
83
+ check = CheckLink("usr/lib64", root);
89
+ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME,
90
+ "rpmlib(X-CheckMultiArchLibdir)", "1",
92
+ rpmdsMerge(dsp, ds);
96
+ check = CheckLink("usr/sbin", root);
102
+ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME,
103
+ "rpmlib(X-CheckUnifiedBindir)", "1",
105
+ rpmdsMerge(dsp, ds);
114
* Check dep for an unsatisfied dependency.
115
* @param ts transaction set
117
* Check those dependencies now.
119
if (dsflags & RPMSENSE_RPMLIB) {
120
- if (tsmem->rpmlib == NULL)
121
+ if (tsmem->rpmlib == NULL) {
122
rpmdsRpmlibPool(rpmtsPool(ts), &(tsmem->rpmlib), NULL);
123
+ CheckFilesystemHierarchy(&(tsmem->rpmlib), rpmtsRootDir(ts));
126
if (tsmem->rpmlib != NULL && rpmdsSearch(tsmem->rpmlib, dep) >= 0) {
127
rpmdsNotify(dep, "(rpmlib provides)", rc);