Compare commits
16 Commits
Author | SHA1 | Date |
---|---|---|
Fedora Release Engineering | 6c1e802ddd | |
Bill Nottingham | 0690827ddb | |
Jindrich Novy | d6db574554 | |
Panu Matilainen | 3dafc72374 | |
Panu Matilainen | 0f6310c569 | |
Panu Matilainen | 90e71786f6 | |
Tom Callaway | 8a0bbd692f | |
Tom Callaway | eede690687 | |
Panu Matilainen | 513005792c | |
Panu Matilainen | 4febce23b7 | |
Panu Matilainen | 3ec6422b5d | |
Panu Matilainen | c551cac350 | |
Panu Matilainen | 1b7b19069a | |
Panu Matilainen | 1db0fd7b1d | |
Jindrich Novy | 1dfb5bd421 | |
Jesse Keating | b475662908 |
|
@ -1 +0,0 @@
|
|||
rpm-4.6.0-rc1.tar.bz2
|
|
@ -0,0 +1 @@
|
|||
rpm-4.6.1.tar.bz2
|
21
Makefile
21
Makefile
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: rpm
|
||||
# $Id: Makefile,v 1.1 2004/09/09 11:49:39 cvsdist Exp $
|
||||
NAME := rpm
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attempt a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
|
@ -1 +0,0 @@
|
|||
rpm-4_5_90-0_git8444_1:HEAD:rpm-4.5.90-0.git8444.1.src.rpm:1217601763
|
|
@ -1,101 +0,0 @@
|
|||
diff --git a/lib/transaction.c b/lib/transaction.c
|
||||
index 7e432a3..42f1b12 100644
|
||||
--- a/lib/transaction.c
|
||||
+++ b/lib/transaction.c
|
||||
@@ -910,33 +910,51 @@ static int runTransScripts(rpmts ts, rpmTag stag)
|
||||
if (script == NULL && scriptprog == NULL)
|
||||
continue;
|
||||
|
||||
- p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_OPEN_FILE, 0, 0);
|
||||
- p->h = NULL;
|
||||
- if (rpmteFd(p) != NULL) {
|
||||
- rpmVSFlags ovsflags = rpmtsVSFlags(ts);
|
||||
- rpmVSFlags vsflags = ovsflags | RPMVSF_NEEDPAYLOAD;
|
||||
- rpmRC rpmrc;
|
||||
- ovsflags = rpmtsSetVSFlags(ts, vsflags);
|
||||
- rpmrc = rpmReadPackageFile(ts, rpmteFd(p),
|
||||
- rpmteNEVR(p), &p->h);
|
||||
- vsflags = rpmtsSetVSFlags(ts, ovsflags);
|
||||
- switch (rpmrc) {
|
||||
- default:
|
||||
- /* FIX: notify annotations */
|
||||
- p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
|
||||
- p->fd = NULL;
|
||||
- break;
|
||||
- case RPMRC_NOTTRUSTED:
|
||||
- case RPMRC_NOKEY:
|
||||
- case RPMRC_OK:
|
||||
- break;
|
||||
+ if (stag==RPMTAG_POSTTRANS) {
|
||||
+ /* get (already installed) header from rpmdb */
|
||||
+ rpmdbMatchIterator mi;
|
||||
+ mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(p), 0);
|
||||
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP,
|
||||
+ rpmteE(p));
|
||||
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_STRCMP,
|
||||
+ rpmteV(p));
|
||||
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP,
|
||||
+ rpmteR(p));
|
||||
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP,
|
||||
+ rpmteA(p));
|
||||
+
|
||||
+ p->h = headerCopy(rpmdbNextIterator(mi));
|
||||
+ mi = rpmdbFreeIterator(mi);
|
||||
+ } else {
|
||||
+ /* reread rpm file */
|
||||
+ p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_OPEN_FILE, 0, 0);
|
||||
+ p->h = NULL;
|
||||
+ if (rpmteFd(p) != NULL) {
|
||||
+ rpmVSFlags ovsflags = rpmtsVSFlags(ts);
|
||||
+ rpmVSFlags vsflags = ovsflags | RPMVSF_NEEDPAYLOAD;
|
||||
+ rpmRC rpmrc;
|
||||
+ ovsflags = rpmtsSetVSFlags(ts, vsflags);
|
||||
+ rpmrc = rpmReadPackageFile(ts, rpmteFd(p),
|
||||
+ rpmteNEVR(p), &p->h);
|
||||
+ vsflags = rpmtsSetVSFlags(ts, ovsflags);
|
||||
+ switch (rpmrc) {
|
||||
+ default:
|
||||
+ /* FIX: notify annotations */
|
||||
+ p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
|
||||
+ p->fd = NULL;
|
||||
+ break;
|
||||
+ case RPMRC_NOTTRUSTED:
|
||||
+ case RPMRC_NOKEY:
|
||||
+ case RPMRC_OK:
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
- }
|
||||
+ }
|
||||
|
||||
- if (rpmteFd(p) != NULL) {
|
||||
- fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1);
|
||||
+ if (p->h) {
|
||||
+ fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1);
|
||||
if (fi != NULL) { /* XXX can't happen */
|
||||
- if (stag == RPMTAG_PRETRANS) {
|
||||
+ if (stag == RPMTAG_PRETRANS) { /* isn't this the same? */
|
||||
fi->te = p;
|
||||
p->fi = fi;
|
||||
} else {
|
||||
@@ -944,14 +962,16 @@ static int runTransScripts(rpmts ts, rpmTag stag)
|
||||
p->fi->te = p;
|
||||
}
|
||||
}
|
||||
+ fi->h = p->h; // is this right?
|
||||
psm = rpmpsmNew(ts, p, p->fi);
|
||||
assert(psm != NULL);
|
||||
xx = rpmpsmScriptStage(psm, stag, progtag);
|
||||
psm = rpmpsmFree(psm);
|
||||
-
|
||||
- (void) rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
|
||||
- p->fd = NULL;
|
||||
- p->h = headerFree(p->h);
|
||||
+ if (p->fd != NULL) {
|
||||
+ (void) rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
|
||||
+ p->fd = NULL;
|
||||
+ }
|
||||
+ p->h = fi->h = headerFree(p->h);
|
||||
}
|
||||
}
|
||||
pi = rpmtsiFree(pi);
|
|
@ -0,0 +1,96 @@
|
|||
diff --git a/lib/tagexts.c b/lib/tagexts.c
|
||||
index 501d8ac..cf71639 100644
|
||||
--- a/lib/tagexts.c
|
||||
+++ b/lib/tagexts.c
|
||||
@@ -460,12 +460,6 @@ static int filerequireTag(Header h, rpmtd td)
|
||||
}
|
||||
|
||||
/* I18N look aside diversions */
|
||||
-
|
||||
-#if defined(ENABLE_NLS)
|
||||
-extern int _nl_msg_cat_cntr; /* XXX GNU gettext voodoo */
|
||||
-#endif
|
||||
-static const char * const language = "LANGUAGE";
|
||||
-
|
||||
static const char * const _macro_i18ndomains = "%{?_i18ndomains}";
|
||||
|
||||
/**
|
||||
@@ -477,63 +471,27 @@ static const char * const _macro_i18ndomains = "%{?_i18ndomains}";
|
||||
*/
|
||||
static int i18nTag(Header h, rpmTag tag, rpmtd td)
|
||||
{
|
||||
- char * dstring = rpmExpand(_macro_i18ndomains, NULL);
|
||||
- int rc;
|
||||
+ int rc = headerGet(h, tag, td, HEADERGET_ALLOC);
|
||||
+ if (rc) {
|
||||
+ char *de, *dstring = rpmExpand(_macro_i18ndomains, NULL);
|
||||
+ const char *domain;
|
||||
|
||||
- td->type = RPM_STRING_TYPE;
|
||||
- td->data = NULL;
|
||||
- td->count = 0;
|
||||
-
|
||||
- if (dstring && *dstring) {
|
||||
- char *domain, *de;
|
||||
- const char * langval;
|
||||
- char * msgkey;
|
||||
- const char * msgid;
|
||||
- const char * n;
|
||||
- int xx;
|
||||
-
|
||||
- xx = headerNVR(h, &n, NULL, NULL);
|
||||
- rasprintf(&msgkey, "%s(%s)", n, rpmTagGetName(tag));
|
||||
-
|
||||
- /* change to en_US for msgkey -> msgid resolution */
|
||||
- langval = getenv(language);
|
||||
- (void) setenv(language, "en_US", 1);
|
||||
-#if defined(ENABLE_NLS)
|
||||
- ++_nl_msg_cat_cntr;
|
||||
-#endif
|
||||
-
|
||||
- msgid = NULL;
|
||||
for (domain = dstring; domain != NULL; domain = de) {
|
||||
+ const char *msgid = td->data;
|
||||
+ const char *msg = NULL;
|
||||
+
|
||||
de = strchr(domain, ':');
|
||||
if (de) *de++ = '\0';
|
||||
- msgid = dgettext(domain, msgkey);
|
||||
- if (msgid != msgkey) break;
|
||||
- }
|
||||
-
|
||||
- /* restore previous environment for msgid -> msgstr resolution */
|
||||
- if (langval)
|
||||
- (void) setenv(language, langval, 1);
|
||||
- else
|
||||
- unsetenv(language);
|
||||
-#if defined(ENABLE_NLS)
|
||||
- ++_nl_msg_cat_cntr;
|
||||
-#endif
|
||||
-
|
||||
- if (domain && msgid) {
|
||||
- td->data = dgettext(domain, msgid);
|
||||
- td->data = xstrdup(td->data); /* XXX xstrdup has side effects. */
|
||||
- td->count = 1;
|
||||
- td->flags = RPMTD_ALLOCED;
|
||||
+ msg = dgettext(domain, td->data);
|
||||
+ if (msg != msgid) {
|
||||
+ free(td->data);
|
||||
+ td->data = xstrdup(msg);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
- dstring = _free(dstring);
|
||||
- free(msgkey);
|
||||
- if (td->data)
|
||||
- return 1;
|
||||
+ free(dstring);
|
||||
}
|
||||
-
|
||||
- dstring = _free(dstring);
|
||||
-
|
||||
- rc = headerGet(h, tag, td, HEADERGET_DEFAULT);
|
||||
+
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
diff -rNu rpm-4.6.0-orig/lib/rpmrc.c rpm-4.6.0/lib/rpmrc.c
|
||||
--- rpm-4.6.0-orig/lib/rpmrc.c 2009-03-09 21:54:49.000000000 -0500
|
||||
+++ rpm-4.6.0/lib/rpmrc.c 2009-03-11 12:00:44.000000000 -0500
|
||||
@@ -763,6 +763,31 @@
|
||||
return rc;
|
||||
}
|
||||
|
||||
+#if defined(__linux__) && defined(__sparc__)
|
||||
+static int is_sun4v()
|
||||
+{
|
||||
+ char buffer[4096], *p;
|
||||
+ int fd = open("/proc/cpuinfo", O_RDONLY);
|
||||
+ if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
|
||||
+ rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
|
||||
+ close(fd);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ close(fd);
|
||||
+
|
||||
+ p = strstr(buffer, "type");
|
||||
+ p = strtok(p, "\n");
|
||||
+ p = strstr(p, "sun");
|
||||
+ if (p == NULL) {
|
||||
+ rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'type' line\n"));
|
||||
+ return 0;
|
||||
+ } else if (strcmp(p, "sun4v") == 0) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
|
||||
# if defined(__linux__) && defined(__i386__)
|
||||
#include <setjmp.h>
|
||||
@@ -1179,6 +1204,13 @@
|
||||
personality(oldpers);
|
||||
}
|
||||
}
|
||||
+ if (is_sun4v()){
|
||||
+ if (strcmp(un.machine, "sparcv9") == 0 || strcmp(un.machine, "sparc") == 0 ) {
|
||||
+ strcpy(un.machine, "sparcv9v");
|
||||
+ } else if (strcmp(un.machine, "sparc64") == 0 ) {
|
||||
+ strcpy(un.machine, "sparc64v");
|
||||
+ }
|
||||
+ }
|
||||
# endif /* sparc*-linux */
|
||||
|
||||
# if defined(__GNUC__) && defined(__alpha__)
|
||||
diff -rNu rpm-4.6.0-orig/rpmrc.in rpm-4.6.0/rpmrc.in
|
||||
--- rpm-4.6.0-orig/rpmrc.in 2009-03-09 21:54:49.000000000 -0500
|
||||
+++ rpm-4.6.0/rpmrc.in 2009-03-11 11:50:49.000000000 -0500
|
||||
@@ -312,7 +312,7 @@
|
||||
arch_compat: sun4d: sparc
|
||||
arch_compat: sun4m: sparc
|
||||
arch_compat: sun4u: sparc64
|
||||
-arch_compat: sparc64v: sparc64
|
||||
+arch_compat: sparc64v: sparc64 sparcv9v
|
||||
arch_compat: sparc64: sparcv9
|
||||
arch_compat: sparcv9v: sparcv9
|
||||
arch_compat: sparcv9: sparcv8
|
|
@ -1,45 +0,0 @@
|
|||
commit 927f384a9bc058eb6f954e93cc515cc1293fd2a3
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Fri Oct 17 08:11:10 2008 +0300
|
||||
|
||||
Kick out the dumb defaultdocdir logic from installplatform
|
||||
- defaultdocdir is simply %{_datadir}/doc
|
||||
|
||||
diff --git a/installplatform b/installplatform
|
||||
index 8861df0..266d877 100755
|
||||
--- a/installplatform
|
||||
+++ b/installplatform
|
||||
@@ -8,12 +8,6 @@ RPMRC="${1:-rpmrc}"
|
||||
MACROS="${2:-macros}"
|
||||
PLATFORM="${3:-platform}"
|
||||
|
||||
-if grep /share/ $PLATFORM > /dev/null 2>&1 ; then
|
||||
- DEFAULTDOCDIR='%{_usr}/share/doc'
|
||||
-else
|
||||
- DEFAULTDOCDIR='%{_usr}/doc'
|
||||
-fi
|
||||
-
|
||||
TEMPRC="/tmp/rpmrc.$$"
|
||||
cat << E_O_F > $TEMPRC
|
||||
include: $RPMRC
|
||||
@@ -155,7 +149,6 @@ for SUBST in $SUBSTS ; do
|
||||
-e "s,@RPMRC_GNU@,$RPMRC_GNU," \
|
||||
-e "s,@LIB@,$LIB," \
|
||||
-e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
|
||||
- -e "s,@DEFAULTDOCDIR@,$DEFAULTDOCDIR," \
|
||||
-e '/\${\w*:-/!s,\${,%{_,' \
|
||||
-e "s,@ISANAME@,$ISANAME," \
|
||||
-e "s,@ISABITS@,$ISABITS," \
|
||||
diff --git a/platform.in b/platform.in
|
||||
index 4b496a0..9768a8a 100644
|
||||
--- a/platform.in
|
||||
+++ b/platform.in
|
||||
@@ -37,7 +37,7 @@
|
||||
# Deprecated misspelling, present for backwards compatibility.
|
||||
%_initrddir %{_initddir}
|
||||
|
||||
-%_defaultdocdir @DEFAULTDOCDIR@
|
||||
+%_defaultdocdir %{_datadir}/doc
|
||||
|
||||
%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
|
||||
&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
|
|
@ -1,20 +0,0 @@
|
|||
commit 81660b26bc8e2c03f55cf928955f7ed84e00785a
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Fri Oct 31 10:17:07 2008 +0200
|
||||
|
||||
Adjust for file output change (rhbz#468129)
|
||||
- file util used reported file details along with mime type, newer ones don't
|
||||
|
||||
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
|
||||
index 287c512..21366bf 100644
|
||||
--- a/scripts/find-debuginfo.sh
|
||||
+++ b/scripts/find-debuginfo.sh
|
||||
@@ -90,7 +90,7 @@ strip_to_debug()
|
||||
{
|
||||
local g=
|
||||
$strip_g && case "$(file -bi "$2")" in
|
||||
- application/x-sharedlib,*) g=-g ;;
|
||||
+ application/x-sharedlib*) g=-g ;;
|
||||
esac
|
||||
eu-strip --remove-comment $g -f "$1" "$2" || exit
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
diff --git a/lib/fprint.c b/lib/fprint.c
|
||||
index d31a694..b763a38 100644
|
||||
--- a/lib/fprint.c
|
||||
+++ b/lib/fprint.c
|
||||
@@ -183,16 +183,13 @@ unsigned int fpHashFunction(const void * key)
|
||||
{
|
||||
const fingerPrint * fp = key;
|
||||
unsigned int hash = 0;
|
||||
- char ch;
|
||||
- const char * chptr;
|
||||
+ int j;
|
||||
|
||||
- ch = 0;
|
||||
- chptr = fp->baseName;
|
||||
- while (*chptr != '\0') ch ^= *chptr++;
|
||||
+ hash = hashFunctionString(fp->baseName);
|
||||
+ if (fp->subDir) hash ^= hashFunctionString(fp->subDir);
|
||||
|
||||
- hash |= ((unsigned)ch) << 24;
|
||||
- hash |= (((((unsigned)fp->entry->dev) >> 8) ^ fp->entry->dev) & 0xFF) << 16;
|
||||
- hash |= fp->entry->ino & 0xFFFF;
|
||||
+ hash ^= ((unsigned)fp->entry->dev);
|
||||
+ for (j=0; j<4; j++) hash ^= ((fp->entry->ino >> (8*j)) & 0xFF) << ((3-j)*8);
|
||||
|
||||
return hash;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
commit a4825e488d44e01803c377ebc4fc054adcf42b3a
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Thu Oct 23 07:47:25 2008 +0300
|
||||
|
||||
Make noarch subpackages actually work
|
||||
- noarch subpackages get their arch tag from parsePreamble() already,
|
||||
don't stomp over it later in parseSpec()
|
||||
|
||||
diff --git a/build/parseSpec.c b/build/parseSpec.c
|
||||
index 098bd2b..11e0622 100644
|
||||
--- a/build/parseSpec.c
|
||||
+++ b/build/parseSpec.c
|
||||
@@ -592,7 +592,10 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootDir,
|
||||
}
|
||||
|
||||
headerPutString(pkg->header, RPMTAG_OS, os);
|
||||
- headerPutString(pkg->header, RPMTAG_ARCH, arch);
|
||||
+ /* noarch subpackages already have arch set here, leave it alone */
|
||||
+ if (!headerIsEntry(pkg->header, RPMTAG_ARCH)) {
|
||||
+ headerPutString(pkg->header, RPMTAG_ARCH, arch);
|
||||
+ }
|
||||
headerPutString(pkg->header, RPMTAG_PLATFORM, platform);
|
||||
|
||||
pkg->ds = rpmdsThis(pkg->header, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL);
|
|
@ -1,20 +0,0 @@
|
|||
commit 49c515179ac0d34c2bb43bf242b8eb27ff6c11b2
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Sun Oct 19 01:53:03 2008 +0300
|
||||
|
||||
Permit tab as whitespace between macro arguments (rhbz#467567)
|
||||
- another dumb regression from macro handling cleanups
|
||||
|
||||
diff --git a/rpmio/macro.c b/rpmio/macro.c
|
||||
index 1e292c6..d1cbf93 100644
|
||||
--- a/rpmio/macro.c
|
||||
+++ b/rpmio/macro.c
|
||||
@@ -798,7 +798,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
|
||||
char *s = xcalloc((lastc-se)+1, sizeof(*s));
|
||||
memcpy(s, se, (lastc-se));
|
||||
|
||||
- argvSplit(&av, s, " ");
|
||||
+ argvSplit(&av, s, " \t");
|
||||
argvAppend(&argv, av);
|
||||
|
||||
argvFree(av);
|
|
@ -1,83 +0,0 @@
|
|||
diff --git a/lib/depends.c b/lib/depends.c
|
||||
index 58aff31..810e909 100644
|
||||
--- a/lib/depends.c
|
||||
+++ b/lib/depends.c
|
||||
@@ -118,7 +118,7 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
|
||||
struct rpmtd_s td;
|
||||
const char * arch = NULL;
|
||||
const char * os = NULL;
|
||||
- rpmds oldChk, newChk;
|
||||
+ rpmds oldChk = NULL, newChk = NULL, sameChk = NULL;
|
||||
rpmds obsoletes;
|
||||
rpmalKey pkgKey; /* addedPackages key */
|
||||
int xx;
|
||||
@@ -151,10 +151,13 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
|
||||
}
|
||||
|
||||
oldChk = rpmdsThis(h, RPMTAG_REQUIRENAME, (RPMSENSE_LESS));
|
||||
- newChk = rpmdsThis(h, RPMTAG_REQUIRENAME, (RPMSENSE_EQUAL|RPMSENSE_GREATER));
|
||||
+ newChk = rpmdsThis(h, RPMTAG_REQUIRENAME, (RPMSENSE_GREATER));
|
||||
+ sameChk = rpmdsThis(h, RPMTAG_REQUIRENAME, (RPMSENSE_EQUAL));
|
||||
/* XXX can't use rpmtsiNext() filter or oc will have wrong value. */
|
||||
for (pi = rpmtsiInit(ts), oc = 0; (p = rpmtsiNext(pi, 0)) != NULL; oc++) {
|
||||
rpmds this;
|
||||
+ const char *pkgNEVR, *addNEVR;
|
||||
+ int skip = 0;
|
||||
|
||||
/* XXX Only added packages need be checked for dupes. */
|
||||
if (rpmteType(p) == TR_REMOVED)
|
||||
@@ -181,13 +184,20 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
|
||||
continue; /* XXX can't happen */
|
||||
|
||||
/*
|
||||
+ * Always skip identical NEVR.
|
||||
* On upgrade, if newer NEVR was previously added,
|
||||
* then skip adding older.
|
||||
*/
|
||||
- rc = rpmdsCompare(newChk, this);
|
||||
- if (upgrade && rc != 0) {
|
||||
- const char * pkgNEVR = rpmdsDNEVR(this);
|
||||
- const char * addNEVR = rpmdsDNEVR(oldChk);
|
||||
+ if (rpmdsCompare(sameChk, this)) {
|
||||
+ skip = 1;
|
||||
+ addNEVR = rpmdsDNEVR(sameChk);
|
||||
+ } else if (upgrade && rpmdsCompare(newChk, this)) {
|
||||
+ skip = 1;
|
||||
+ addNEVR = rpmdsDNEVR(newChk);
|
||||
+ }
|
||||
+
|
||||
+ if (skip) {
|
||||
+ pkgNEVR = rpmdsDNEVR(this);
|
||||
if (rpmIsVerbose())
|
||||
rpmlog(RPMLOG_WARNING,
|
||||
_("package %s was already added, skipping %s\n"),
|
||||
@@ -203,8 +213,8 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
|
||||
*/
|
||||
rc = rpmdsCompare(oldChk, this);
|
||||
if (upgrade && rc != 0) {
|
||||
- const char * pkgNEVR = rpmdsDNEVR(this);
|
||||
- const char * addNEVR = rpmdsDNEVR(newChk);
|
||||
+ pkgNEVR = rpmdsDNEVR(this);
|
||||
+ addNEVR = rpmdsDNEVR(newChk);
|
||||
if (rpmIsVerbose())
|
||||
rpmlog(RPMLOG_WARNING,
|
||||
_("package %s was already added, replacing with %s\n"),
|
||||
@@ -216,8 +226,6 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
|
||||
}
|
||||
}
|
||||
pi = rpmtsiFree(pi);
|
||||
- oldChk = rpmdsFree(oldChk);
|
||||
- newChk = rpmdsFree(newChk);
|
||||
|
||||
/* If newer NEVR was already added, exit now. */
|
||||
if (ec)
|
||||
@@ -353,6 +361,9 @@ addheader:
|
||||
ec = 0;
|
||||
|
||||
exit:
|
||||
+ oldChk = rpmdsFree(oldChk);
|
||||
+ newChk = rpmdsFree(newChk);
|
||||
+ sameChk = rpmdsFree(sameChk);
|
||||
pi = rpmtsiFree(pi);
|
||||
return ec;
|
||||
}
|
|
@ -1,8 +1,7 @@
|
|||
diff --git a/build/rpmfc.c b/build/rpmfc.c
|
||||
index 3cc2d6d..84d1e8a 100644
|
||||
--- a/build/rpmfc.c
|
||||
+++ b/build/rpmfc.c
|
||||
@@ -522,7 +522,7 @@ static const struct rpmfcTokens_s const rpmfcTokens[] = {
|
||||
diff -up rpm-4.6.1/build/rpmfc.c.devel-autodep rpm-4.6.1/build/rpmfc.c
|
||||
--- rpm-4.6.1/build/rpmfc.c.devel-autodep 2009-05-08 15:15:16.000000000 +0300
|
||||
+++ rpm-4.6.1/build/rpmfc.c 2009-05-18 14:15:47.000000000 +0300
|
||||
@@ -506,7 +506,7 @@ static const struct rpmfcTokens_s const
|
||||
{ "ASCII text", RPMFC_WHITE|RPMFC_INCLUDE },
|
||||
{ "ISO-8859 text", RPMFC_WHITE|RPMFC_INCLUDE },
|
||||
|
||||
|
@ -11,7 +10,7 @@ index 3cc2d6d..84d1e8a 100644
|
|||
{ "socket", RPMFC_DEVICE },
|
||||
{ "special", RPMFC_DEVICE },
|
||||
|
||||
@@ -683,6 +683,105 @@ rpmds rpmfcRequires(rpmfc fc)
|
||||
@@ -667,6 +667,105 @@ rpmds rpmfcRequires(rpmfc fc)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -117,15 +116,15 @@ index 3cc2d6d..84d1e8a 100644
|
|||
* Extract script dependencies.
|
||||
* @param fc file classifier
|
||||
* @return 0 on success
|
||||
@@ -1115,6 +1214,7 @@ static const struct rpmfcApplyTbl_s const rpmfcApplyTable[] = {
|
||||
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PKGCONFIG) },
|
||||
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_LIBTOOL) },
|
||||
{ rpmfcSCRIPT, RPMFC_MONO },
|
||||
+ { rpmfcSYMLINK, RPMFC_SYMLINK },
|
||||
@@ -1097,6 +1196,7 @@ static const struct rpmfcApplyTbl_s cons
|
||||
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_BOURNE|
|
||||
RPMFC_PERL|RPMFC_PYTHON|RPMFC_MONO|
|
||||
RPMFC_PKGCONFIG|RPMFC_LIBTOOL) },
|
||||
+ { rpmfcSYMLINK, RPMFC_SYMLINK },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
@@ -1135,6 +1235,7 @@ rpmRC rpmfcApply(rpmfc fc)
|
||||
@@ -1117,6 +1217,7 @@ rpmRC rpmfcApply(rpmfc fc)
|
||||
int ix;
|
||||
int i;
|
||||
int xx;
|
||||
|
@ -133,7 +132,7 @@ index 3cc2d6d..84d1e8a 100644
|
|||
|
||||
/* Generate package and per-file dependencies. */
|
||||
for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
|
||||
@@ -1185,11 +1286,13 @@ assert(se != NULL);
|
||||
@@ -1171,11 +1272,13 @@ rpmRC rpmfcApply(rpmfc fc)
|
||||
default:
|
||||
break;
|
||||
case 'P':
|
||||
|
@ -147,7 +146,7 @@ index 3cc2d6d..84d1e8a 100644
|
|||
ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags);
|
||||
dix = rpmdsFind(fc->requires, ds);
|
||||
ds = rpmdsFree(ds);
|
||||
@@ -1211,7 +1314,7 @@ assert(dix >= 0);
|
||||
@@ -1197,7 +1300,7 @@ assert(dix >= 0);
|
||||
previx = ix;
|
||||
xx = argiAdd(&fc->fddictx, ix, argiCount(fc->ddictx)-1);
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
diff --git a/scripts/pkgconfigdeps.sh b/scripts/pkgconfigdeps.sh
|
||||
index 6baa0f1..00cba00 100755
|
||||
--- a/scripts/pkgconfigdeps.sh
|
||||
+++ b/scripts/pkgconfigdeps.sh
|
||||
@@ -20,9 +20,12 @@ case $1 in
|
||||
DIR="`dirname ${filename}`"
|
||||
export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
|
||||
$pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do
|
||||
+ [ -n "$n" ] || continue
|
||||
# We have a dependency. Make a note that we need the pkgconfig
|
||||
# tool for this package.
|
||||
- echo "pkgconfig($n)" "$r" "$v"
|
||||
+ echo -n "pkgconfig($n) "
|
||||
+ [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"
|
||||
+ echo
|
||||
done
|
||||
;;
|
||||
esac
|
||||
@@ -34,8 +37,13 @@ case $1 in
|
||||
*.pc)
|
||||
i="`expr $i + 1`"
|
||||
[ $i -eq 1 ] && echo "$pkgconfig"
|
||||
+ DIR="`dirname ${filename}`"
|
||||
+ export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
|
||||
$pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
|
||||
- echo "pkgconfig($n)" "$r" "$v"
|
||||
+ [ -n "$n" ] || continue
|
||||
+ echo -n "pkgconfig($n) "
|
||||
+ [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"
|
||||
+ echo
|
||||
done
|
||||
esac
|
||||
done
|
|
@ -0,0 +1,424 @@
|
|||
diff --git a/build/pack.c b/build/pack.c
|
||||
index 523367b..c3b1245 100644
|
||||
--- a/build/pack.c
|
||||
+++ b/build/pack.c
|
||||
@@ -379,13 +379,20 @@ rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
|
||||
|
||||
if (strcmp(s+1, "gzdio") == 0) {
|
||||
compr = "gzip";
|
||||
+#if HAVE_BZLIB_H
|
||||
} else if (strcmp(s+1, "bzdio") == 0) {
|
||||
compr = "bzip2";
|
||||
/* Add prereq on rpm version that understands bzip2 payloads */
|
||||
(void) rpmlibNeedsFeature(h, "PayloadIsBzip2", "3.0.5-1");
|
||||
+#endif
|
||||
+#if HAVE_LZMA_H
|
||||
+ } else if (strcmp(s+1, "xzdio") == 0) {
|
||||
+ compr = "xz";
|
||||
+ (void) rpmlibNeedsFeature(h, "PayloadIsXz", "5.2-1");
|
||||
} else if (strcmp(s+1, "lzdio") == 0) {
|
||||
compr = "lzma";
|
||||
- (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.90-1");
|
||||
+ (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.6-1");
|
||||
+#endif
|
||||
} else {
|
||||
rpmlog(RPMLOG_ERR, _("Unknown payload compression: %s\n"),
|
||||
rpmio_flags);
|
||||
diff --git a/build/parsePrep.c b/build/parsePrep.c
|
||||
index 52f192e..c14af1c 100644
|
||||
--- a/build/parsePrep.c
|
||||
+++ b/build/parsePrep.c
|
||||
@@ -213,6 +213,9 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly)
|
||||
case COMPRESSED_LZMA:
|
||||
t = "%{__lzma} -dc";
|
||||
break;
|
||||
+ case COMPRESSED_XZ:
|
||||
+ t = "%{__xz} -dc";
|
||||
+ break;
|
||||
}
|
||||
zipper = rpmGetPath(t, NULL);
|
||||
if (needtar) {
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index a72dd3b..3c84b65 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -155,6 +155,7 @@ AC_SUBST(__ID_U)
|
||||
|
||||
AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
|
||||
AC_PATH_PROG(__LZMA, lzma, /usr/bin/lzma, $MYPATH)
|
||||
+AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH)
|
||||
AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
|
||||
AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH)
|
||||
AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH)
|
||||
@@ -224,7 +225,7 @@ AC_SUBST(WITH_BZ2_LIB)
|
||||
# Check for lzma library.
|
||||
|
||||
AC_CHECK_HEADERS([lzma.h],[
|
||||
- AC_CHECK_LIB(lzma, lzma_auto_decoder, [WITH_LZMA_LIB=-llzma])
|
||||
+ AC_CHECK_LIB(lzma, lzma_easy_encoder, [WITH_LZMA_LIB=-llzma])
|
||||
])
|
||||
AC_SUBST(WITH_LZMA_LIB)
|
||||
|
||||
diff --git a/lib/psm.c b/lib/psm.c
|
||||
index 9070c6d..d476d14 100644
|
||||
--- a/lib/psm.c
|
||||
+++ b/lib/psm.c
|
||||
@@ -1706,6 +1706,8 @@ assert(psm->mi == NULL);
|
||||
psm->rpmio_flags = "r.gzdio";
|
||||
if (!strcmp(payload_compressor, "bzip2"))
|
||||
psm->rpmio_flags = "r.bzdio";
|
||||
+ if (!strcmp(payload_compressor, "xz"))
|
||||
+ psm->rpmio_flags = "r.xzdio";
|
||||
if (!strcmp(payload_compressor, "lzma"))
|
||||
psm->rpmio_flags = "r.lzdio";
|
||||
rpmtdFreeData(&pc);
|
||||
diff --git a/lib/rpmds.c b/lib/rpmds.c
|
||||
index 6b59a6c..4f4b0cd 100644
|
||||
--- a/lib/rpmds.c
|
||||
+++ b/lib/rpmds.c
|
||||
@@ -984,9 +984,14 @@ static const struct rpmlibProvides_s rpmlibProvides[] = {
|
||||
(RPMSENSE_RPMLIB|RPMSENSE_EQUAL),
|
||||
N_("package payload can be compressed using bzip2.") },
|
||||
#endif
|
||||
- { "rpmlib(PayloadIsLzma)", "4.4.90-1",
|
||||
+#if HAVE_LZMA_H
|
||||
+ { "rpmlib(PayloadIsXz)", "5.2-1",
|
||||
+ (RPMSENSE_RPMLIB|RPMSENSE_EQUAL),
|
||||
+ N_("package payload can be compressed using xz.") },
|
||||
+ { "rpmlib(PayloadIsLzma)", "4.4.2-1",
|
||||
(RPMSENSE_RPMLIB|RPMSENSE_EQUAL),
|
||||
N_("package payload can be compressed using lzma.") },
|
||||
+#endif
|
||||
{ "rpmlib(PayloadFilesHavePrefix)", "4.0-1",
|
||||
(RPMSENSE_RPMLIB|RPMSENSE_EQUAL),
|
||||
N_("package payload file(s) have \"./\" prefix.") },
|
||||
diff --git a/macros.in b/macros.in
|
||||
index 28a048c..d0a4208 100644
|
||||
--- a/macros.in
|
||||
+++ b/macros.in
|
||||
@@ -47,6 +47,7 @@
|
||||
%__install @__INSTALL@
|
||||
%__ln_s @LN_S@
|
||||
%__lzma @__LZMA@
|
||||
+%__xz @__XZ@
|
||||
%__make @__MAKE@
|
||||
%__mkdir @__MKDIR@
|
||||
%__mkdir_p @MKDIR_P@
|
||||
@@ -322,7 +323,8 @@ package or when debugging this package.\
|
||||
# Compression type and level for source/binary package payloads.
|
||||
# "w9.gzdio" gzip level 9 (default).
|
||||
# "w9.bzdio" bzip2 level 9.
|
||||
-# "w7.lzdio" lzma level 7, lzma's default.
|
||||
+# "w7.xzdio" xz level 7, xz's default.
|
||||
+# "w7.lzdio" lzma-alone level 7, lzma's default
|
||||
#
|
||||
#%_source_payload w9.gzdio
|
||||
#%_binary_payload w9.gzdio
|
||||
diff --git a/rpm2cpio.c b/rpm2cpio.c
|
||||
index 6674a72..eabefa1 100644
|
||||
--- a/rpm2cpio.c
|
||||
+++ b/rpm2cpio.c
|
||||
@@ -78,6 +78,8 @@ int main(int argc, char *argv[])
|
||||
rpmio_flags = "r.gzdio";
|
||||
if (!strcmp(payload_compressor, "bzip2"))
|
||||
rpmio_flags = "r.bzdio";
|
||||
+ if (!strcmp(payload_compressor, "xz"))
|
||||
+ rpmio_flags = "r.xzdio";
|
||||
if (!strcmp(payload_compressor, "lzma"))
|
||||
rpmio_flags = "r.lzdio";
|
||||
rpmtdFreeData(&pc);
|
||||
diff --git a/rpmio/macro.c b/rpmio/macro.c
|
||||
index d1cbf93..9e7c3a5 100644
|
||||
--- a/rpmio/macro.c
|
||||
+++ b/rpmio/macro.c
|
||||
@@ -981,6 +981,9 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
|
||||
case COMPRESSED_LZMA:
|
||||
sprintf(be, "%%__lzma -dc %s", b);
|
||||
break;
|
||||
+ case COMPRESSED_XZ:
|
||||
+ sprintf(be, "%%__xz -dc %s", b);
|
||||
+ break;
|
||||
}
|
||||
b = be;
|
||||
} else if (STREQ("S", f, fn)) {
|
||||
diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c
|
||||
index de326e6..8286647 100644
|
||||
--- a/rpmio/rpmfileutil.c
|
||||
+++ b/rpmio/rpmfileutil.c
|
||||
@@ -353,11 +353,11 @@ int rpmFileIsCompressed(const char * file, rpmCompressedMagic * compressed)
|
||||
} else if ((magic[0] == 0120) && (magic[1] == 0113) &&
|
||||
(magic[2] == 0003) && (magic[3] == 0004)) { /* pkzip */
|
||||
*compressed = COMPRESSED_ZIP;
|
||||
- } else if ((magic[0] == 0xff) && (magic[1] == 0x4c) &&
|
||||
- (magic[2] == 0x5a) && (magic[3] == 0x4d) &&
|
||||
- (magic[4] == 0x41) && (magic[5] == 0x00)) {
|
||||
- /* new style lzma with magic */
|
||||
- *compressed = COMPRESSED_LZMA;
|
||||
+ } else if ((magic[0] == 0xfd) && (magic[1] == 0x37) &&
|
||||
+ (magic[2] == 0x7a) && (magic[3] == 0x58) &&
|
||||
+ (magic[4] == 0x5a) && (magic[5] == 0x00)) {
|
||||
+ /* new style xz (lzma) with magic */
|
||||
+ *compressed = COMPRESSED_XZ;
|
||||
} else if (((magic[0] == 0037) && (magic[1] == 0213)) || /* gzip */
|
||||
((magic[0] == 0037) && (magic[1] == 0236)) || /* old gzip */
|
||||
((magic[0] == 0037) && (magic[1] == 0036)) || /* pack */
|
||||
diff --git a/rpmio/rpmfileutil.h b/rpmio/rpmfileutil.h
|
||||
index 7f92cbc..c39abf1 100644
|
||||
--- a/rpmio/rpmfileutil.h
|
||||
+++ b/rpmio/rpmfileutil.h
|
||||
@@ -22,7 +22,8 @@ typedef enum rpmCompressedMagic_e {
|
||||
COMPRESSED_OTHER = 1, /*!< gzip can handle */
|
||||
COMPRESSED_BZIP2 = 2, /*!< bzip2 can handle */
|
||||
COMPRESSED_ZIP = 3, /*!< unzip can handle */
|
||||
- COMPRESSED_LZMA = 4 /*!< lzma can handle */
|
||||
+ COMPRESSED_LZMA = 4, /*!< lzma can handle */
|
||||
+ COMPRESSED_XZ = 5 /*!< xz can handle */
|
||||
} rpmCompressedMagic;
|
||||
|
||||
/** \ingroup rpmfileutil
|
||||
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
|
||||
index be9e99d..78a86c8 100644
|
||||
--- a/rpmio/rpmio.c
|
||||
+++ b/rpmio/rpmio.c
|
||||
@@ -36,7 +36,7 @@ extern int h_errno;
|
||||
#define FDONLY(fd) assert(fdGetIo(fd) == fdio)
|
||||
#define GZDONLY(fd) assert(fdGetIo(fd) == gzdio)
|
||||
#define BZDONLY(fd) assert(fdGetIo(fd) == bzdio)
|
||||
-#define LZDONLY(fd) assert(fdGetIo(fd) == lzdio)
|
||||
+#define LZDONLY(fd) assert(fdGetIo(fd) == xzdio || fdGetIo(fd) == lzdio)
|
||||
|
||||
#define UFDONLY(fd) /* assert(fdGetIo(fd) == ufdio) */
|
||||
|
||||
@@ -91,6 +91,7 @@ static const FDIO_t fpio;
|
||||
static const FDIO_t ufdio;
|
||||
static const FDIO_t gzdio;
|
||||
static const FDIO_t bzdio;
|
||||
+static const FDIO_t xzdio;
|
||||
static const FDIO_t lzdio;
|
||||
|
||||
/**
|
||||
@@ -140,6 +141,8 @@ static const char * fdbg(FD_t fd)
|
||||
sprintf(be, "BZD %p fdno %d", fps->fp, fps->fdno);
|
||||
#endif
|
||||
#if HAVE_LZMA_H
|
||||
+ } else if (fps->io == xzdio) {
|
||||
+ sprintf(be, "XZD %p fdno %d", fps->fp, fps->fdno);
|
||||
} else if (fps->io == lzdio) {
|
||||
sprintf(be, "LZD %p fdno %d", fps->fp, fps->fdno);
|
||||
#endif
|
||||
@@ -1158,7 +1161,7 @@ static const char * getFdErrstr (FD_t fd)
|
||||
} else
|
||||
#endif /* HAVE_BZLIB_H */
|
||||
#ifdef HAVE_LZMA_H
|
||||
- if (fdGetIo(fd) == lzdio) {
|
||||
+ if (fdGetIo(fd) == xzdio || fdGetIo(fd) == lzdio) {
|
||||
errstr = fd->errcookie;
|
||||
} else
|
||||
#endif /* HAVE_LZMA_H */
|
||||
@@ -1194,13 +1197,14 @@ typedef struct lzfile {
|
||||
|
||||
} LZFILE;
|
||||
|
||||
-static LZFILE *lzopen_internal(const char *path, const char *mode, int fd)
|
||||
+static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int xz)
|
||||
{
|
||||
- int level = 5;
|
||||
+ int level = 7; /* Use XZ's default compression level if unspecified */
|
||||
int encoding = 0;
|
||||
FILE *fp;
|
||||
LZFILE *lzfile;
|
||||
lzma_ret ret;
|
||||
+ lzma_stream init_strm = LZMA_STREAM_INIT;
|
||||
|
||||
for (; *mode; mode++) {
|
||||
if (*mode == 'w')
|
||||
@@ -1221,17 +1225,21 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd)
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
lzfile->file = fp;
|
||||
lzfile->encoding = encoding;
|
||||
lzfile->eof = 0;
|
||||
- lzfile->strm = LZMA_STREAM_INIT_VAR;
|
||||
+ lzfile->strm = init_strm;
|
||||
if (encoding) {
|
||||
- lzma_options_alone alone;
|
||||
- alone.uncompressed_size = LZMA_VLI_VALUE_UNKNOWN;
|
||||
- memcpy(&alone.lzma, &lzma_preset_lzma[level - 1], sizeof(alone.lzma));
|
||||
- ret = lzma_alone_encoder(&lzfile->strm, &alone);
|
||||
- } else {
|
||||
- ret = lzma_auto_decoder(&lzfile->strm, 0, 0);
|
||||
+ if (xz) {
|
||||
+ ret = lzma_easy_encoder(&lzfile->strm, level, LZMA_CHECK_SHA256);
|
||||
+ } else {
|
||||
+ lzma_options_lzma options;
|
||||
+ lzma_lzma_preset(&options, level);
|
||||
+ ret = lzma_alone_encoder(&lzfile->strm, &options);
|
||||
+ }
|
||||
+ } else { /* lzma_easy_decoder_memusage(level) is not ready yet, use hardcoded limit for now */
|
||||
+ ret = lzma_auto_decoder(&lzfile->strm, 100<<20, 0);
|
||||
}
|
||||
if (ret != LZMA_OK) {
|
||||
fclose(fp);
|
||||
@@ -1241,16 +1249,28 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd)
|
||||
return lzfile;
|
||||
}
|
||||
|
||||
+static LZFILE *xzopen(const char *path, const char *mode)
|
||||
+{
|
||||
+ return lzopen_internal(path, mode, -1, 1);
|
||||
+}
|
||||
+
|
||||
+static LZFILE *xzdopen(int fd, const char *mode)
|
||||
+{
|
||||
+ if (fd < 0)
|
||||
+ return 0;
|
||||
+ return lzopen_internal(0, mode, fd, 1);
|
||||
+}
|
||||
+
|
||||
static LZFILE *lzopen(const char *path, const char *mode)
|
||||
{
|
||||
- return lzopen_internal(path, mode, -1);
|
||||
+ return lzopen_internal(path, mode, -1, 0);
|
||||
}
|
||||
|
||||
static LZFILE *lzdopen(int fd, const char *mode)
|
||||
{
|
||||
if (fd < 0)
|
||||
return 0;
|
||||
- return lzopen_internal(0, mode, fd);
|
||||
+ return lzopen_internal(0, mode, fd, 0);
|
||||
}
|
||||
|
||||
static int lzflush(LZFILE *lzfile)
|
||||
@@ -1352,7 +1372,7 @@ static inline void * lzdFileno(FD_t fd)
|
||||
FDSANE(fd);
|
||||
for (i = fd->nfps; i >= 0; i--) {
|
||||
FDSTACK_t * fps = &fd->fps[i];
|
||||
- if (fps->io != lzdio)
|
||||
+ if (fps->io != xzdio && fps->io != lzdio)
|
||||
continue;
|
||||
rc = fps->fp;
|
||||
break;
|
||||
@@ -1361,6 +1381,33 @@ static inline void * lzdFileno(FD_t fd)
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static FD_t xzdOpen(const char * path, const char * mode)
|
||||
+{
|
||||
+ FD_t fd;
|
||||
+ LZFILE *lzfile;
|
||||
+ if ((lzfile = xzopen(path, mode)) == NULL)
|
||||
+ return NULL;
|
||||
+ fd = fdNew("open (xzdOpen)");
|
||||
+ fdPop(fd); fdPush(fd, xzdio, lzfile, -1);
|
||||
+ return fdLink(fd, "xzdOpen");
|
||||
+}
|
||||
+
|
||||
+static FD_t xzdFdopen(void * cookie, const char * fmode)
|
||||
+{
|
||||
+ FD_t fd = c2f(cookie);
|
||||
+ int fdno;
|
||||
+ LZFILE *lzfile;
|
||||
+
|
||||
+ if (fmode == NULL) return NULL;
|
||||
+ fdno = fdFileno(fd);
|
||||
+ fdSetFdno(fd, -1); /* XXX skip the fdio close */
|
||||
+ if (fdno < 0) return NULL;
|
||||
+ lzfile = xzdopen(fdno, fmode);
|
||||
+ if (lzfile == NULL) return NULL;
|
||||
+ fdPush(fd, xzdio, lzfile, fdno);
|
||||
+ return fdLink(fd, "xzdFdopen");
|
||||
+}
|
||||
+
|
||||
static FD_t lzdOpen(const char * path, const char * mode)
|
||||
{
|
||||
FD_t fd;
|
||||
@@ -1368,7 +1415,7 @@ static FD_t lzdOpen(const char * path, const char * mode)
|
||||
if ((lzfile = lzopen(path, mode)) == NULL)
|
||||
return NULL;
|
||||
fd = fdNew("open (lzdOpen)");
|
||||
- fdPop(fd); fdPush(fd, lzdio, lzfile, -1);
|
||||
+ fdPop(fd); fdPush(fd, xzdio, lzfile, -1);
|
||||
return fdLink(fd, "lzdOpen");
|
||||
}
|
||||
|
||||
@@ -1384,7 +1431,7 @@ static FD_t lzdFdopen(void * cookie, const char * fmode)
|
||||
if (fdno < 0) return NULL;
|
||||
lzfile = lzdopen(fdno, fmode);
|
||||
if (lzfile == NULL) return NULL;
|
||||
- fdPush(fd, lzdio, lzfile, fdno);
|
||||
+ fdPush(fd, xzdio, lzfile, fdno);
|
||||
return fdLink(fd, "lzdFdopen");
|
||||
}
|
||||
|
||||
@@ -1468,17 +1515,22 @@ static int lzdClose(void * cookie)
|
||||
|
||||
DBGIO(fd, (stderr, "==>\tlzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd)));
|
||||
|
||||
- if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "LZDIO", stderr);
|
||||
+ if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "XZDIO", stderr);
|
||||
if (rc == 0)
|
||||
fd = fdFree(fd, "open (lzdClose)");
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static struct FDIO_s xzdio_s = {
|
||||
+ lzdRead, lzdWrite, lzdSeek, lzdClose, NULL, NULL, NULL, fdFileno,
|
||||
+ NULL, xzdOpen, lzdFileno, lzdFlush
|
||||
+};
|
||||
+static const FDIO_t xzdio = &xzdio_s;
|
||||
+
|
||||
static struct FDIO_s lzdio_s = {
|
||||
lzdRead, lzdWrite, lzdSeek, lzdClose, NULL, NULL, NULL, fdFileno,
|
||||
NULL, lzdOpen, lzdFileno, lzdFlush
|
||||
};
|
||||
-
|
||||
static const FDIO_t lzdio = &lzdio_s;
|
||||
|
||||
#endif /* HAVE_LZMA_H */
|
||||
@@ -1716,6 +1768,9 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd));
|
||||
fd = bzdFdopen(fd, zstdio);
|
||||
#endif
|
||||
#if HAVE_LZMA_H
|
||||
+ } else if (!strcmp(end, "xzdio")) {
|
||||
+ iof = xzdio;
|
||||
+ fd = xzdFdopen(fd, zstdio);
|
||||
} else if (!strcmp(end, "lzdio")) {
|
||||
iof = lzdio;
|
||||
fd = lzdFdopen(fd, zstdio);
|
||||
@@ -1847,7 +1902,7 @@ int Fflush(FD_t fd)
|
||||
return bzdFlush(vh);
|
||||
#endif
|
||||
#if HAVE_LZMA_H
|
||||
- if (vh && fdGetIo(fd) == lzdio)
|
||||
+ if (vh && (fdGetIo(fd) == xzdio || fdGetIo(fd) == lzdio))
|
||||
return lzdFlush(vh);
|
||||
#endif
|
||||
/* FIXME: If we get here, something went wrong above */
|
||||
@@ -1876,9 +1931,9 @@ int Ferror(FD_t fd)
|
||||
i--; /* XXX fdio under bzdio always has fdno == -1 */
|
||||
#endif
|
||||
#if HAVE_LZMA_H
|
||||
- } else if (fps->io == lzdio) {
|
||||
+ } else if (fps->io == xzdio || fps->io == lzdio) {
|
||||
ec = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0;
|
||||
- i--; /* XXX fdio under lzdio always has fdno == -1 */
|
||||
+ i--; /* XXX fdio under xzdio/lzdio always has fdno == -1 */
|
||||
#endif
|
||||
} else {
|
||||
/* XXX need to check ufdio/gzdio/bzdio/fdio errors correctly. */
|
||||
diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h
|
||||
index 25c6d5b..a6a6252 100644
|
||||
--- a/rpmio/rpmio_internal.h
|
||||
+++ b/rpmio/rpmio_internal.h
|
||||
@@ -53,7 +53,7 @@ struct _FD_s {
|
||||
ssize_t bytesRemain; /* ufdio: */
|
||||
|
||||
int syserrno; /* last system errno encountered */
|
||||
- const void *errcookie; /* gzdio/bzdio/ufdio: */
|
||||
+ const void *errcookie; /* gzdio/bzdio/ufdio/xzdio: */
|
||||
|
||||
FDSTAT_t stats; /* I/O statistics */
|
||||
|
129
rpm.spec
129
rpm.spec
|
@ -1,5 +1,5 @@
|
|||
# rawhide doesn't have new enough lzma yet
|
||||
%bcond_with lzma
|
||||
# enable xz payload support
|
||||
%bcond_without xz
|
||||
# sqlite backend is broken atm, disabled for now
|
||||
%bcond_with sqlite
|
||||
# just for giggles, option to build with internal Berkeley DB
|
||||
|
@ -9,16 +9,15 @@
|
|||
|
||||
%define rpmhome /usr/lib/rpm
|
||||
|
||||
%define rpmver 4.6.0
|
||||
%define snapver rc1
|
||||
%define srcver %{rpmver}-%{snapver}
|
||||
%define rpmver 4.6.1
|
||||
%define srcver %{rpmver}
|
||||
|
||||
%define bdbver 4.5.20
|
||||
|
||||
Summary: The RPM package management system
|
||||
Name: rpm
|
||||
Version: %{rpmver}
|
||||
Release: 0.%{snapver}.7
|
||||
Release: 3%{?dist}
|
||||
Group: System Environment/Base
|
||||
Url: http://www.rpm.org/
|
||||
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
|
||||
|
@ -26,22 +25,22 @@ Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
|
|||
Source1: db-%{bdbver}.tar.gz
|
||||
%endif
|
||||
|
||||
Patch0: rpm-4.5.90-devel-autodep.patch
|
||||
Patch0: rpm-4.6.1-devel-autodep.patch
|
||||
Patch1: rpm-4.5.90-pkgconfig-path.patch
|
||||
Patch2: rpm-4.5.90-gstreamer-provides.patch
|
||||
# Fedora specspo is setup differently than what rpm expects, considering
|
||||
# this as Fedora-specific patch for now
|
||||
Patch3: rpm-4.6.0-fedora-specspo.patch
|
||||
|
||||
# XXX only create provides for pkgconfig and libtool initially
|
||||
Patch100: rpm-4.6.x-no-pkgconfig-reqs.patch
|
||||
|
||||
# Patches already in upstream
|
||||
Patch200: rpm-4.6.0-rc1-permit-tab.patch
|
||||
Patch201: rpm-4.6.0-rc1-skip-equal-nevr.patch
|
||||
Patch202: rpm-4.6.0-rc1-noarch-subpkg.patch
|
||||
Patch203: rpm-4.6.0-rc1-defaultdocdir.patch
|
||||
Patch204: rpm-4.6.0-rc1-fp-hash.patch
|
||||
Patch205: rpm-4.6.0-rc1-file-debuginfo.patch
|
||||
|
||||
# These are not yet upstream
|
||||
Patch300: rpm-4.5.90-posttrans.patch
|
||||
# Patches not yet upstream
|
||||
Patch300: rpm-4.6.0-niagara.patch
|
||||
Patch301: rpm-4.6.1-xz-support.patch
|
||||
Patch302: rpm-4.6.1-pkgconfig-nover.patch
|
||||
|
||||
# Partially GPL/LGPL dual-licensed and some bits with BSD
|
||||
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
|
||||
|
@ -49,7 +48,8 @@ License: GPLv2+
|
|||
|
||||
Requires(post): coreutils
|
||||
%if %{without int_bdb}
|
||||
Requires(post): compat-db45
|
||||
# normally db4-utils = %{bdbver} for the rpmdb_foo symlinks
|
||||
Requires: compat-db45
|
||||
%endif
|
||||
Requires: popt >= 1.10.2.1
|
||||
Requires: crontabs
|
||||
|
@ -79,8 +79,9 @@ BuildRequires: ncurses-devel
|
|||
BuildRequires: bzip2-devel >= 0.9.0c-2
|
||||
BuildRequires: python-devel >= 2.2
|
||||
BuildRequires: lua-devel >= 5.1
|
||||
%if %{with lzma}
|
||||
BuildRequires: lzma-devel >= 4.42
|
||||
%if %{with xz}
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: xz-devel >= 4.999.8
|
||||
%endif
|
||||
%if %{with sqlite}
|
||||
BuildRequires: sqlite-devel
|
||||
|
@ -114,8 +115,8 @@ Requires: nss-devel
|
|||
Requires: libselinux-devel
|
||||
Requires: elfutils-libelf-devel
|
||||
Requires: popt-devel
|
||||
%if %{with lzma}
|
||||
Requires: lzma-devel >= 4.42
|
||||
%if %{with xz}
|
||||
Requires: xz-devel >= 4.999.8
|
||||
%endif
|
||||
%if %{with sqlite}
|
||||
Requires: sqlite-devel
|
||||
|
@ -138,7 +139,7 @@ Group: Development/Tools
|
|||
Requires: rpm = %{version}-%{release}
|
||||
Requires: elfutils >= 0.128 binutils
|
||||
Requires: findutils sed grep gawk diffutils file patch >= 2.5
|
||||
Requires: unzip gzip bzip2 cpio lzma
|
||||
Requires: unzip gzip bzip2 cpio lzma xz
|
||||
|
||||
%description build
|
||||
The rpm-build package contains the scripts and executable programs
|
||||
|
@ -170,17 +171,14 @@ that will manipulate RPM packages and databases.
|
|||
%patch0 -p1 -b .devel-autodep
|
||||
%patch1 -p1 -b .pkgconfig-path
|
||||
%patch2 -p1 -b .gstreamer-prov
|
||||
%patch3 -p1 -b .fedora.specspo
|
||||
%patch100 -p1 -b .pkgconfig-deps
|
||||
|
||||
%patch200 -p1 -b .permit-tab
|
||||
%patch201 -p1 -b .skip-equal-nevr
|
||||
%patch202 -p1 -b .noarch-subpkg
|
||||
%patch203 -p1 -b .defaultdocdir
|
||||
%patch204 -p1 -b .fp-hash
|
||||
%patch205 -p1 -b .file-debuginfo
|
||||
|
||||
# needs a bit of upstream love first...
|
||||
#%patch300 -p1 -b .posttrans
|
||||
%patch300 -p1 -b .niagara
|
||||
%if %{with xz}
|
||||
%patch301 -p1 -b .xz
|
||||
%endif
|
||||
%patch302 -p1 -b .pkgconfig-nover
|
||||
|
||||
%if %{with int_bdb}
|
||||
ln -s db-%{bdbver} db
|
||||
|
@ -195,12 +193,16 @@ CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
|
|||
CFLAGS="$RPM_OPT_FLAGS"
|
||||
export CPPFLAGS CFLAGS LDFLAGS
|
||||
|
||||
%if %{with xz}
|
||||
autoconf
|
||||
%endif
|
||||
# Using configure macro has some unwanted side-effects on rpm platform
|
||||
# setup, use the old-fashioned way for now only defining minimal paths.
|
||||
./configure \
|
||||
--prefix=%{_usr} \
|
||||
--sysconfdir=%{_sysconfdir} \
|
||||
--localstatedir=%{_var} \
|
||||
--sharedstatedir=%{_var}/lib \
|
||||
--libdir=%{_libdir} \
|
||||
%{!?with_int_bdb: --with-external-db} \
|
||||
%{?with_sqlite: --enable-sqlite3} \
|
||||
|
@ -235,6 +237,18 @@ do
|
|||
touch $RPM_BUILD_ROOT/var/lib/rpm/$dbi
|
||||
done
|
||||
|
||||
# plant links to db utils as rpmdb_foo so existing documantion is usable
|
||||
%if %{without int_bdb}
|
||||
dbprefix=db45
|
||||
for dbutil in \
|
||||
archive deadlock dump load printlog \
|
||||
recover stat upgrade verify
|
||||
do
|
||||
ln -s ../../bin/${dbprefix}_${dbutil} $RPM_BUILD_ROOT/%{rpmhome}/rpmdb_${dbutil}
|
||||
done
|
||||
ln -s ../../bin/berkeley_${dbprefix}_svc $RPM_BUILD_ROOT/%{rpmhome}/rpmdb_svc
|
||||
%endif
|
||||
|
||||
%find_lang %{name}
|
||||
|
||||
find $RPM_BUILD_ROOT -name "*.la"|xargs rm -f
|
||||
|
@ -250,11 +264,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||
|
||||
%posttrans
|
||||
# XXX this is klunky and ugly, rpm itself should handle this
|
||||
%if %{with int_bdb}
|
||||
dbstat=/usr/lib/rpm/rpmdb_stat
|
||||
%else
|
||||
dbstat=%{_bindir}/db45_stat
|
||||
%endif
|
||||
if [ -x "$dbstat" ]; then
|
||||
if "$dbstat" -e -h /var/lib/rpm 2>&1 | grep -q "doesn't match environment version \| Invalid argument"; then
|
||||
rm -f /var/lib/rpm/__db.*
|
||||
|
@ -271,7 +281,7 @@ exit 0
|
|||
%dir %{_sysconfdir}/rpm
|
||||
|
||||
%attr(0755, root, root) %dir /var/lib/rpm
|
||||
%attr(0644, rpm, rpm) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/rpm/*
|
||||
%attr(0644, root, root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/rpm/*
|
||||
%attr(0755, root, root) %dir %{rpmhome}
|
||||
|
||||
/bin/rpm
|
||||
|
@ -368,6 +378,55 @@ exit 0
|
|||
%doc doc/librpm/html/*
|
||||
|
||||
%changelog
|
||||
* Tue Nov 03 2009 Jindrich Novy <jnovy@redhat.com> - 4.6.1-3
|
||||
- regenerate configure when xz support is enabled (#532503)
|
||||
|
||||
* Tue Sep 15 2009 Panu Matilainen <pmatilai@redhat.com> - 4.6.1-2
|
||||
- add support for XZ payloads and sources (#514480)
|
||||
- handle empty version in pkg-config files (#505351)
|
||||
|
||||
* Mon May 18 2009 Panu Matilainen <pmatilai@redhat.com> - 4.6.1-1
|
||||
- update to rpm 4.6.1 (http://rpm.org/wiki/Releases/4.6.1)
|
||||
- fixes #487855, #493157 and several others already fixed in F11/rawhide
|
||||
- drop patches merged upstream
|
||||
- eliminate bogus leftover rpm:rpm rpmdb ownership
|
||||
|
||||
* Thu Apr 2 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 4.6.0-4
|
||||
- actually apply niagara patch
|
||||
|
||||
* Thu Apr 2 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 4.6.0-3
|
||||
- Fix sparcv9v and sparc64v targets
|
||||
|
||||
* Thu Mar 12 2009 Panu Matilainen <pmatilai@redhat.com> - 4.6.0-2
|
||||
- handle NULL as EVR to rpmdsSingle() (#487881, #485616)
|
||||
- permit UTF-8 as first char of dependency names (#455119)
|
||||
- handle RSA V4 signatures (#436812)
|
||||
- add alpha arch ISA-bits
|
||||
|
||||
* Sat Feb 07 2009 Panu Matilainen <pmatilai@redhat.com>
|
||||
- update to 4.6.0 final: http://rpm.org/wiki/Releases/4.6.0, fixing
|
||||
#475582, #478907, #476737, #479869, #476201
|
||||
- change platform sharedstatedir to something more sensible (#185862)
|
||||
- fixup rpm translation lookup to match Fedora specspo (#436941)
|
||||
- add rpmdb_foo links to db utils for documentation compatibility
|
||||
|
||||
* Fri Dec 12 2008 Panu Matilainen <pmatilai@redhat.com>
|
||||
- update to 4.6.0-rc3
|
||||
- fixes segfault on oddball, legacy packages (#475214)
|
||||
- fixes segfault on package relocation (#468319)
|
||||
- fixes oddball package causing summary presented as list to python (#473239)
|
||||
- fixes segfault on some queryformat tag extensions (#474550)
|
||||
- fixes non-32bit integer type query formats, including --setperms (#471820)
|
||||
- read default popt files again (#473167)
|
||||
- remove extranuous slash in rpm.pc (#469355)
|
||||
- fixes memory fragmentation affecting especially yum (#472507)
|
||||
- fix build-time package size calculation wrt excludes and duplicates (#247374)
|
||||
- makes verification on multilib systems saner
|
||||
|
||||
* Mon Dec 01 2008 Jindrich Novy <jnovy@redhat.com>
|
||||
- include rpmfileutil.h from rpmmacro.h, unbreaks
|
||||
net-snmp (#473420)
|
||||
|
||||
* Fri Oct 31 2008 Panu Matilainen <pmatilai@redhat.com>
|
||||
- adjust find-debuginfo for "file" output change (#468129)
|
||||
|
||||
|
|
Loading…
Reference in New Issue