From 316c323e09dde1e5685121c2d5c7f213681d85a1 Mon Sep 17 00:00:00 2001 From: jbj Date: Mon, 5 Jul 2004 20:14:28 +0000 Subject: [PATCH] - ia64: auto-relocate glibc.ix86 interpreter path (#100563). CVS patchset: 7360 CVS date: 2004/07/05 20:14:28 --- lib/psm.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/psm.c b/lib/psm.c index b7026de..2d89eef 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -755,6 +755,38 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln, ? 1 : 0); } +#if __ia64__ + if (!strcmp(n, "glibc") + && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade")) + { + const char * fmt = rpmGetPath("%{?_autorelocate_path}", NULL); + const char * errstr; + char * newPath; + char * t; + + newPath = headerSprintf(h, fmt, rpmTagTable, rpmHeaderFormats, &errstr); + fmt = _free(fmt); + + /* XXX On ia64, change leading /emul/ix86 -> /emul/ia32, ick. */ + if (newPath != NULL && *newPath != '\0' + && strlen(newPath) >= (sizeof("/emul/i386")-1) + && newPath[0] == '/' && newPath[1] == 'e' && newPath[2] == 'm' + && newPath[3] == 'u' && newPath[4] == 'l' && newPath[5] == '/' + && newPath[6] == 'i' && newPath[8] == '8' && newPath[9] == '6') + { + newPath[7] = 'a'; + newPath[8] = '3'; + newPath[9] = '2'; + } + + t = alloca(strlen(newPath) + strlen(argv[0]) + 1); + *t = '\0'; + (void) stpcpy( stpcpy( stpcpy(t, newPath), "/"), argv[0]); + newPath = _free(newPath); + argv[0] = t; + } +#endif + if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (void **) &prefixes, &numPrefixes)) { freePrefixes = 1; } else if (hge(h, RPMTAG_INSTALLPREFIX, NULL, (void **) &oldPrefix, NULL)) { -- 2.7.4