Lose unused patches

This commit is contained in:
Panu Matilainen 2009-04-09 12:47:35 +00:00
parent c859c6194d
commit ab91adcbd9
17 changed files with 0 additions and 835 deletions

View File

@ -1,158 +0,0 @@
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[] = {
{ "ASCII text", RPMFC_WHITE|RPMFC_INCLUDE },
{ "ISO-8859 text", RPMFC_WHITE|RPMFC_INCLUDE },
- { "symbolic link to", RPMFC_SYMLINK },
+ { "symbolic link to", RPMFC_SYMLINK|RPMFC_INCLUDE },
{ "socket", RPMFC_DEVICE },
{ "special", RPMFC_DEVICE },
@@ -683,6 +683,105 @@ rpmds rpmfcRequires(rpmfc fc)
/**
+ * Ensure that symlinks for shared libs generate a dep on the shared lib
+ * @param fc file classifier
+ * @return 0 on success
+ */
+static int rpmfcSYMLINK(rpmfc fc)
+{
+ const char * fn = fc->fn[fc->ix];
+ struct stat sb;
+ int fdno;
+
+ if (fc->skipReq)
+ return 0;
+
+ if (stat(fn, &sb) < 0)
+ return -1;
+ if (S_ISLNK(sb.st_mode))
+ return -1;
+
+ fdno = open(fn, O_RDONLY);
+ if (fdno < 0) {
+ return fdno;
+ }
+
+#if HAVE_GELF_H && HAVE_LIBELF
+ Elf * elf = NULL;
+ GElf_Ehdr ehdr_mem, * ehdr;
+ int isElf64 = 0;
+ int i, cnt;
+ char * soname = NULL;
+ rpmds ds;
+
+ (void) elf_version(EV_CURRENT);
+ elf = NULL;
+ if ((elf = elf_begin (fdno, ELF_C_READ_MMAP, NULL)) == NULL
+ || elf_kind(elf) != ELF_K_ELF
+ || (ehdr = gelf_getehdr(elf, &ehdr_mem)) == NULL
+ || ehdr->e_type != ET_DYN)
+ goto exit;
+
+/* alpha uses /lib, not /lib64 so don't add (64bit) deps */
+#if !defined(__alpha__)
+ isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64;
+#endif
+
+ for (i = 0; i < ehdr->e_phnum; ++i) {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
+ GElf_Shdr shdr_mem;
+ Elf_Data * data = NULL;
+ Elf_Scn * scn;
+ GElf_Shdr *shdr;
+
+ if (phdr == NULL || phdr->p_type != PT_DYNAMIC)
+ continue;
+
+ scn = gelf_offscn(elf, phdr->p_offset);
+ shdr = gelf_getshdr(scn, &shdr_mem);
+
+ if (shdr != NULL && shdr->sh_type == SHT_DYNAMIC)
+ data = elf_getdata (scn, NULL);
+ if (data == NULL)
+ continue;
+
+ for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) {
+ GElf_Dyn dynmem;
+ GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dynmem);
+ char *depname = NULL;
+
+ if (dyn == NULL)
+ break;
+ if (dyn->d_tag != DT_SONAME)
+ continue;
+
+ /* add the soname to package deps */
+ soname = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
+ if (soname == NULL)
+ break;
+
+ rasprintf(&depname, "%s%s", soname, isElf64 ? "()(64bit)" : "");
+ /* Add to package dependencies. */
+ ds = rpmdsSingle(RPMTAG_REQUIRENAME, depname, "",
+ RPMSENSE_FIND_REQUIRES);
+ free(depname);
+
+ rpmdsMerge(&fc->requires, ds);
+ rpmfcAddFileDep(&fc->ddict, fc->ix, ds);
+ ds = rpmdsFree(ds);
+ break;
+ }
+ }
+exit:
+ if (elf) (void) elf_end(elf);
+ close(fdno);
+ return 0;
+#endif
+ return -1;
+}
+
+/**
* 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 },
{ NULL, 0 }
};
@@ -1135,6 +1235,7 @@ rpmRC rpmfcApply(rpmfc fc)
int ix;
int i;
int xx;
+ int skipping = 0;
/* Generate package and per-file dependencies. */
for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
@@ -1185,11 +1286,13 @@ assert(se != NULL);
default:
break;
case 'P':
+ skipping = fc->skipProv;
ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags);
dix = rpmdsFind(fc->provides, ds);
ds = rpmdsFree(ds);
break;
case 'R':
+ skipping = fc->skipReq;
ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags);
dix = rpmdsFind(fc->requires, ds);
ds = rpmdsFree(ds);
@@ -1211,7 +1314,7 @@ assert(dix >= 0);
previx = ix;
xx = argiAdd(&fc->fddictx, ix, argiCount(fc->ddictx)-1);
}
- if (fc->fddictn && fc->fddictn->vals)
+ if (fc->fddictn && fc->fddictn->vals && !skipping)
fc->fddictn->vals[ix]++;
}

