opkg_svn: fixed broken uname gname cache (this significantly speeds up)
authorhschang <chang@dev3>
Sun, 3 Feb 2013 12:40:52 +0000 (21:40 +0900)
committerhschang <chang@dev3>
Tue, 5 Feb 2013 02:02:19 +0000 (11:02 +0900)
meta-openvuplus/recipes-devtools/opkg/opkg/unarchive-fixed-uname-gname-cache.patch [new file with mode: 0644]
meta-openvuplus/recipes-devtools/opkg/opkg_svn.bbappend

diff --git a/meta-openvuplus/recipes-devtools/opkg/opkg/unarchive-fixed-uname-gname-cache.patch b/meta-openvuplus/recipes-devtools/opkg/opkg/unarchive-fixed-uname-gname-cache.patch
new file mode 100644 (file)
index 0000000..3a13a5b
--- /dev/null
@@ -0,0 +1,33 @@
+diff -Naur trunk.org/libbb/unarchive.c trunk/libbb/unarchive.c
+--- trunk.org/libbb/unarchive.c        2012-08-30 13:45:44.000000000 +0200
++++ trunk/libbb/unarchive.c    2012-09-13 11:50:57.822754393 +0200
+@@ -446,12 +446,12 @@
+       struct passwd *passwd;
+       if (!uname)
+               return FALSE;
+-      if (!uname_cache[0] && strcmp(uname_cache, uname) == 0)
++      if (!strcmp(uname_cache, uname))
+               return TRUE;
+       passwd = getpwnam(uname);
+       if (passwd) {
+               uid_cache = passwd->pw_uid;
+-              strncpy(uname, uname_cache, 32);
++              strncpy(uname_cache, uname, 32);
+               return TRUE;
+       }
+       return FALSE;
+@@ -464,12 +464,12 @@
+       struct group *group;
+       if (!gname)
+               return FALSE;
+-      if (!gname_cache[0] && strcmp(gname_cache, gname) == 0)
++      if (!strcmp(gname_cache, gname))
+               return TRUE;
+       group = getgrnam(gname);
+       if (group) {
+               gid_cache = group->gr_gid;
+-              strncpy(gname, gname_cache, 32);
++              strncpy(gname_cache, gname, 32);
+               return TRUE;
+       }
+       return FALSE;
index e5a54e4..76d0408 100644 (file)
@@ -1,4 +1,4 @@
-PR .= "-vuplus0"
+PR .= "-vuplus1"
 
 SRC_URI += "file://0001-Fixed-opkg-losing-auto_installed-flag-on-upgrading.patch \
             file://0002-Don-t-mark-Conflicts-as-Depends.patch \
 
 SRC_URI += "file://0001-Fixed-opkg-losing-auto_installed-flag-on-upgrading.patch \
             file://0002-Don-t-mark-Conflicts-as-Depends.patch \
@@ -9,6 +9,7 @@ SRC_URI += "file://0001-Fixed-opkg-losing-auto_installed-flag-on-upgrading.patch
             file://0007-pkg_hash_fetch_conflicts-move-iteration-over-conflic.patch \
             file://0008-pkg_hash_fetch_conflicts-take-into-account-conflicts.patch \
             file://0009-Revert-Add-Recommended-packages-to-the-depended_upon.patch \
             file://0007-pkg_hash_fetch_conflicts-move-iteration-over-conflic.patch \
             file://0008-pkg_hash_fetch_conflicts-take-into-account-conflicts.patch \
             file://0009-Revert-Add-Recommended-packages-to-the-depended_upon.patch \
-            file://0010-opkg_remove-auto-delete-.pyo-files.patch"
+            file://0010-opkg_remove-auto-delete-.pyo-files.patch \
+            file://unarchive-fixed-uname-gname-cache.patch"
 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"