From cc06306cbe59d1a226c77209a072c9640d1b7bde Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 30 Jun 2010 09:44:37 +0000 Subject: [PATCH] - fix a potential getOutputFrom() error from font provide extraction - debug-friendlier message to aid finding other similar cases (#565223) --- rpm-4.8.1-eat-stdin.patch | 31 +++++++++++++++++++++++++++++++ rpm-4.8.1-getoutput-emsg.patch | 28 ++++++++++++++++++++++++++++ rpm.spec | 10 +++++++++- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 rpm-4.8.1-eat-stdin.patch create mode 100644 rpm-4.8.1-getoutput-emsg.patch diff --git a/rpm-4.8.1-eat-stdin.patch b/rpm-4.8.1-eat-stdin.patch new file mode 100644 index 0000000..83af219 --- /dev/null +++ b/rpm-4.8.1-eat-stdin.patch @@ -0,0 +1,31 @@ +From 53045d5dcdce3988e2586cb315b35e6a675a8152 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Wed, 30 Jun 2010 11:57:17 +0300 +Subject: [PATCH 1/2] Fix potential getOutputFrom() error on font provide extraction (RhBug:609117) + - if fonts are detected in the package being built but fc-query isn't + present, the script exited without consuming stdin which can break + getOutputFrom() + +--- + scripts/fontconfig.prov | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/scripts/fontconfig.prov b/scripts/fontconfig.prov +index 8638680..594851d 100755 +--- a/scripts/fontconfig.prov ++++ b/scripts/fontconfig.prov +@@ -12,7 +12,10 @@ + + fcquery=/usr/bin/fc-query + +-[ -x $fcquery ] || exit 0 ++if [ -x $fcquery ]; then ++ cat > /dev/null ++ exit 0 ++fi + + # filter out anything outside main fontconfig path + grep /usr/share/fonts/ | +-- +1.7.0.1 + diff --git a/rpm-4.8.1-getoutput-emsg.patch b/rpm-4.8.1-getoutput-emsg.patch new file mode 100644 index 0000000..4586155 --- /dev/null +++ b/rpm-4.8.1-getoutput-emsg.patch @@ -0,0 +1,28 @@ +From 5711982e27c70bea4017632255a94630ea10d1ab Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Wed, 30 Jun 2010 12:27:56 +0300 +Subject: [PATCH 2/2] Make the infamous getOutputFrom() error message more useful + - ...like actually saying what was the failing script, doh + - leaving the function name there for a googling hint + +--- + build/rpmfc.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/build/rpmfc.c b/build/rpmfc.c +index e76363a..3c915f5 100644 +--- a/build/rpmfc.c ++++ b/build/rpmfc.c +@@ -234,7 +234,8 @@ top: + if ((nbw = write(toProg[1], writePtr, + (1024 - 4.8.1-2 +- fix a potential getOutputFrom() error from font provide extraction +- debug-friendlier message to aid finding other similar cases (#565223) + * Fri Jun 11 2010 Panu Matilainen - 4.8.1-1 - update to 4.8.1 (http://rpm.org/wiki/Releases/4.8.1) - drop no longer needed patches