From: Panu Matilainen Date: Tue, 5 Feb 2008 08:08:44 +0000 (+0200) Subject: Rip the horrible (ia64) autorelocate kludgery. RIP. X-Git-Tag: tznext/4.11.0.1.tizen20130304~4645 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1ca3be052b4f0bbc417489c3f97a00323630469;p=tools%2Flibrpm-tizen.git Rip the horrible (ia64) autorelocate kludgery. RIP. - we don't support relocated x86 on ppc in qemu either... --- diff --git a/configure.ac b/configure.ac index 75e4980..f52bd34 100644 --- a/configure.ac +++ b/configure.ac @@ -990,8 +990,6 @@ else fi dnl Determine the canonical arch-vendor-os for the host machine -autorelocate_path='%{nil}' -autorelocate_dcolor='0' case "${host_cpu}" in *86) RPMCANONCOLOR=0; RPMCANONARCH=i386 ;; ia32e*) RPMCANONCOLOR=3; RPMCANONARCH=ia32e ;; @@ -1000,9 +998,7 @@ x86_64*) RPMCANONCOLOR=3; RPMCANONARCH=x86_64 ;; alpha*) RPMCANONCOLOR=0; RPMCANONARCH=alpha ;; sparc64*) RPMCANONCOLOR=3; RPMCANONARCH=sparc64 ;; sparc*) RPMCANONCOLOR=3; RPMCANONARCH=sparc ;; -ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64; - autorelocate_path='/emul/%%{ARCH}-%%{OS}' - autorelocate_dcolor='1' ;; +ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64 ;; s390x*) RPMCANONCOLOR=3; RPMCANONARCH=s390x ;; s390*) RPMCANONCOLOR=0; RPMCANONARCH=s390 ;; powerpc64*|ppc64*) RPMCANONCOLOR=3; RPMCANONARCH=ppc64 ;; @@ -1031,8 +1027,6 @@ esac RPMCANONOS="$host_os_noversion" RPMCANONGNU="$host_os_gnu" AC_SUBST(RPMCANONCOLOR) -AC_SUBST(autorelocate_path) -AC_SUBST(autorelocate_dcolor) AC_SUBST(RPMCANONARCH) AC_SUBST(RPMCANONVENDOR) AC_SUBST(RPMCANONOS) diff --git a/lib/psm.c b/lib/psm.c index 7c1b63c..aab0b36 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -682,39 +682,6 @@ static rpmRC runScript(rpmpsm psm, Header h, rpm_tag_t stag, ? 1 : 0); } -#if __ia64__ - /* 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")) - { - 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(t, newPath), argv[0]); - newPath = _free(newPath); - argv[0] = t; - } -#endif - if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (rpm_data_t *) &prefixes, &numPrefixes)) { freePrefixes = 1; } else if (hge(h, RPMTAG_INSTALLPREFIX, NULL, (rpm_data_t *) &oldPrefix, NULL)) { diff --git a/lib/rpmal.c b/lib/rpmal.c index a0956cd..7a47b6f 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -409,12 +409,6 @@ fprintf(stderr, "*** add %p[%d] 0x%x\n", al->list, (int) pkgNum, tscolor); { 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 /* XXX: reference to within rpmfi, must not be freed */ dieNeedle->dirName = (char *) DN; } diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 155201d..b1e0126 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -633,7 +633,6 @@ Header relocateFileList(const rpmts ts, rpmfi fi, uint32_t * dirIndexes; uint32_t * newDirIndexes; rpm_count_t fileCount, dirCount, numValid; - uint32_t mydColor = rpmExpandNumeric("%{?_autorelocate_dcolor}"); uint32_t * fFlags = NULL; uint32_t * fColors = NULL; uint32_t * dColors = NULL; @@ -954,11 +953,6 @@ dColors[j] |= fColors[i]; for (i = dirCount - 1; i >= 0; i--) { for (j = numRelocations - 1; j >= 0; j--) { - /* XXX Don't autorelocate uncolored directories. */ - if (j == p->autorelocatex - && (dColors[i] == 0 || !(dColors[i] & mydColor))) - continue; - if (relocations[j].oldPath == NULL) /* XXX can't happen */ continue; len = strcmp(relocations[j].oldPath, "/") @@ -1280,57 +1274,8 @@ if (fi->actions == NULL) && !headerIsSource(h) && !headerIsEntry(h, RPMTAG_ORIGBASENAMES)) { - char * fmt = rpmGetPath("%{?_autorelocate_path}", NULL); - const char * errstr; - char * newPath; Header foo; - /* XXX error handling. */ - newPath = headerSprintf(h, fmt, rpmTagTable, rpmHeaderFormats, &errstr); - fmt = _free(fmt); - -#if __ia64__ - /* 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'; - } -#endif - - /* XXX Make sure autoreloc is not already specified. */ - i = p->nrelocs; - if (newPath != NULL && *newPath != '\0' && p->relocs != NULL) - for (i = 0; i < p->nrelocs; i++) { -/* XXX {old,new}Path might be NULL */ - if (strcmp(p->relocs[i].oldPath, "/")) - continue; - if (strcmp(p->relocs[i].newPath, newPath)) - continue; - break; - } - - /* XXX test for incompatible arch triggering autorelocation is dumb. */ - if (newPath != NULL && *newPath != '\0' && i == p->nrelocs - && p->archScore == 0) - { - - p->relocs = - xrealloc(p->relocs, (p->nrelocs + 2) * sizeof(*p->relocs)); - p->relocs[p->nrelocs].oldPath = xstrdup("/"); - p->relocs[p->nrelocs].newPath = xstrdup(newPath); - p->autorelocatex = p->nrelocs; - p->nrelocs++; - p->relocs[p->nrelocs].oldPath = NULL; - p->relocs[p->nrelocs].newPath = NULL; - } - newPath = _free(newPath); - /* XXX DYING */ if (fi->actions == NULL) fi->actions = xcalloc(fi->fc, sizeof(*fi->actions)); diff --git a/lib/rpmte.c b/lib/rpmte.c index 48c1725..3de5d1e 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -155,7 +155,6 @@ static void addTE(rpmts ts, rpmte p, Header h, p->relocs[i].oldPath = NULL; p->relocs[i].newPath = NULL; } - p->autorelocatex = -1; p->key = key; p->fd = NULL; diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h index 95e43d9..2101b6d 100644 --- a/lib/rpmte_internal.h +++ b/lib/rpmte_internal.h @@ -60,7 +60,6 @@ struct rpmte_s { fnpyKey key; /*!< (TR_ADDED) Retrieval key. */ rpmRelocation * relocs; /*!< (TR_ADDED) Payload file relocations. */ int nrelocs; /*!< (TR_ADDED) No. of relocations. */ - int autorelocatex; /*!< (TR_ADDED) Auto relocation entry index. */ FD_t fd; /*!< (TR_ADDED) Payload file descriptor. */ union { diff --git a/macros.in b/macros.in index bc2138a..543e3bf 100644 --- a/macros.in +++ b/macros.in @@ -697,17 +697,6 @@ print (t)\ # 2 Elf64 permitted %_transaction_color @RPMCANONCOLOR@ -# A default autorelocation path prefixed to file paths of packages -# that have an incompatible arch. This is used on ia64 to prefix -# /emul/ia32 to i386 file paths, and nowhere else (yet). -# -# XXX Note: escaped %% for use in headerSprintf() -%_autorelocate_path @autorelocate_path@ - -# A default directory color to choose when directories are -# auto-relocated. -%_autorelocate_dcolor @autorelocate_dcolor@ - # The path to the dependency universe database. The default value # is the rpmdb-redhat location. The macro is usually defined in # /etc/rpm/macros.solve, installed with the rpmdb-redhat package. diff --git a/python/rpmts-py.c b/python/rpmts-py.c index 14ee42e..e88bfa1 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -414,10 +414,6 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb); p = rpmpsGetProblem(psi); - /* XXX autorelocated i386 on ia64, fix system-config-packages! */ - if (rpmProblemGetType(p) == RPMPROB_BADRELOCATE) - continue; - byName = strdup(rpmProblemGetPkgNEVR(p)); if ((byArch= strrchr(byName, '.')) != NULL) *byArch++ = '\0';