View File

@ -1,88 +0,0 @@
diff -up rpm-4.6.0/build/build.c.anyarch-actions-fix rpm-4.6.0/build/build.c
--- rpm-4.6.0/build/build.c.anyarch-actions-fix 2008-12-05 12:49:22.000000000 +0100
+++ rpm-4.6.0/build/build.c 2009-02-16 13:19:43.000000000 +0100
@@ -15,21 +15,18 @@ static int _build_debug = 0;
/**
*/
-static void doRmSource(rpmSpec spec)
+rpmRC doRmSource(rpmSpec spec)
{
struct Source *p;
Package pkg;
- int rc;
+ int rc = 0;
-#if 0
- rc = unlink(spec->specFile);
-#endif
-
for (p = spec->sources; p != NULL; p = p->next) {
if (! (p->flags & RPMBUILD_ISNO)) {
char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
rc = unlink(fn);
fn = _free(fn);
+ if (rc) goto exit;
}
}
@@ -39,9 +36,12 @@ static void doRmSource(rpmSpec spec)
char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
rc = unlink(fn);
fn = _free(fn);
+ if (rc) goto exit;
}
}
}
+exit:
+ return !rc ? RPMRC_OK : RPMRC_FAIL;
}
/*
diff -up rpm-4.6.0/build.c.anyarch-actions-fix rpm-4.6.0/build.c
--- rpm-4.6.0/build.c.anyarch-actions-fix 2008-12-05 12:49:16.000000000 +0100
+++ rpm-4.6.0/build.c 2009-02-16 13:19:43.000000000 +0100
@@ -240,6 +240,12 @@ static int buildForTarget(rpmts ts, cons
goto exit;
}
+ /* Don't parse spec if only its removal is requested */
+ if (ba->buildAmount == RPMBUILD_RMSPEC) {
+ rc = unlink(specFile);
+ goto exit;
+ }
+
/* Parse the spec file */
#define _anyarch(_f) \
(((_f)&(RPMBUILD_PREP|RPMBUILD_BUILD|RPMBUILD_INSTALL|RPMBUILD_PACKAGEBINARY)) == 0)
@@ -253,6 +259,13 @@ static int buildForTarget(rpmts ts, cons
goto exit;
}
+ if ( ba->buildAmount&RPMBUILD_RMSOURCE && !(ba->buildAmount&~(RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)) ) {
+ rc = doRmSource(spec);
+ if ( rc == RPMRC_OK && ba->buildAmount&RPMBUILD_RMSPEC )
+ rc = unlink(specFile);
+ goto exit;
+ }
+
/* Assemble source header from parsed components */
initSourceHeader(spec);
diff -up rpm-4.6.0/build/rpmbuild.h.anyarch-actions-fix rpm-4.6.0/build/rpmbuild.h
--- rpm-4.6.0/build/rpmbuild.h.anyarch-actions-fix 2008-12-05 12:49:22.000000000 +0100
+++ rpm-4.6.0/build/rpmbuild.h 2009-02-16 13:19:43.000000000 +0100
@@ -273,6 +273,13 @@ int parseExpressionBoolean(rpmSpec spec,
char * parseExpressionString(rpmSpec spec, const char * expr);
/** \ingroup rpmbuild
+ * Remove all sources assigned to spec file.
+ *
+ * @param spec spec file control structure
+ * @return RPMRC_OK on success
+ */
+rpmRC doRmSource(rpmSpec spec);
+/** \ingroup rpmbuild
* Run a build script, assembled from spec file scriptlet section.
*
* @param spec spec file control structure

View File

@ -1,83 +0,0 @@
diff -up rpm-4.6.0-rc4/build/rpmfc.c.extra-prov rpm-4.6.0-rc4/build/rpmfc.c
--- rpm-4.6.0-rc4/build/rpmfc.c.extra-prov 2009-02-04 15:18:05.000000000 +0200
+++ rpm-4.6.0-rc4/build/rpmfc.c 2009-02-04 15:20:46.000000000 +0200
@@ -485,6 +485,7 @@ static const struct rpmfcTokens_s const
{ "RPM v4", RPMFC_ARCHIVE|RPMFC_INCLUDE },
{ " image", RPMFC_IMAGE|RPMFC_INCLUDE },
+ { " font metrics", RPMFC_WHITE|RPMFC_INCLUDE },
{ " font", RPMFC_FONT|RPMFC_INCLUDE },
{ " Font", RPMFC_FONT|RPMFC_INCLUDE },
@@ -1189,6 +1190,31 @@ exit:
#endif
}
+static int rpmfcMISC(rpmfc fc)
+{
+ struct stat st;
+ int rc = -1;
+ const char *what = NULL;
+ const char * fn = fc->fn[fc->ix];
+ /* this part is enumerated, compare equality not bit flags */
+ int ftype = fc->fcolor->vals[fc->ix] & 0x000F0000;
+
+ if (ftype == RPMFC_FONT) {
+ what = "fontconfig";
+ } else if (ftype == RPMFC_TEXT && rpmFileHasSuffix(fn, ".desktop")) {
+ what = "desktop";
+ }
+
+ if (what == NULL || stat(fn, &st) < 0 || !S_ISREG(st.st_mode)) {
+ goto exit;
+ }
+
+ (void) rpmfcHelper(fc, 'P', what);
+ rc = 0;
+
+exit:
+ return rc;
+}
typedef const struct rpmfcApplyTbl_s {
int (*func) (rpmfc fc);
int colormask;
@@ -1198,12 +1224,11 @@ typedef const struct rpmfcApplyTbl_s {
*/
static const struct rpmfcApplyTbl_s const rpmfcApplyTable[] = {
{ rpmfcELF, RPMFC_ELF },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PKGCONFIG) },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_LIBTOOL) },
- { rpmfcSCRIPT, RPMFC_MONO },
- { rpmfcSYMLINK, RPMFC_SYMLINK },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_BOURNE|
+ RPMFC_PERL|RPMFC_PYTHON|RPMFC_MONO|
+ RPMFC_PKGCONFIG|RPMFC_LIBTOOL) },
+ { rpmfcMISC, RPMFC_FONT|RPMFC_TEXT },
+ { rpmfcSYMLINK, RPMFC_SYMLINK },
{ NULL, 0 }
};
@@ -1322,7 +1347,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t arg
size_t slen;
int fcolor;
int xx;
- int msflags = MAGIC_CHECK; /* XXX MAGIC_COMPRESS flag? */
+ int msflags = MAGIC_CHECK; /* add MAGIC_COMPRESS eventually */
magic_t ms = NULL;
if (fc == NULL || argv == NULL)
diff -up rpm-4.6.0-rc4/macros.in.extra-prov rpm-4.6.0-rc4/macros.in
--- rpm-4.6.0-rc4/macros.in.extra-prov 2009-02-04 15:18:05.000000000 +0200
+++ rpm-4.6.0-rc4/macros.in 2009-02-04 15:18:05.000000000 +0200
@@ -463,6 +463,9 @@ print (t)\
%__pkgconfig_provides @RPMCONFIGDIR@/pkgconfigdeps.sh --provides
%__pkgconfig_requires @RPMCONFIGDIR@/pkgconfigdeps.sh --requires
+%__fontconfig_provides /usr/lib/rpm/fontconfig.prov
+%__desktop_provides /usr/lib/rpm/desktop-file.prov
+
#==============================================================================
# ---- Database configuration macros.
# Macros used to configure Berkley db parameters.

