- autorelocate ix86 package file paths on ia64.
CVS patchset: 6925
CVS date: 2003/07/02 19:26:04
AC_SUBST(MARK64)
dnl Determine the canonical arch-vendor-os for the build machine
+autorelocate_path='%{nil}'
case "${build_cpu}" in
*86) RPMCANONCOLOR=0; RPMCANONARCH=i386 ;;
x86_64*) RPMCANONCOLOR=3; RPMCANONARCH=x86_64 ;;
alpha*) RPMCANONCOLOR=0; RPMCANONARCH=alpha ;;
sparc*) RPMCANONCOLOR=0; RPMCANONARCH=sparc ;;
-ia64*) RPMCANONCOLOR=0; RPMCANONARCH=ia64 ;;
+ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64;
+ autorelocate_path='/emul/%%{ARCH}-%%{OS}' ;;
s390x*) RPMCANONCOLOR=3; RPMCANONARCH=s390x ;;
s390*) RPMCANONCOLOR=0; RPMCANONARCH=s390 ;;
powerpc64*|ppc64*) RPMCANONCOLOR=3; RPMCANONARCH=ppc64 ;;
esac
RPMCANONOS="$build_os_noversion"
AC_SUBST(RPMCANONCOLOR)
+AC_SUBST(autorelocate_path)
AC_SUBST(RPMCANONARCH)
AC_SUBST(RPMCANONVENDOR)
AC_SUBST(RPMCANONOS)
return finode;
}
+uint_32 rpmfiColor(rpmfi fi)
+{
+ uint_32 color = 0;
+
+ if (fi != NULL)
+ /* XXX ignore all but lsnibble for now. */
+ color = fi->color & 0xf;
+ return color;
+}
+
uint_32 rpmfiFColor(rpmfi fi)
{
- int_32 fcolor = 0;
+ uint_32 fcolor = 0;
if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) {
/*@-boundsread@*/
xx = hge(h, RPMTAG_FILESIZES, NULL, (void **) &fi->fsizes, NULL);
xx = hge(h, RPMTAG_FILECOLORS, NULL, (void **) &fi->fcolors, NULL);
+ fi->color = 0;
+ if (fi->fcolors != NULL)
+ for (i = 0; i < fi->fc; i++)
+ fi->color |= fi->fcolors[i];
xx = hge(h, RPMTAG_CLASSDICT, NULL, (void **) &fi->cdict, &fi->ncdict);
xx = hge(h, RPMTAG_FILECLASS, NULL, (void **) &fi->fcdictx, NULL);
if (ts != NULL)
if (fi != NULL)
if ((p = rpmtsRelocateElement(ts)) != NULL && rpmteType(p) == TR_ADDED) {
+ const char * fmt = rpmGetPath("%{?_autorelocate_path}", NULL);
+ const char * errstr;
+ char * newPath;
+ const char * march = NULL;
+ const char * harch = NULL;
Header foo;
+
+ /* XXX add os (or platform) checks. */
+ rpmGetArchInfo(&march, NULL);
+
+ /* XXX error handling. */
+ newPath = headerSprintf(h, fmt, rpmTagTable, rpmHeaderFormats, &errstr);
+ fmt = _free(fmt);
+
+ if (newPath != NULL && *newPath != '\0'
+ && hge(h, RPMTAG_ARCH, NULL, (void **) &harch, NULL)
+ && harch != NULL && !rpmMachineScore(RPM_MACHTABLE_INSTARCH, harch) )
+ {
+
+#if __ia64__
+ /* XXX On ia64, change leading /emul/ix86 -> /emul/ia32, ick. */
+ if (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
+ 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->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));
/*@owned@*/
FSM_t fsm; /*!< File state machine data. */
int keep_header; /*!< Keep header? */
+ uint_32 color; /*!< Color bit(s) from file color union. */
/*@owned@*/
sharedFileInfo replaced; /*!< (TR_ADDED) */
/*@owned@*/
/*@*/;
/**
+ * Return union of all file color bits from file info set.
+ * @param fi file info set
+ * @return current color
+ */
+uint_32 rpmfiColor(/*@null@*/ rpmfi fi)
+ /*@*/;
+
+/**
* Return current file color bits from file info set.
* @param fi file info set
- * @return current file color, 0 on invalid
+ * @return current file color
*/
uint_32 rpmfiFColor(/*@null@*/ rpmfi fi)
/*@*/;
p->epoch = NULL;
/*@=branchstate@*/
+ p->nrelocs = 0;
+ p->relocs = NULL;
if (relocs != NULL) {
rpmRelocation * r;
int i;
- for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++)
- {};
- p->relocs = xmalloc((i + 1) * sizeof(*p->relocs));
+ for (r = relocs; r->oldPath || r->newPath; r++)
+ p->nrelocs++;
+ p->relocs = xmalloc((p->nrelocs + 1) * sizeof(*p->relocs));
for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++) {
p->relocs[i].oldPath = r->oldPath ? xstrdup(r->oldPath) : NULL;
}
p->relocs[i].oldPath = NULL;
p->relocs[i].newPath = NULL;
- } else {
- p->relocs = NULL;
}
p->key = key;
fnpyKey key; /*!< (TR_ADDED) Retrieval key. */
/*@owned@*/ /*@null@*/
rpmRelocation * relocs; /*!< (TR_ADDED) Payload file relocations. */
+ int nrelocs; /*!< (TR_ADDED) No. of relocations. */
/*@refcounted@*/ /*@null@*/
FD_t fd; /*!< (TR_ADDED) Payload file descriptor. */
#/*! \page config_macros Default configuration: @RPMCONFIGDIR@/macros
# \verbatim
#
-# $Id: macros.in,v 1.138 2003/03/05 00:13:11 jbj Exp $
+# $Id: macros.in,v 1.139 2003/07/02 19:26:04 jbj Exp $
#
# This is a global RPM configuration file. All changes made here will
# be lost when the rpm package is upgraded. Any per-system configuration
# 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@
+
# 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.
rpm --rebuilddb
to convert your database from db1 to db3 format.
"
-# exit 1
+ exit 1
fi
/usr/sbin/groupadd -g 37 @RPMGROUP@ > /dev/null 2>&1
-/usr/sbin/useradd -r -d /var/lib/rpm -u 37 -g 37 @RPMUSER@ > /dev/null 2>&1
+/usr/sbin/useradd -r -d /var/lib/rpm -u 37 -g 37 @RPMUSER@ -s /sbin/nologin > /dev/null 2>&1
%endif
exit 0
%postun
/sbin/ldconfig
if [ $1 = 0 ]; then
- /usr/sbin/userdel rpm
- /usr/sbin/groupdel rpm
+ /usr/sbin/userdel @RPMUSER@
+ /usr/sbin/groupdel @RPMGROUP@
fi
exit 0
}
- if (!nocleanup) {
- olddb->db_remove_env = 1;
- newdb->db_remove_env = 1;
- }
xx = rpmdbClose(olddb);
xx = rpmdbClose(newdb);
#/*! \page config_rpmrc Default configuration: /usr/lib/rpm/rpmrc
# \verbatim
#
-# $Id: rpmrc.in,v 2.55 2003/05/30 16:58:13 jbj Exp $
+# $Id: rpmrc.in,v 2.56 2003/07/02 19:26:04 jbj Exp $
#
# This is a global RPM configuration file. All changes made here will
# be lost when the rpm package is upgraded. Any per-system configuration
arch_compat: s390: noarch
arch_compat: s390x: s390 noarch
-arch_compat: ia64: i686 noarch
+arch_compat: ia64: noarch
arch_compat: x86_64: athlon noarch