- ia64: auto-relocate entire, not partial, directory contents (#126905).
authorjbj <devnull@localhost>
Tue, 31 Aug 2004 15:39:37 +0000 (15:39 +0000)
committerjbj <devnull@localhost>
Tue, 31 Aug 2004 15:39:37 +0000 (15:39 +0000)
- ia64: auto-relocate glibc.ix86 interpreter path (#100563).
- shared libraries in separate rpm-libs package.
- fix: defattr for rpm-libs (#130461).
- fix: static glibc/libgcc helpers always installed (#127522).
- ia64: make sure that autorelocated file dependencies are satisfied.
- ia64: relocate all scriptlet interpreters.
- ia64: don't bother trying to preload autorelocated modules.
- fix: filesystem package needs mail/lock w/o getgrnam.
- fix: do getpwnam/getgrnam to load correct modules before chroot.

CVS patchset: 7415
CVS date: 2004/08/31 15:39:37

CHANGES
lib/psm.c
lib/rpmal.c
rpmio/ugid.c

diff --git a/CHANGES b/CHANGES
index 3cc008f..a6541ae 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -54,7 +54,6 @@
        - fix: escape '+' in regex patterns through RPMMIRE_DEFAULT (#103851).
        - RPMMIRE_DEFAULT is overkill, use RPMMIRE_STRCMP instead (#103851).
        - don't use mktemp if mkstemp is available (#103850).
-       - use -fPIC -DPIC on all platforms, not just mandatory (#112713).
        - python: return None for NEVRAO, [] for everything else.
        - python: throw exception on bad arg to labelCompare (#113661).
        - re-add --enable-posixmutexes to build.
        - change default behavior to resolve file conflicts as LIFO.
        - add --fileconflicts to recover rpm traditional behavior.
        - prefer elf64 over elf32 files, everywhere and always (#126853).
+       - ia64: auto-relocate entire, not partial, directory contents (#126905).
+       - ia64: auto-relocate glibc.ix86 interpreter path (#100563).
+       - shared libraries in separate rpm-libs package.
+       - fix: defattr for rpm-libs (#130461).
+       - fix: static glibc/libgcc helpers always installed (#127522).
+       - ia64: make sure that autorelocated file dependencies are satisfied.
+       - ia64: relocate all scriptlet interpreters.
+       - ia64: don't bother trying to preload autorelocated modules.
+       - fix: filesystem package needs mail/lock w/o getgrnam.
+       - fix: do getpwnam/getgrnam to load correct modules before chroot.
 
 4.2.1 -> 4.2.2:
        - unify signal handling in librpmio, use condvar to deliver signal.
        - find-debuginfo.sh: permit stripping unwritable by non-root (#112429).
        - missing build dependency (#111104).
        - spelling corrections (#112728).
+       - use -fPIC -DPIC on all platforms, not just mandatory (#112713).
        - popt: pad to display length, not strlen, for i18n popt args (#106240).
        - python: include Python.h before glibc features.h.
        - python: return [], not None, accessing header tags (#112794).
index 2d89eef..da52f21 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -706,6 +706,9 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln,
     FD_t out;
     rpmRC rc = RPMRC_OK;
     const char *n, *v, *r;
+#if __ia64__
+    const char *a;
+#endif
 
     if (progArgv == NULL && script == NULL)
        return rc;
@@ -719,6 +722,9 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln,
 
     /* XXX FIXME: except for %verifyscript, rpmteNEVR can be used. */
     xx = headerNVR(h, &n, &v, &r);
+#if __ia64__
+    xx = hge(h, RPMTAG_ARCH, NULL, (void **) &a, NULL);
+#endif
 
     /* XXX bash must have functional libtermcap.so.2 */
     if (!strcmp(n, "libtermcap"))
@@ -756,8 +762,9 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln,
     }
 
 #if __ia64__
-    if (!strcmp(n, "glibc")
-     && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade"))
+    /* XXX This assumes that all interpreters are elf executables. */
+    if ((a != NULL && a[0] == 'i' && a[1] != '\0' && a[2] == '8' && a[3] == '6')
+     && strcmp(argv[0], "/sbin/ldconfig"))
     {
        const char * fmt = rpmGetPath("%{?_autorelocate_path}", NULL);
        const char * errstr;
@@ -980,6 +987,8 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln,
 
     (void) psmWait(psm);
 
+  /* XXX filter order dependent multilib "other" arch helper error. */
+  if (!(psm->sq.reaped >= 0 && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade") && WEXITSTATUS(psm->sq.status) == 110)) {
     if (psm->sq.reaped < 0) {
        rpmError(RPMERR_SCRIPT,
                _("%s(%s-%s-%s) scriptlet failed, waitpid(%d) rc %d: %s\n"),
@@ -992,6 +1001,7 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln,
                sln, n, v, r, WEXITSTATUS(psm->sq.status));
        rc = RPMRC_FAIL;
     }
+  }
 
     if (freePrefixes) prefixes = hfd(prefixes, ipt);
 
@@ -2047,16 +2057,18 @@ psm->te->h = headerFree(psm->te->h);
        if (rootDir != NULL && !(rootDir[0] == '/' && rootDir[1] == '\0')
         && !rpmtsChrootDone(ts) && !psm->chrootDone)
        {
-           static int _loaded = 0;
+           static int _pw_loaded = 0;
+           static int _gr_loaded = 0;
 
-           /*
-            * This loads all of the name services libraries, in case we
-            * don't have access to them in the chroot().
-            */
-           if (!_loaded) {
+           if (!_pw_loaded) {
                (void)getpwnam("root");
                endpwent();
-               _loaded++;
+               _pw_loaded++;
+           }
+           if (!_gr_loaded) {
+               (void)getgrnam("root");
+               endgrent();
+               _gr_loaded++;
            }
 
            xx = chdir("/");
index 149beb2..f602310 100644 (file)
@@ -445,8 +445,18 @@ fprintf(stderr, "*** add %p[%d] 0x%x\n", al->list, pkgNum, tscolor);
            (void) rpmfiSetDX(fi, dx);
 
            /*@-assignexpose -dependenttrans -observertrans@*/
-           dieNeedle->dirName = (char *) rpmfiDN(fi);
+           {   const char * DN = rpmfiDN(fi);
+
+#if defined(__ia64__)
+/* XXX Make sure that autorelocated file dependencies are satisfied. */
+#define        DNPREFIX        "/emul/ia32-linux"
+               if (!strncmp(DN, DNPREFIX, sizeof(DNPREFIX)-1))
+                   DN += sizeof(DNPREFIX)-1;
+#endif
+               dieNeedle->dirName = DN;
+           }
            /*@=assignexpose =dependenttrans =observertrans@*/
+
            dieNeedle->dirNameLen = (dieNeedle->dirName != NULL
                        ? strlen(dieNeedle->dirName) : 0);
            die = bsearch(dieNeedle, al->dirs, origNumDirs,
index 697574a..65d31bc 100644 (file)
@@ -100,7 +100,18 @@ int gnameToGid(const char * thisGname, gid_t * gid)
            endgrent();
            /*@=internalglobs@*/
            grent = getgrnam(thisGname);
-           if (grent == NULL) return -1;
+           if (grent == NULL) {
+               /* XXX The filesystem package needs group/lock w/o getgrnam. */
+               if (strcmp(thisGname, "lock") == 0) {
+                   *gid = lastGid = 54;
+                   return 0;
+               } else
+               if (strcmp(thisGname, "mail") == 0) {
+                   *gid = lastGid = 12;
+                   return 0;
+               } else
+               return -1;
+           }
        }
        lastGid = grent->gr_gid;
     }