app-portage/portage-utils: fix compilation on Solaris
authorFabian Groffen <grobian@gentoo.org>
Sun, 14 Feb 2016 12:22:03 +0000 (13:22 +0100)
committerFabian Groffen <grobian@gentoo.org>
Sun, 14 Feb 2016 12:22:35 +0000 (13:22 +0100)
Package-Manager: portage-2.2.20-prefix

app-portage/portage-utils/files/portage-utils-0.61-solaris.patch [new file with mode: 0644]
app-portage/portage-utils/portage-utils-0.61.ebuild

diff --git a/app-portage/portage-utils/files/portage-utils-0.61-solaris.patch b/app-portage/portage-utils/files/portage-utils-0.61-solaris.patch
new file mode 100644 (file)
index 0000000..8bcc9c1
--- /dev/null
@@ -0,0 +1,27 @@
+qcache: work around missing d_type/DT_DIR
+
+--- qcache.c
++++ qcache.c
+@@ -750,13 +750,21 @@
+ 
+               xasprintf(&catpath, "%s/dep/%s", portedb, data->overlay);
+               dir = opendir(catpath);
+-              while ((de = readdir(dir)))
++              while ((de = readdir(dir))) {
++#ifndef DT_DIR
++                      struct stat s;
++                      if (stat(de->d_name, &s))
++                              continue;
++                      if (S_ISDIR(s.st_mode) && de->d_name[0] != '.') {
++#else
+                       if (de->d_type == DT_DIR && de->d_name[0] != '.') {
++#endif
+                               bool ok;
+                               allcats = add_set_unique(de->d_name, allcats, &ok);
+                               if (ok)
+                                       ++numcat;
+                       }
++              }
+               closedir(dir);
+               free(catpath);
+ 
index 205874bdf8b9651cef2c4c10794dcebc741fa5dd..1b266791166130538f37eb3b37e3a5c955989ec7 100644 (file)
@@ -22,6 +22,7 @@ DEPEND="${RDEPEND}
        static? ( dev-libs/iniparser:0[static-libs] )"
 
 src_prepare() {
+       epatch "${FILESDIR}"/${P}-solaris.patch
        epatch_user
 }