View File

@ -1,40 +0,0 @@
diff -up rpm-4.6.0/build/parsePreamble.c.inherit-group rpm-4.6.0/build/parsePreamble.c
--- rpm-4.6.0/build/parsePreamble.c.inherit-group 2008-12-05 12:49:44.000000000 +0100
+++ rpm-4.6.0/build/parsePreamble.c 2009-02-16 12:43:41.000000000 +0100
@@ -900,20 +900,30 @@ int parsePreamble(rpmSpec spec, int init
goto exit;
}
- if (pkg == spec->packages)
+ /* It is the main package */
+ if (pkg == spec->packages) {
fillOutMainPackage(pkg->header);
+ /* Define group tag to something when group is undefined in main package*/
+ if (!headerIsEntry(pkg->header, RPMTAG_GROUP)) {
+ headerPutString(pkg->header, RPMTAG_GROUP, "Unspecified");
+ }
+ }
if (checkForDuplicates(pkg->header, NVR)) {
goto exit;
}
- if (pkg != spec->packages)
+ if (pkg != spec->packages) {
headerCopyTags(spec->packages->header, pkg->header,
(rpmTag *)copyTagsDuringParse);
-
- /* Many things expect group to always exist, put something in there... */
- if (!headerIsEntry(pkg->header, RPMTAG_GROUP)) {
- headerPutString(pkg->header, RPMTAG_GROUP, "Unspecified");
+ /* inherit group tag from the main package if unspecified */
+ if (!headerIsEntry(pkg->header, RPMTAG_GROUP)) {
+ struct rpmtd_s td;
+
+ headerGet(spec->packages->header, RPMTAG_GROUP, &td, HEADERGET_DEFAULT);
+ headerPut(pkg->header, &td, HEADERPUT_DEFAULT);
+ rpmtdFreeData(&td);
+ }
}
if (checkForRequired(pkg->header, NVR)) {

View File

@ -1,47 +0,0 @@
diff -up rpm-4.6.0/build/files.c.noarch-elf-check rpm-4.6.0/build/files.c
--- rpm-4.6.0/build/files.c.noarch-elf-check 2009-02-06 09:18:53.000000000 +0200
+++ rpm-4.6.0/build/files.c 2009-02-21 12:53:21.000000000 +0200
@@ -2174,17 +2174,27 @@ int processBinaryFiles(rpmSpec spec, int
check_fileList = newStringBuf();
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
- const char *n, *v, *r;
+ const char *n, *v, *r, *a;
if (pkg->fileList == NULL)
continue;
- (void) headerNVR(pkg->header, &n, &v, &r);
- rpmlog(RPMLOG_NOTICE, _("Processing files: %s-%s-%s\n"), n, v, r);
+ (void) headerNEVRA(pkg->header, &n, NULL, &v, &r, &a);
+ rpmlog(RPMLOG_NOTICE, _("Processing files: %s-%s-%s-%s\n"), n, v, r, a);
if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)) != RPMRC_OK ||
(rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
goto exit;
+
+ if (strcmp(a, "noarch") == 0 && headerGetColor(pkg->header) != 0) {
+ int terminate = rpmExpandNumeric("%{?_binaries_in_noarch_packages_terminate_build}");
+ rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING,
+ _("Arch dependent binaries in noarch package\n"));
+ if (terminate) {
+ rc = RPMRC_FAIL;
+ goto exit;
+ }
+ }
}
/* Now we have in fileList list of files from all packages.
diff -up rpm-4.6.0/macros.in.noarch-elf-check rpm-4.6.0/macros.in
--- rpm-4.6.0/macros.in.noarch-elf-check 2009-02-21 12:41:20.000000000 +0200
+++ rpm-4.6.0/macros.in 2009-02-21 12:41:20.000000000 +0200
@@ -375,6 +375,9 @@ package or when debugging this package.\
# Note: The default value should be 0 for legacy compatibility.
%_missing_doc_files_terminate_build 1
+# Should binaries in noarch packages terminate a build?
+%_binaries_in_noarch_packages_terminate_build 1
+
#
# Should an ELF file processed by find-debuginfo.sh having no build ID
# terminate a build? This is left undefined to disable it and defined to

View File

@ -1,20 +0,0 @@
commit 6ce7def270994a675836e2b945a7f70eb2b03c2b
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Mon Feb 2 14:17:27 2009 +0200
Prepend PKG_CONFIG_PATH on pkgconfig requires extraction too (rhbz#473814)
- similar to ab02fb183a441b6a30c863aebf49be992cd431fe but for requires
diff --git a/scripts/pkgconfigdeps.sh b/scripts/pkgconfigdeps.sh
index 6baa0f1..2251abe 100755
--- a/scripts/pkgconfigdeps.sh
+++ b/scripts/pkgconfigdeps.sh
@@ -34,6 +34,8 @@ 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"
done

View File

@ -1,17 +0,0 @@
diff -up rpm-4.6.0/scripts/brp-python-bytecompile.validate rpm-4.6.0/scripts/brp-python-bytecompile
--- rpm-4.6.0/scripts/brp-python-bytecompile.validate 2009-02-20 20:31:30.000000000 +0200
+++ rpm-4.6.0/scripts/brp-python-bytecompile 2009-02-20 20:31:37.000000000 +0200
@@ -20,7 +20,12 @@ if [ -z "$depth" -o "$depth" -le "1" ];
fi
# Generate normal (.pyc) byte-compiled files.
-$python -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1)' > /dev/null
+$python -c 'import compileall, sys; sys.exit (not compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1, quiet=1))'
+if [ $? != 0 ]; then
+ # One or more of the files has a syntax error.
+ exit 1
+fi
+
# Generate optimized (.pyo) byte-compiled files.
$python -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1)' > /dev/null

View File

@ -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`"; \\\

View File

@ -1,30 +0,0 @@
commit 3448b552964a526641d2e85b4ed27ebe3465f100
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Thu Feb 26 10:49:38 2009 +0200
Handle empty argv passed to rpmdsDupArgv()
- same as 94552b96256c3620b4be407c501d0d926c081963, apt-rpm expects to
pass empty version as NULL to rpmdsSingle()
diff --git a/lib/rpmds.c b/lib/rpmds.c
index 02b539c..bc829f4 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -508,15 +508,14 @@ const char ** rpmdsDupArgv(const char ** argv, int argc)
if (argv == NULL)
return NULL;
- for (ac = 0; ac < argc; ac++) {
-assert(argv[ac] != NULL);
+ for (ac = 0; ac < argc && argv[ac]; ac++) {
nb += strlen(argv[ac]) + 1;
}
nb += (ac + 1) * sizeof(*av);
av = xmalloc(nb);
t = (char *) (av + ac + 1);
- for (ac = 0; ac < argc; ac++) {
+ for (ac = 0; ac < argc && argv[ac]; ac++) {
av[ac] = t;
t = stpcpy(t, argv[ac]) + 1;
}

View File

@ -1,29 +0,0 @@
commit 58e92b976aebe43ebddbe2d2ec41bff0dd46b6fc
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Sat Feb 21 12:11:54 2009 +0200
Loosen up restrictions on dependency token names (rhbz#455119)
- Package names aren't restricted to ascii, no point restricting
dependency names either.
- This lets UTF-8 to go through but also all sorts of other junk but
as we haven't got a clue about the specs encoding, no can do. So we
only check for bad characters from plain ascii.
diff --git a/build/parseReqs.c b/build/parseReqs.c
index 54230c7..f2130ec 100644
--- a/build/parseReqs.c
+++ b/build/parseReqs.c
@@ -100,8 +100,11 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN,
Flags = (tagflags & ~RPMSENSE_SENSEMASK);
- /* Tokens must begin with alphanumeric, _, or / */
- if (!(risalnum(r[0]) || r[0] == '_' || r[0] == '/')) {
+ /*
+ * Tokens must begin with alphanumeric, _, or /, but we don't know
+ * the spec's encoding so we only check what we can: plain ascii.
+ */
+ if (isascii(r[0]) && !(risalnum(r[0]) || r[0] == '_' || r[0] == '/')) {
rpmlog(RPMLOG_ERR,
_("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s\n"),
spec->lineNum, spec->line);

View File

@ -1,22 +0,0 @@
commit 48c70edaa1ed3bab085cebea5749c812cee3109a
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Tue Mar 3 08:48:12 2009 +0200
Add ISA bits for alpha (Oliver Falk)
(cherry picked from commit d39a6c7de51c0d01ce69ee1f464b94ca70309751)
diff --git a/installplatform b/installplatform
index fded6f6..96919b6 100755
--- a/installplatform
+++ b/installplatform
@@ -109,6 +109,10 @@ for SUBST in $SUBSTS ; do
ISANAME=`echo ${ARCH} | sed "s/^\([^-]*\)-.*/\1/"`
ISABITS=32
;;
+ alpha*)
+ ISANAME=alpha
+ ISABITS=64
+ ;;
esac
case $VENDOR in

View File

@ -1,81 +0,0 @@
commit 4e77d95a7856216e49453009c855cce701734b9c
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Fri Apr 3 10:28:59 2009 +0300
Make sure installed files have state (rhbz#492947)
- rpmfsSetState() doesn't get called for skipped files like %ghost and
%config(noreplace), causing incorrect file state ("no state") getting
recorded in rpmdb, leading to inapproriate removal/rename on erase, ick
- For TR_ADDED, always default file states to RPMFILE_STATE_NORMAL, fsm
changes it as necessary for skipped colors and such. Lazy alloc on
rpmfsSetState() is not correct as rpmfsSetState() might not get called
at all.
- originally broken by commit 8d6c4b8c95b59f5a71d90c582c2e98f5c7ed7b9d
diff --git a/lib/fsm.c b/lib/fsm.c
index b892b03..752f0cc 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -663,8 +663,6 @@ static int fsmMapPath(FSM_t fsm)
break;
case FA_COPYIN:
case FA_CREATE:
- if (rpmteType(te) == TR_ADDED)
- rpmfsSetState(fs, i, RPMFILE_STATE_NORMAL);
break;
case FA_SKIPNSTATE:
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 6ff20f5..e1ef060 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -285,7 +285,7 @@ static void addTE(rpmts ts, rpmte p, Header h,
struct rpmtd_s bnames;
headerGet(h, RPMTAG_BASENAMES, &bnames, HEADERGET_MINMEM);
- p->fs = rpmfsNew(rpmtdCount(&bnames));
+ p->fs = rpmfsNew(rpmtdCount(&bnames), p->type);
rpmtdFreeData(&bnames);
}
@@ -896,11 +896,15 @@ rpmfs rpmteGetFileStates(rpmte te) {
return te->fs;
}
-rpmfs rpmfsNew(unsigned int fc) {
+rpmfs rpmfsNew(unsigned int fc, rpmElementType type) {
rpmfs fs = xmalloc(sizeof(*fs));
fs->fc = fc;
fs->replaced = NULL;
fs->states = NULL;
+ if (type == TR_ADDED) {
+ fs->states = xmalloc(sizeof(*fs->states) * fs->fc);
+ memset(fs->states, RPMFILE_STATE_NORMAL, fs->fc);
+ }
fs->actions = xmalloc(fc * sizeof(*fs->actions));
memset(fs->actions, FA_UNKNOWN, fc * sizeof(*fs->actions));
fs->numReplaced = fs->allocatedReplaced = 0;
@@ -958,10 +962,6 @@ sharedFileInfo rpmfsNextReplaced(rpmfs fs , sharedFileInfo replaced)
void rpmfsSetState(rpmfs fs, unsigned int ix, rpmfileState state)
{
assert(ix < fs->fc);
- if (fs->states == NULL) {
- fs->states = xmalloc(sizeof(*fs->states) * fs->fc);
- memset(fs->states, RPMFILE_STATE_MISSING, fs->fc);
- }
fs->states[ix] = state;
}
diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h
index 3ce4112..60c52bd 100644
--- a/lib/rpmte_internal.h
+++ b/lib/rpmte_internal.h
@@ -81,7 +81,7 @@ int rpmteHaveTransScript(rpmte te, rpmTag tag);
rpmfs rpmteGetFileStates(rpmte te);
RPM_GNUC_INTERNAL
-rpmfs rpmfsNew(unsigned int fc);
+rpmfs rpmfsNew(unsigned int fc, rpmElementType type);
RPM_GNUC_INTERNAL
rpmfs rpmfsFree(rpmfs fs);

View File

@ -1,68 +0,0 @@
commit 2b4507d852ac8469608bef2ce8e219d76b0c543e
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Mon Mar 9 14:48:47 2009 +0200
Fix RPMTAG_FILESTATES in rpmdb
- sizeof(rpmfileState) != sizeof(char), and char is what goes to headers
resulting in some pretty weird states despite being correct on disk
- add rpm_fstate_t type for the header presentation of states and
use where appropriate
diff --git a/lib/psm.c b/lib/psm.c
index 112d344..b493b33 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -1417,11 +1417,11 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
rpm_time_t installTime = (rpm_time_t) time(NULL);
rpmfs fs = rpmteGetFileStates(psm->te);
rpm_count_t fc = rpmfsFC(fs);
- rpmfileState * fileStates = rpmfsGetStates(fs);
+ rpm_fstate_t * fileStates = rpmfsGetStates(fs);
Header h = rpmteHeader(psm->te);
if (fileStates != NULL && fc > 0) {
- headerPutChar(h, RPMTAG_FILESTATES, (char *) fileStates, fc);
+ headerPutChar(h, RPMTAG_FILESTATES, fileStates, fc);
}
headerPutUint32(h, RPMTAG_INSTALLTIME, &installTime, 1);
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 130c1d9..bda5411 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -988,7 +988,7 @@ rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix)
return RPMFILE_STATE_MISSING;
}
-rpmfileState * rpmfsGetStates(rpmfs fs)
+rpm_fstate_t * rpmfsGetStates(rpmfs fs)
{
return fs->states;
}
diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h
index 5706d56..3ce4112 100644
--- a/lib/rpmte_internal.h
+++ b/lib/rpmte_internal.h
@@ -36,10 +36,12 @@ struct sharedFileInfo_s {
int otherFileNum;
};
+typedef char rpm_fstate_t;
+
struct rpmfs_s {
unsigned int fc;
- rpmfileState * states;
+ rpm_fstate_t * states;
rpmFileAction * actions; /*!< File disposition(s). */
sharedFileInfo replaced; /*!< (TR_ADDED) to be replaced files in the rpmdb */
@@ -106,7 +108,7 @@ rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix);
* May return NULL
*/
RPM_GNUC_INTERNAL
-rpmfileState * rpmfsGetStates(rpmfs fs);
+rpm_fstate_t * rpmfsGetStates(rpmfs fs);
RPM_GNUC_INTERNAL
rpmFileAction rpmfsGetAction(rpmfs fs, unsigned int ix);

View File

@ -1,22 +0,0 @@
commit cdcbd324fe41cd729434576200593c0fbda44a19
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Mon Mar 9 14:57:46 2009 +0200
Unbreak %_install_langs handling (rhbz#489235)
- using rpmfiFLangs() in skipFiles() broke the %_install_langs logic,
causing all files to be skipped if install langs, eek
diff --git a/lib/transaction.c b/lib/transaction.c
index 2940634..25a147a 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -488,7 +488,8 @@ static void skipFiles(const rpmts ts, rpmte p)
/*
* Skip i18n language specific files.
*/
- if (ts->installLangs != NULL && (flangs = rpmfiFLangs(fi)) != NULL) {
+ flangs = (ts->installLangs != NULL) ? rpmfiFLangs(fi) : NULL;
+ if (flangs != NULL && *flangs != '\0') {
const char *l, *le;
char **lang;
for (lang = ts->installLangs; *lang != NULL; lang++) {

View File

@ -1,32 +0,0 @@
commit 7a813e149fe40bbb9beee7dbf9898ab0c1906da2
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Sun Mar 8 11:33:22 2009 +0200
Load macros before creating directories (rhbz#489104)
- %_sourcedir and friends can have things like %{name}, load macros
before trying to create any directories when installing src.rpms
(cherry picked from commit ac7c3412278a03da6633758bca999827d4b59038)
diff --git a/lib/psm.c b/lib/psm.c
index 3b2fd7c..112d344 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -275,6 +275,9 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
if (rootdir && strcmp(rootdir, "/") == 0)
rootdir = NULL;
+ /* Macros need to be added before trying to create directories */
+ rpmInstallLoadMacros(h);
+
if (specix >= 0) {
const char *bn;
@@ -301,8 +304,6 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
goto exit;
}
- rpmInstallLoadMacros(h);
-
te = rpmtsElement(ts, 0);
if (te == NULL) { /* XXX can't happen */
goto exit;

View File

@ -1,19 +0,0 @@
diff -up rpm-4.7.0-beta1/build/rpmfc.c.rpmfc-order rpm-4.7.0-beta1/build/rpmfc.c
--- rpm-4.7.0-beta1/build/rpmfc.c.rpmfc-order 2009-03-24 09:41:33.000000000 +0200
+++ rpm-4.7.0-beta1/build/rpmfc.c 2009-03-24 09:41:44.000000000 +0200
@@ -452,7 +452,6 @@ static const struct rpmfcTokens_s const
{ "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE },
{ " script", RPMFC_SCRIPT },
- { " text", RPMFC_TEXT },
{ " document", RPMFC_DOCUMENT },
{ " compressed", RPMFC_COMPRESSED },
@@ -510,6 +509,7 @@ static const struct rpmfcTokens_s const
{ "symbolic link to", RPMFC_SYMLINK|RPMFC_INCLUDE },
{ "socket", RPMFC_DEVICE },
{ "special", RPMFC_DEVICE },
+ { " text", RPMFC_TEXT },
{ "ASCII", RPMFC_WHITE },
{ "ISO-8859", RPMFC_WHITE },

View File

@ -1,34 +0,0 @@
commit 452f162ef51d4c6484e93c2b0bc5866c10c8b734
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Wed Mar 4 13:08:30 2009 +0200
Handle V4 signature trailer for RSA too (ticket #34)
(cherry picked from commit d50db40ceed7083467f7b548da7b2fbe96aaec61)
diff --git a/lib/signature.c b/lib/signature.c
index feafc5e..9ca8da5 100644
--- a/lib/signature.c
+++ b/lib/signature.c
@@ -1194,17 +1194,16 @@ verifyRSASignature(rpmKeyring keyring, rpmtd sigtd, pgpDig dig, char ** msg,
if (sigp->hash != NULL)
xx = rpmDigestUpdate(ctx, sigp->hash, sigp->hashlen);
-#ifdef NOTYET /* XXX not for binary/text signatures as in packages. */
- if (!(sigp->sigtype == PGPSIGTYPE_BINARY || sigp->sigtype == PGP_SIGTYPE_TEXT)) {
- size_t nb = dig->nbytes + sigp->hashlen;
+ if (sigp->version == 4) {
+ /* V4 trailer is six octets long (rfc4880) */
uint8_t trailer[6];
+ uint32_t nb = sigp->hashlen;
nb = htonl(nb);
- trailer[0] = 0x4;
+ trailer[0] = sigp->version;
trailer[1] = 0xff;
- memcpy(trailer+2, &nb, sizeof(nb));
+ memcpy(trailer+2, &nb, 4);
xx = rpmDigestUpdate(ctx, trailer, sizeof(trailer));
}
-#endif
xx = rpmDigestFinal(ctx, (void **)&dig->md5, &dig->md5len, 0);