Sync with rawhide to pull in various minor fixes:
- lose dangling symlink to extinct (and useless) berkeley_db_svc (#585174) - fix python match iterator regression wrt boolean representation (rpmlint) - support single PPD providing driver for devices (#568351), merge psdriver patches - preserve empty lines in spec prep section (#573339) - teach python bindings about RPMTRANS_FLAG_NOCONTEXTS (related to #573111) - dont own localized man directories through find_lang (#569536)
This commit is contained in:
parent
90f9e63a66
commit
644df007ba
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/scripts/find-lang.sh b/scripts/find-lang.sh
|
||||||
|
index bb25b31..e4a22db 100755
|
||||||
|
--- a/scripts/find-lang.sh
|
||||||
|
+++ b/scripts/find-lang.sh
|
||||||
|
@@ -173,7 +173,7 @@ s:%lang(C) ::
|
||||||
|
find $TOP_DIR -type d|sed '
|
||||||
|
s:'"$TOP_DIR"'::
|
||||||
|
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\)::
|
||||||
|
-'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
|
||||||
|
+'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1/*:
|
||||||
|
s:^\([^%].*\)::
|
||||||
|
s:%lang(C) ::
|
||||||
|
/^$/d' >> $MO_NAME
|
|
@ -0,0 +1,96 @@
|
||||||
|
commit 35052b96232810cbf0d91a4f1d1d3ff25a142fd0
|
||||||
|
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||||
|
Date: Mon Mar 15 11:54:55 2010 +0200
|
||||||
|
|
||||||
|
Add an enhanced argvSplitString() function for splitting strings to argv's
|
||||||
|
- Returns the newly created argv instead of useless "this always returns 0"
|
||||||
|
- By default make a "real" split, including empty strings
|
||||||
|
- Flags argument allows controlling behavior, for now only flag is to
|
||||||
|
preserve argvSplit() behavior but leaves room for future enhancements
|
||||||
|
such as quoted splitting etc
|
||||||
|
|
||||||
|
commit 12802c36c9a3b7260d9f788afc826b1cc5ee05e2
|
||||||
|
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||||
|
Date: Mon Mar 15 12:00:55 2010 +0200
|
||||||
|
|
||||||
|
Avoid eating empty lines in spec %prep section (RhBug:573339)
|
||||||
|
- In spec %prep context empty lines don't usually matter but they can
|
||||||
|
be significant in eg here-documents.
|
||||||
|
- Fixes regression from commit 94ff22b129aeb31c38848231e40f87aa4a5613a1
|
||||||
|
|
||||||
|
diff --git a/rpmio/argv.c b/rpmio/argv.c
|
||||||
|
index d633462..f21da1c 100644
|
||||||
|
--- a/rpmio/argv.c
|
||||||
|
+++ b/rpmio/argv.c
|
||||||
|
@@ -168,7 +168,7 @@ int argvAppend(ARGV_t * argvp, ARGV_const_t av)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
|
||||||
|
+ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags)
|
||||||
|
{
|
||||||
|
char *dest = xmalloc(strlen(str) + 1);
|
||||||
|
ARGV_t argv;
|
||||||
|
@@ -189,14 +189,22 @@ int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
|
||||||
|
argv = xmalloc( (argc + 1) * sizeof(*argv));
|
||||||
|
|
||||||
|
for (c = 0, s = dest; s < t; s+= strlen(s) + 1) {
|
||||||
|
- if (*s == '\0')
|
||||||
|
+ if (*s == '\0' && (flags & ARGV_SKIPEMPTY))
|
||||||
|
continue;
|
||||||
|
argv[c] = xstrdup(s);
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
argv[c] = NULL;
|
||||||
|
- *argvp = argv;
|
||||||
|
free(dest);
|
||||||
|
+ return argv;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* Backwards compatibility */
|
||||||
|
+int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
|
||||||
|
+{
|
||||||
|
+ if (argvp) {
|
||||||
|
+ *argvp = argvSplitString(str, seps, ARGV_SKIPEMPTY);
|
||||||
|
+ }
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/rpmio/argv.h b/rpmio/argv.h
|
||||||
|
index 6a6fc7f..86ec137 100644
|
||||||
|
--- a/rpmio/argv.h
|
||||||
|
+++ b/rpmio/argv.h
|
||||||
|
@@ -138,6 +138,20 @@ int argvAddNum(ARGV_t * argvp, int val);
|
||||||
|
*/
|
||||||
|
int argvAppend(ARGV_t * argvp, ARGV_const_t av);
|
||||||
|
|
||||||
|
+typedef enum argvFlags_e {
|
||||||
|
+ ARGV_NONE = 0,
|
||||||
|
+ ARGV_SKIPEMPTY = (1 << 0), /* omit empty strings from result */
|
||||||
|
+} argvFlags;
|
||||||
|
+
|
||||||
|
+/** \ingroup rpmargv
|
||||||
|
+ * Split a string into an argv array.
|
||||||
|
+ * @param str string arg to split
|
||||||
|
+ * @param seps seperator characters
|
||||||
|
+ * @param flags flags to control behavior
|
||||||
|
+ * @return argv array
|
||||||
|
+ */
|
||||||
|
+ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags);
|
||||||
|
+
|
||||||
|
/** \ingroup rpmargv
|
||||||
|
* Split a string into an argv array.
|
||||||
|
* @retval *argvp argv array
|
||||||
|
diff --git a/build/parsePrep.c b/build/parsePrep.c
|
||||||
|
index 8e10c00..394c162 100644
|
||||||
|
--- a/build/parsePrep.c
|
||||||
|
+++ b/build/parsePrep.c
|
||||||
|
@@ -522,7 +522,7 @@ int parsePrep(rpmSpec spec)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- argvSplit(&saveLines, getStringBuf(sb), "\n");
|
||||||
|
+ saveLines = argvSplitString(getStringBuf(sb), "\n", ARGV_NONE);
|
||||||
|
for (lines = saveLines; *lines; lines++) {
|
||||||
|
res = 0;
|
||||||
|
if (rstreqn(*lines, "%setup", sizeof("%setup")-1)) {
|
|
@ -1,6 +1,6 @@
|
||||||
diff -up rpm-4.8.0/build/rpmfc.c.postscriptdriver rpm-4.8.0/build/rpmfc.c
|
diff -up rpm-4.8.0/build/rpmfc.c.psdriver rpm-4.8.0/build/rpmfc.c
|
||||||
--- rpm-4.8.0/build/rpmfc.c.postscriptdriver 2010-02-04 12:00:09.802558577 +0000
|
--- rpm-4.8.0/build/rpmfc.c.psdriver 2010-03-16 10:54:04.000000000 +0200
|
||||||
+++ rpm-4.8.0/build/rpmfc.c 2010-02-04 12:00:09.894684178 +0000
|
+++ rpm-4.8.0/build/rpmfc.c 2010-03-16 10:54:04.000000000 +0200
|
||||||
@@ -489,6 +489,7 @@ static const struct rpmfcTokens_s const
|
@@ -489,6 +489,7 @@ static const struct rpmfcTokens_s const
|
||||||
{ " font metrics", RPMFC_WHITE|RPMFC_INCLUDE },
|
{ " font metrics", RPMFC_WHITE|RPMFC_INCLUDE },
|
||||||
{ " font", RPMFC_FONT|RPMFC_INCLUDE },
|
{ " font", RPMFC_FONT|RPMFC_INCLUDE },
|
||||||
|
@ -52,9 +52,9 @@ diff -up rpm-4.8.0/build/rpmfc.c.postscriptdriver rpm-4.8.0/build/rpmfc.c
|
||||||
/* XXX skip all files in /dev/ which are (or should be) %dev dummies. */
|
/* XXX skip all files in /dev/ which are (or should be) %dev dummies. */
|
||||||
else if (slen >= fc->brlen+sizeof("/dev/") && rstreqn(s+fc->brlen, "/dev/", sizeof("/dev/")-1))
|
else if (slen >= fc->brlen+sizeof("/dev/") && rstreqn(s+fc->brlen, "/dev/", sizeof("/dev/")-1))
|
||||||
ftype = "";
|
ftype = "";
|
||||||
diff -up rpm-4.8.0/build/rpmfc.h.postscriptdriver rpm-4.8.0/build/rpmfc.h
|
diff -up rpm-4.8.0/build/rpmfc.h.psdriver rpm-4.8.0/build/rpmfc.h
|
||||||
--- rpm-4.8.0/build/rpmfc.h.postscriptdriver 2009-12-09 13:37:25.000000000 +0000
|
--- rpm-4.8.0/build/rpmfc.h.psdriver 2009-12-09 15:37:25.000000000 +0200
|
||||||
+++ rpm-4.8.0/build/rpmfc.h 2010-02-04 12:00:09.894684178 +0000
|
+++ rpm-4.8.0/build/rpmfc.h 2010-03-16 10:54:04.000000000 +0200
|
||||||
@@ -31,7 +31,8 @@ enum FCOLOR_e {
|
@@ -31,7 +31,8 @@ enum FCOLOR_e {
|
||||||
#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
|
#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
|
||||||
/* (1 << 3) leaks into package headers, reserved */
|
/* (1 << 3) leaks into package headers, reserved */
|
||||||
|
@ -73,20 +73,20 @@ diff -up rpm-4.8.0/build/rpmfc.h.postscriptdriver rpm-4.8.0/build/rpmfc.h
|
||||||
|
|
||||||
RPMFC_ARCHIVE = (1 << 20),
|
RPMFC_ARCHIVE = (1 << 20),
|
||||||
RPMFC_COMPRESSED = (1 << 21),
|
RPMFC_COMPRESSED = (1 << 21),
|
||||||
diff -up rpm-4.8.0/macros.in.postscriptdriver rpm-4.8.0/macros.in
|
diff -up rpm-4.8.0/macros.in.psdriver rpm-4.8.0/macros.in
|
||||||
--- rpm-4.8.0/macros.in.postscriptdriver 2010-02-04 12:00:09.776559914 +0000
|
--- rpm-4.8.0/macros.in.psdriver 2010-03-16 10:54:04.000000000 +0200
|
||||||
+++ rpm-4.8.0/macros.in 2010-02-04 12:00:09.904559096 +0000
|
+++ rpm-4.8.0/macros.in 2010-03-16 10:54:04.000000000 +0200
|
||||||
@@ -504,6 +504,7 @@ print (t)\
|
@@ -504,6 +504,7 @@ print (t)\
|
||||||
|
|
||||||
%__fontconfig_provides %{_rpmconfigdir}/fontconfig.prov
|
%__fontconfig_provides %{_rpmconfigdir}/fontconfig.prov
|
||||||
%__desktop_provides %{_rpmconfigdir}/desktop-file.prov
|
%__desktop_provides %{_rpmconfigdir}/desktop-file.prov
|
||||||
+%__psdriver_provides %{_rpmconfigdir}/postscriptdriver.prov
|
+%__psdriver_provides %{_rpmconfigdir}/postscriptdriver.prov %{buildroot}
|
||||||
|
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# ---- Database configuration macros.
|
# ---- Database configuration macros.
|
||||||
diff -up rpm-4.8.0/scripts/Makefile.am.postscriptdriver rpm-4.8.0/scripts/Makefile.am
|
diff -up rpm-4.8.0/scripts/Makefile.am.psdriver rpm-4.8.0/scripts/Makefile.am
|
||||||
--- rpm-4.8.0/scripts/Makefile.am.postscriptdriver 2009-12-07 14:36:49.000000000 +0000
|
--- rpm-4.8.0/scripts/Makefile.am.psdriver 2009-12-07 16:36:49.000000000 +0200
|
||||||
+++ rpm-4.8.0/scripts/Makefile.am 2010-02-04 12:00:09.905560182 +0000
|
+++ rpm-4.8.0/scripts/Makefile.am 2010-03-16 10:54:04.000000000 +0200
|
||||||
@@ -20,7 +20,8 @@ EXTRA_DIST = \
|
@@ -20,7 +20,8 @@ EXTRA_DIST = \
|
||||||
mono-find-requires mono-find-provides \
|
mono-find-requires mono-find-provides \
|
||||||
ocaml-find-requires.sh ocaml-find-provides.sh \
|
ocaml-find-requires.sh ocaml-find-provides.sh \
|
||||||
|
@ -105,9 +105,9 @@ diff -up rpm-4.8.0/scripts/Makefile.am.postscriptdriver rpm-4.8.0/scripts/Makefi
|
||||||
rpmdb_loadcvt rpmdiff rpm2cpio.sh tcl.req tgpg
|
rpmdb_loadcvt rpmdiff rpm2cpio.sh tcl.req tgpg
|
||||||
|
|
||||||
rpmconfig_DATA = \
|
rpmconfig_DATA = \
|
||||||
diff -up rpm-4.8.0/scripts/Makefile.in.postscriptdriver rpm-4.8.0/scripts/Makefile.in
|
diff -up rpm-4.8.0/scripts/Makefile.in.psdriver rpm-4.8.0/scripts/Makefile.in
|
||||||
--- rpm-4.8.0/scripts/Makefile.in.postscriptdriver 2010-01-08 08:35:16.000000000 +0000
|
--- rpm-4.8.0/scripts/Makefile.in.psdriver 2010-01-08 10:35:16.000000000 +0200
|
||||||
+++ rpm-4.8.0/scripts/Makefile.in 2010-02-04 12:00:09.906559262 +0000
|
+++ rpm-4.8.0/scripts/Makefile.in 2010-03-16 10:54:04.000000000 +0200
|
||||||
@@ -317,7 +317,8 @@ EXTRA_DIST = brp-compress brp-python-byt
|
@@ -317,7 +317,8 @@ EXTRA_DIST = brp-compress brp-python-byt
|
||||||
find-php-provides find-php-requires mono-find-requires \
|
find-php-provides find-php-requires mono-find-requires \
|
||||||
mono-find-provides ocaml-find-requires.sh \
|
mono-find-provides ocaml-find-requires.sh \
|
||||||
|
@ -126,13 +126,13 @@ diff -up rpm-4.8.0/scripts/Makefile.in.postscriptdriver rpm-4.8.0/scripts/Makefi
|
||||||
rpmdb_loadcvt rpmdiff rpm2cpio.sh tcl.req tgpg
|
rpmdb_loadcvt rpmdiff rpm2cpio.sh tcl.req tgpg
|
||||||
|
|
||||||
rpmconfig_DATA = rpmdiff.cgi rpm.daily rpm.log rpm.xinetd macros.perl \
|
rpmconfig_DATA = rpmdiff.cgi rpm.daily rpm.log rpm.xinetd macros.perl \
|
||||||
diff -up rpm-4.8.0/scripts/postscriptdriver.prov.postscriptdriver rpm-4.8.0/scripts/postscriptdriver.prov
|
diff -up rpm-4.8.0/scripts/postscriptdriver.prov.psdriver rpm-4.8.0/scripts/postscriptdriver.prov
|
||||||
--- rpm-4.8.0/scripts/postscriptdriver.prov.postscriptdriver 2010-02-04 12:00:09.907559566 +0000
|
--- rpm-4.8.0/scripts/postscriptdriver.prov.psdriver 2010-03-16 10:54:04.000000000 +0200
|
||||||
+++ rpm-4.8.0/scripts/postscriptdriver.prov 2010-02-04 12:03:57.312559754 +0000
|
+++ rpm-4.8.0/scripts/postscriptdriver.prov 2010-03-16 10:54:04.000000000 +0200
|
||||||
@@ -0,0 +1,232 @@
|
@@ -0,0 +1,261 @@
|
||||||
+#!/bin/bash
|
+#!/bin/bash
|
||||||
+shopt -s execfail
|
+shopt -s execfail
|
||||||
+exec -a "$0" python -- "$@" <(tail -n +4 -- "$0") || exit 0 # -*- python -*-
|
+exec -a "$0" python -- <(tail -n +4 -- "$0") "$@" || exit 0 # -*- python -*-
|
||||||
+
|
+
|
||||||
+## Copyright (C) 2009, 2010 Red Hat, Inc.
|
+## Copyright (C) 2009, 2010 Red Hat, Inc.
|
||||||
+## Author: Tim Waugh <twaugh@redhat.com>
|
+## Author: Tim Waugh <twaugh@redhat.com>
|
||||||
|
@ -155,21 +155,26 @@ diff -up rpm-4.8.0/scripts/postscriptdriver.prov.postscriptdriver rpm-4.8.0/scri
|
||||||
+
|
+
|
||||||
+try:
|
+try:
|
||||||
+ import cups
|
+ import cups
|
||||||
+ CAN_EXAMINE_PPDS=True
|
+ CAN_EXAMINE_PPDS = True
|
||||||
+except:
|
+except:
|
||||||
+ CAN_EXAMINE_PPDS=False
|
+ CAN_EXAMINE_PPDS = False
|
||||||
+
|
+
|
||||||
+from getopt import getopt
|
+from getopt import getopt
|
||||||
|
+import errno
|
||||||
+import os
|
+import os
|
||||||
+import posix
|
+import posix
|
||||||
+import re
|
+import re
|
||||||
+import shlex
|
+import shlex
|
||||||
+import signal
|
+import signal
|
||||||
+import stat
|
|
||||||
+import subprocess
|
+import subprocess
|
||||||
+import sys
|
+import sys
|
||||||
+import tempfile
|
+import tempfile
|
||||||
+
|
+
|
||||||
|
+if len (sys.argv) > 1:
|
||||||
|
+ RPM_BUILD_ROOT = sys.argv[1]
|
||||||
|
+else:
|
||||||
|
+ RPM_BUILD_ROOT = None
|
||||||
|
+
|
||||||
+class TimedOut(Exception):
|
+class TimedOut(Exception):
|
||||||
+ def __init__ (self):
|
+ def __init__ (self):
|
||||||
+ Exception.__init__ (self, "Timed out")
|
+ Exception.__init__ (self, "Timed out")
|
||||||
|
@ -257,8 +262,9 @@ diff -up rpm-4.8.0/scripts/postscriptdriver.prov.postscriptdriver rpm-4.8.0/scri
|
||||||
+ return
|
+ return
|
||||||
+
|
+
|
||||||
+ attr = ppd.findAttr ('1284DeviceID')
|
+ attr = ppd.findAttr ('1284DeviceID')
|
||||||
+ if attr:
|
+ while attr:
|
||||||
+ self.ids += attr.value
|
+ self.ids += attr.value
|
||||||
|
+ attr = ppd.findNextAttr ('1284DeviceID')
|
||||||
+
|
+
|
||||||
+class DynamicDriver(Driver):
|
+class DynamicDriver(Driver):
|
||||||
+ def __init__ (self, driver):
|
+ def __init__ (self, driver):
|
||||||
|
@ -271,9 +277,20 @@ diff -up rpm-4.8.0/scripts/postscriptdriver.prov.postscriptdriver rpm-4.8.0/scri
|
||||||
+
|
+
|
||||||
+ def list (self):
|
+ def list (self):
|
||||||
+ signal.alarm (60)
|
+ signal.alarm (60)
|
||||||
|
+ env = os.environ.copy ()
|
||||||
|
+ if RPM_BUILD_ROOT:
|
||||||
|
+ buildroot = RPM_BUILD_ROOT
|
||||||
|
+ if not buildroot.endswith (os.path.sep):
|
||||||
|
+ buildroot += os.path.sep
|
||||||
|
+
|
||||||
|
+ env["DESTDIR"] = RPM_BUILD_ROOT
|
||||||
|
+ env["LD_LIBRARY_PATH"] = "%susr/lib64:%susr/lib" % (buildroot,
|
||||||
|
+ buildroot)
|
||||||
|
+
|
||||||
+ p = subprocess.Popen ([self.driver, "list"],
|
+ p = subprocess.Popen ([self.driver, "list"],
|
||||||
+ stdout=subprocess.PIPE,
|
+ stdout=subprocess.PIPE,
|
||||||
+ stderr=subprocess.PIPE)
|
+ stderr=subprocess.PIPE,
|
||||||
|
+ env=env)
|
||||||
+ try:
|
+ try:
|
||||||
+ (stdout, stderr) = p.communicate ()
|
+ (stdout, stderr) = p.communicate ()
|
||||||
+ signal.alarm (0)
|
+ signal.alarm (0)
|
||||||
|
@ -312,9 +329,15 @@ diff -up rpm-4.8.0/scripts/postscriptdriver.prov.postscriptdriver rpm-4.8.0/scri
|
||||||
+ self.drv ]
|
+ self.drv ]
|
||||||
+
|
+
|
||||||
+ signal.alarm (60)
|
+ signal.alarm (60)
|
||||||
+ p = subprocess.Popen (argv,
|
+ try:
|
||||||
+ stdout=subprocess.PIPE,
|
+ p = subprocess.Popen (argv,
|
||||||
+ stderr=subprocess.PIPE)
|
+ stdout=subprocess.PIPE,
|
||||||
|
+ stderr=subprocess.PIPE)
|
||||||
|
+ except OSError:
|
||||||
|
+ # ppdc not available.
|
||||||
|
+ os.rmdir (outputdir)
|
||||||
|
+ return Driver.list (self)
|
||||||
|
+
|
||||||
+ try:
|
+ try:
|
||||||
+ (stdout, stderr) = p.communicate ()
|
+ (stdout, stderr) = p.communicate ()
|
||||||
+ signal.alarm (0)
|
+ signal.alarm (0)
|
||||||
|
@ -346,6 +369,12 @@ diff -up rpm-4.8.0/scripts/postscriptdriver.prov.postscriptdriver rpm-4.8.0/scri
|
||||||
+ self.ids += DynamicDriver (path).list ()
|
+ self.ids += DynamicDriver (path).list ()
|
||||||
+ except TimedOut:
|
+ except TimedOut:
|
||||||
+ pass
|
+ pass
|
||||||
|
+ except OSError, (e, s):
|
||||||
|
+ if e == errno.EACCES or e == errno.ENOENT:
|
||||||
|
+ # Not executable
|
||||||
|
+ pass
|
||||||
|
+ else:
|
||||||
|
+ raise
|
||||||
+
|
+
|
||||||
+ if CAN_EXAMINE_PPDS:
|
+ if CAN_EXAMINE_PPDS:
|
||||||
+ for path in paths:
|
+ for path in paths:
|
|
@ -1,86 +0,0 @@
|
||||||
--- rpm-4.8.0/macros.in 2010-02-04 17:42:32.228100971 +0000
|
|
||||||
+++ rpm-4.8.0/macros.in.postscriptdriver-fixes 2010-02-04 17:43:03.867226950 +0000
|
|
||||||
@@ -504,7 +504,7 @@ print (t)\
|
|
||||||
|
|
||||||
%__fontconfig_provides %{_rpmconfigdir}/fontconfig.prov
|
|
||||||
%__desktop_provides %{_rpmconfigdir}/desktop-file.prov
|
|
||||||
-%__psdriver_provides %{_rpmconfigdir}/postscriptdriver.prov
|
|
||||||
+%__psdriver_provides %{_rpmconfigdir}/postscriptdriver.prov %{buildroot}
|
|
||||||
|
|
||||||
#==============================================================================
|
|
||||||
# ---- Database configuration macros.
|
|
||||||
--- rpm-4.8.0/scripts/postscriptdriver.prov 2010-02-04 17:25:15.672102648 +0000
|
|
||||||
+++ rpm-4.8.0/scripts/postscriptdriver.prov.postscriptdriver-fixes 2010-02-05 10:46:44.517778993 +0000
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
#!/bin/bash
|
|
||||||
shopt -s execfail
|
|
||||||
-exec -a "$0" python -- "$@" <(tail -n +4 -- "$0") || exit 0 # -*- python -*-
|
|
||||||
+exec -a "$0" python -- <(tail -n +4 -- "$0") "$@" || exit 0 # -*- python -*-
|
|
||||||
|
|
||||||
## Copyright (C) 2009, 2010 Red Hat, Inc.
|
|
||||||
## Author: Tim Waugh <twaugh@redhat.com>
|
|
||||||
@@ -23,21 +23,26 @@ import sys
|
|
||||||
|
|
||||||
try:
|
|
||||||
import cups
|
|
||||||
- CAN_EXAMINE_PPDS=True
|
|
||||||
+ CAN_EXAMINE_PPDS = True
|
|
||||||
except:
|
|
||||||
- CAN_EXAMINE_PPDS=False
|
|
||||||
+ CAN_EXAMINE_PPDS = False
|
|
||||||
|
|
||||||
from getopt import getopt
|
|
||||||
+import errno
|
|
||||||
import os
|
|
||||||
import posix
|
|
||||||
import re
|
|
||||||
import shlex
|
|
||||||
import signal
|
|
||||||
-import stat
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
+if len (sys.argv) > 1:
|
|
||||||
+ RPM_BUILD_ROOT = sys.argv[1]
|
|
||||||
+else:
|
|
||||||
+ RPM_BUILD_ROOT = None
|
|
||||||
+
|
|
||||||
class TimedOut(Exception):
|
|
||||||
def __init__ (self):
|
|
||||||
Exception.__init__ (self, "Timed out")
|
|
||||||
@@ -139,9 +144,20 @@ class DynamicDriver(Driver):
|
|
||||||
|
|
||||||
def list (self):
|
|
||||||
signal.alarm (60)
|
|
||||||
+ env = os.environ.copy ()
|
|
||||||
+ if RPM_BUILD_ROOT:
|
|
||||||
+ buildroot = RPM_BUILD_ROOT
|
|
||||||
+ if not buildroot.endswith (os.path.sep):
|
|
||||||
+ buildroot += os.path.sep
|
|
||||||
+
|
|
||||||
+ env["DESTDIR"] = RPM_BUILD_ROOT
|
|
||||||
+ env["LD_LIBRARY_PATH"] = "%susr/lib64:%susr/lib" % (buildroot,
|
|
||||||
+ buildroot)
|
|
||||||
+
|
|
||||||
p = subprocess.Popen ([self.driver, "list"],
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
- stderr=subprocess.PIPE)
|
|
||||||
+ stderr=subprocess.PIPE,
|
|
||||||
+ env=env)
|
|
||||||
try:
|
|
||||||
(stdout, stderr) = p.communicate ()
|
|
||||||
signal.alarm (0)
|
|
||||||
@@ -214,6 +230,12 @@ class TagBuilder:
|
|
||||||
self.ids += DynamicDriver (path).list ()
|
|
||||||
except TimedOut:
|
|
||||||
pass
|
|
||||||
+ except OSError, e:
|
|
||||||
+ if e == errno.EACCES or e == errno.ENOENT:
|
|
||||||
+ # Not executable
|
|
||||||
+ pass
|
|
||||||
+ else:
|
|
||||||
+ raise
|
|
||||||
|
|
||||||
if CAN_EXAMINE_PPDS:
|
|
||||||
for path in paths:
|
|
|
@ -1,30 +0,0 @@
|
||||||
--- rpm-4.8.0/scripts/postscriptdriver.prov 2010-02-05 15:40:34.451050057 +0000
|
|
||||||
+++ rpm-4.8.0/scripts/postscriptdriver.prov~ 2010-02-05 15:44:10.141926520 +0000
|
|
||||||
@@ -196,9 +196,15 @@ class DrvDriver(PPDDriver):
|
|
||||||
self.drv ]
|
|
||||||
|
|
||||||
signal.alarm (60)
|
|
||||||
- p = subprocess.Popen (argv,
|
|
||||||
- stdout=subprocess.PIPE,
|
|
||||||
- stderr=subprocess.PIPE)
|
|
||||||
+ try:
|
|
||||||
+ p = subprocess.Popen (argv,
|
|
||||||
+ stdout=subprocess.PIPE,
|
|
||||||
+ stderr=subprocess.PIPE)
|
|
||||||
+ except OSError:
|
|
||||||
+ # ppdc not available.
|
|
||||||
+ os.rmdir (outputdir)
|
|
||||||
+ return Driver.list (self)
|
|
||||||
+
|
|
||||||
try:
|
|
||||||
(stdout, stderr) = p.communicate ()
|
|
||||||
signal.alarm (0)
|
|
||||||
@@ -230,7 +236,7 @@ class TagBuilder:
|
|
||||||
self.ids += DynamicDriver (path).list ()
|
|
||||||
except TimedOut:
|
|
||||||
pass
|
|
||||||
- except OSError, e:
|
|
||||||
+ except OSError, (e, s):
|
|
||||||
if e == errno.EACCES or e == errno.ENOENT:
|
|
||||||
# Not executable
|
|
||||||
pass
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
commit 40f788a7bf3741f9c613ff302d4e1b0ceec2658c
|
||||||
|
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||||
|
Date: Wed Mar 24 09:53:25 2010 +0200
|
||||||
|
|
||||||
|
Add __bool__() / __nonzero__() method to python rpmmi objects (ticket #153)
|
||||||
|
- Objects supporting __len__() use (len > 0) for boolean representation,
|
||||||
|
which normally makes sense but as the match iterator count is often
|
||||||
|
zero despite the iterator actually existing and returning something,
|
||||||
|
and breaks existing code (rpmlint at least)
|
||||||
|
- Adding a __bool__() (known as __nonzero__() in Python < 3) method
|
||||||
|
returning true for non-NULL iterator fixes this and gives more
|
||||||
|
meaningful answers than pre 4.8.0 which simply always returned True
|
||||||
|
|
||||||
|
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
|
||||||
|
index f6dd802..b7bfb1b 100644
|
||||||
|
--- a/python/rpmmi-py.c
|
||||||
|
+++ b/python/rpmmi-py.c
|
||||||
|
@@ -137,11 +137,30 @@ static Py_ssize_t rpmmi_length(rpmmiObject * s)
|
||||||
|
return s->mi ? rpmdbGetIteratorCount(s->mi) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int rpmmi_bool(rpmmiObject *s)
|
||||||
|
+{
|
||||||
|
+ return (s->mi != NULL);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
PyMappingMethods rpmmi_as_mapping = {
|
||||||
|
(lenfunc) rpmmi_length, /* mp_length */
|
||||||
|
0,
|
||||||
|
};
|
||||||
|
|
||||||
|
+static PyNumberMethods rpmmi_as_number = {
|
||||||
|
+ 0, /* nb_add */
|
||||||
|
+ 0, /* nb_subtract */
|
||||||
|
+ 0, /* nb_multiply */
|
||||||
|
+ 0, /* nb_divide */
|
||||||
|
+ 0, /* nb_remainder */
|
||||||
|
+ 0, /* nb_divmod */
|
||||||
|
+ 0, /* nb_power */
|
||||||
|
+ 0, /* nb_negative */
|
||||||
|
+ 0, /* nb_positive */
|
||||||
|
+ 0, /* nb_absolute */
|
||||||
|
+ (inquiry)rpmmi_bool, /* nb_bool/nonzero */
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
static char rpmmi_doc[] =
|
||||||
|
"";
|
||||||
|
|
||||||
|
@@ -156,7 +175,7 @@ PyTypeObject rpmmi_Type = {
|
||||||
|
0, /* tp_setattr */
|
||||||
|
0, /* tp_compare */
|
||||||
|
0, /* tp_repr */
|
||||||
|
- 0, /* tp_as_number */
|
||||||
|
+ &rpmmi_as_number, /* tp_as_number */
|
||||||
|
0, /* tp_as_sequence */
|
||||||
|
&rpmmi_as_mapping, /* tp_as_mapping */
|
||||||
|
0, /* tp_hash */
|
|
@ -0,0 +1,18 @@
|
||||||
|
commit 8c5332984e32d27d28f9a440947b070af0d14c45
|
||||||
|
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||||
|
Date: Mon Mar 15 09:45:49 2010 +0200
|
||||||
|
|
||||||
|
Tell python about RPMTRANS_FLAG_NOCONTEXTS
|
||||||
|
|
||||||
|
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
|
||||||
|
index 4ace4bc..6159aee 100644
|
||||||
|
--- a/python/rpmmodule.c
|
||||||
|
+++ b/python/rpmmodule.c
|
||||||
|
@@ -386,6 +386,7 @@ static int initModule(PyObject *m)
|
||||||
|
REGISTER_ENUM(RPMTRANS_FLAG_NODOCS);
|
||||||
|
REGISTER_ENUM(RPMTRANS_FLAG_ALLFILES);
|
||||||
|
REGISTER_ENUM(RPMTRANS_FLAG_KEEPOBSOLETE);
|
||||||
|
+ REGISTER_ENUM(RPMTRANS_FLAG_NOCONTEXTS);
|
||||||
|
REGISTER_ENUM(RPMTRANS_FLAG_REPACKAGE);
|
||||||
|
REGISTER_ENUM(RPMTRANS_FLAG_REVERSE);
|
||||||
|
REGISTER_ENUM(RPMTRANS_FLAG_NOPRE);
|
37
rpm.spec
37
rpm.spec
|
@ -21,7 +21,7 @@
|
||||||
Summary: The RPM package management system
|
Summary: The RPM package management system
|
||||||
Name: rpm
|
Name: rpm
|
||||||
Version: %{rpmver}
|
Version: %{rpmver}
|
||||||
Release: 10%{?dist}
|
Release: 14%{?dist}
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Url: http://www.rpm.org/
|
Url: http://www.rpm.org/
|
||||||
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
|
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
|
||||||
|
@ -36,10 +36,9 @@ Patch2: rpm-4.5.90-gstreamer-provides.patch
|
||||||
# this as Fedora-specific patch for now
|
# this as Fedora-specific patch for now
|
||||||
Patch3: rpm-4.7.90-fedora-specspo.patch
|
Patch3: rpm-4.7.90-fedora-specspo.patch
|
||||||
# Postscript driver provides extraction is Fedora specific for now
|
# Postscript driver provides extraction is Fedora specific for now
|
||||||
# TODO: merge these when things stabilize
|
Patch4: rpm-4.8.0-psdriver-deps.patch
|
||||||
Patch4: rpm-4.8.0-psdriver.patch
|
# In current Fedora, man-pages pkg owns all the localized man directories
|
||||||
Patch5: rpm-4.8.0-psdriver-fixes.patch
|
Patch5: rpm-4.8.0-no-man-dirs.patch
|
||||||
Patch6: rpm-4.8.0-psdriver-more-fixes.patch
|
|
||||||
|
|
||||||
# Patches already in upstream
|
# Patches already in upstream
|
||||||
Patch200: rpm-4.8.0-url-segfault.patch
|
Patch200: rpm-4.8.0-url-segfault.patch
|
||||||
|
@ -48,6 +47,9 @@ Patch202: rpm-4.8.0-pythondeps-parallel.patch
|
||||||
Patch203: rpm-4.8.0-python-bytecompile.patch
|
Patch203: rpm-4.8.0-python-bytecompile.patch
|
||||||
Patch204: rpm-4.8.0-lazy-statfs.patch
|
Patch204: rpm-4.8.0-lazy-statfs.patch
|
||||||
Patch205: rpm-4.8.0-erasure-dsi.patch
|
Patch205: rpm-4.8.0-erasure-dsi.patch
|
||||||
|
Patch206: rpm-4.8.0-prep-keep-empty.patch
|
||||||
|
Patch207: rpm-4.8.0-python-nocontexts.patch
|
||||||
|
Patch208: rpm-4.8.0-python-mibool.patch
|
||||||
|
|
||||||
# These are not yet upstream
|
# These are not yet upstream
|
||||||
Patch301: rpm-4.6.0-niagara.patch
|
Patch301: rpm-4.6.0-niagara.patch
|
||||||
|
@ -191,9 +193,8 @@ packages on a system.
|
||||||
%patch1 -p1 -b .pkgconfig-path
|
%patch1 -p1 -b .pkgconfig-path
|
||||||
%patch2 -p1 -b .gstreamer-prov
|
%patch2 -p1 -b .gstreamer-prov
|
||||||
%patch3 -p1 -b .fedora-specspo
|
%patch3 -p1 -b .fedora-specspo
|
||||||
%patch4 -p1 -b .psdriver
|
%patch4 -p1 -b .psdriver-deps
|
||||||
%patch5 -p1 -b .psdriver-fixes
|
%patch5 -p1 -b .no-man-dirs
|
||||||
%patch6 -p1 -b .psdriver-more-fixes
|
|
||||||
|
|
||||||
%patch200 -p1 -b .url-segfault
|
%patch200 -p1 -b .url-segfault
|
||||||
%patch201 -p1 -b .verify-exitcode
|
%patch201 -p1 -b .verify-exitcode
|
||||||
|
@ -201,6 +202,9 @@ packages on a system.
|
||||||
%patch203 -p1 -b .python-bytecompile
|
%patch203 -p1 -b .python-bytecompile
|
||||||
%patch204 -p1 -b .lazy-statfs
|
%patch204 -p1 -b .lazy-statfs
|
||||||
%patch205 -p1 -b .erasure-dsi
|
%patch205 -p1 -b .erasure-dsi
|
||||||
|
%patch206 -p1 -b .prep-keep-empty
|
||||||
|
%patch207 -p1 -b .python-nocontexts
|
||||||
|
%patch208 -p1 -b .python-mibool
|
||||||
|
|
||||||
%patch301 -p1 -b .niagara
|
%patch301 -p1 -b .niagara
|
||||||
%patch302 -p1 -b .geode
|
%patch302 -p1 -b .geode
|
||||||
|
@ -269,7 +273,6 @@ for dbutil in \
|
||||||
do
|
do
|
||||||
ln -s ../../bin/%{dbprefix}_${dbutil} $RPM_BUILD_ROOT/%{rpmhome}/rpmdb_${dbutil}
|
ln -s ../../bin/%{dbprefix}_${dbutil} $RPM_BUILD_ROOT/%{rpmhome}/rpmdb_${dbutil}
|
||||||
done
|
done
|
||||||
ln -s ../../bin/berkeley_%{dbprefix}_svc $RPM_BUILD_ROOT/%{rpmhome}/rpmdb_svc
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%find_lang %{name}
|
%find_lang %{name}
|
||||||
|
@ -417,6 +420,22 @@ exit 0
|
||||||
%doc doc/librpm/html/*
|
%doc doc/librpm/html/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Apr 23 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-14
|
||||||
|
- lose dangling symlink to extinct (and useless) berkeley_db_svc (#585174)
|
||||||
|
|
||||||
|
* Wed Mar 24 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-13
|
||||||
|
- fix python match iterator regression wrt boolean representation
|
||||||
|
|
||||||
|
* Wed Mar 17 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-12
|
||||||
|
- unbreak find-lang --with-man from yesterdays braindamage
|
||||||
|
|
||||||
|
* Tue Mar 16 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-11
|
||||||
|
- support single PPD providing driver for devices (#568351)
|
||||||
|
- merge the psdriver patch pile into one
|
||||||
|
- preserve empty lines in spec prep section (#573339)
|
||||||
|
- teach python bindings about RPMTRANS_FLAG_NOCONTEXTS (related to #573111)
|
||||||
|
- dont own localized man directories through find_lang (#569536)
|
||||||
|
|
||||||
* Mon Feb 15 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-10
|
* Mon Feb 15 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-10
|
||||||
- drop bogus dependency on lzma, xz is used to handle the lzma format too
|
- drop bogus dependency on lzma, xz is used to handle the lzma format too
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue