Revert O0 CFLAGS and build with flush query buffer patch

This commit is contained in:
Paul Nasrat 2006-10-31 15:18:35 +00:00
parent bb1df7b9cf
commit 7086a30fcc
2 changed files with 96 additions and 3 deletions

View File

@ -0,0 +1,89 @@
--- rpm-4.4.2/lib/query.c.flush 2006-10-31 12:48:54.000000000 +0000
+++ rpm-4.4.2/lib/query.c 2006-10-31 12:49:05.000000000 +0000
@@ -124,6 +124,28 @@
return str;
}
+/**
+ */
+static void flushBuffer(char ** tp, char ** tep, int nonewline)
+ /*@ modifies *tp, *tep @*/
+{
+ char *t, *te;
+
+ t = *tp;
+ te = *tep;
+ if (te > t) {
+ if (!nonewline) {
+ *te++ = '\n';
+ *te = '\0';
+ }
+ rpmMessage(RPMMESS_NORMAL, "%s", t);
+ te = t;
+ *t = '\0';
+ }
+ *tp = t;
+ *tep = te;
+}
+
int showQueryPackage(QVA_t qva, rpmts ts, Header h)
{
int scareMem = 0;
@@ -131,7 +153,6 @@
char * t, * te;
char * prefix = NULL;
int rc = 0; /* XXX FIXME: need real return code */
- int nonewline = 0;
int i;
te = t = xmalloc(BUFSIZ);
@@ -141,7 +162,6 @@
if (qva->qva_queryFormat != NULL) {
const char * str = queryHeader(h, qva->qva_queryFormat);
- nonewline = 1;
/*@-branchstate@*/
if (str) {
size_t tb = (te - t);
@@ -157,6 +177,7 @@
/*@=usereleased@*/
/*@=boundswrite@*/
str = _free(str);
+ flushBuffer(&t, &te, 1);
}
/*@=branchstate@*/
}
@@ -304,31 +325,13 @@
_("package has neither file owner or id lists\n"));
}
}
-/*@-branchstate@*/
- if (te > t) {
-/*@-boundswrite@*/
- *te++ = '\n';
- *te = '\0';
- rpmMessage(RPMMESS_NORMAL, "%s", t);
- te = t;
- *t = '\0';
-/*@=boundswrite@*/
- }
-/*@=branchstate@*/
+ flushBuffer(&t, &te, 0);
}
rc = 0;
exit:
- if (te > t) {
- if (!nonewline) {
-/*@-boundswrite@*/
- *te++ = '\n';
- *te = '\0';
-/*@=boundswrite@*/
- }
- rpmMessage(RPMMESS_NORMAL, "%s", t);
- }
+ flushBuffer(&t, &te, 0);
t = _free(t);
fi = rpmfiFree(fi);

View File

@ -20,7 +20,7 @@ Name: rpm
%define version 4.4.2 %define version 4.4.2
Version: %{version} Version: %{version}
%{expand: %%define rpm_version %{version}} %{expand: %%define rpm_version %{version}}
Release: 34%{?dist} Release: 35%{?dist}
Group: System Environment/Base Group: System Environment/Base
Source: ftp://wraptastic.org/pub/rpm-4.4.x/rpm-%{rpm_version}.tar.gz Source: ftp://wraptastic.org/pub/rpm-4.4.x/rpm-%{rpm_version}.tar.gz
Source1: mono-find-provides Source1: mono-find-provides
@ -60,6 +60,7 @@ Patch31: rpm-4.4.2-debugedit-ppc-reloc.patch
Patch32: rpm-4.4.2-debugpaths.patch Patch32: rpm-4.4.2-debugpaths.patch
Patch33: rpm-4.4.2-transaction-order.patch Patch33: rpm-4.4.2-transaction-order.patch
Patch34: rpm-4.4.2-debugopt.patch Patch34: rpm-4.4.2-debugopt.patch
Patch35: rpm-4.4.2-query-flushbuffer.patch
License: GPL License: GPL
Conflicts: patch < 2.5 Conflicts: patch < 2.5
%ifos linux %ifos linux
@ -207,6 +208,7 @@ shell-like rules.
%patch32 -p1 -b .dbgpaths %patch32 -p1 -b .dbgpaths
%patch33 -p1 -b .order %patch33 -p1 -b .order
%patch34 -p1 -b .dbgopt %patch34 -p1 -b .dbgopt
%patch35 -p1 -b .flush
# rebuild configure for ipv6 # rebuild configure for ipv6
autoconf autoconf
@ -223,8 +225,7 @@ WITH_PYTHON="--without-python"
%endif %endif
%ifos linux %ifos linux
CFLAGS=$(echo "$RPM_OPT_FLAGS" | sed 's/O2/O0/') CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
export CFLAGS
./configure --prefix=%{__prefix} --sysconfdir=/etc \ ./configure --prefix=%{__prefix} --sysconfdir=/etc \
--localstatedir=/var --infodir='${prefix}%{__share}/info' \ --localstatedir=/var --infodir='${prefix}%{__share}/info' \
--mandir='${prefix}%{__share}/man' \ --mandir='${prefix}%{__share}/man' \
@ -604,6 +605,9 @@ exit 0
%{__includedir}/popt.h %{__includedir}/popt.h
%changelog %changelog
* Tue Oct 31 2006 Paul Nasrat <pnasrat@redhat.com> - 4.4.2-35
- Flush query buffer patch from jbj (#212833)
* Tue Oct 31 2006 Paul Nasrat <pnasrat@redhat.com> - 4.4.2-34 * Tue Oct 31 2006 Paul Nasrat <pnasrat@redhat.com> - 4.4.2-34
- Debuginfo extraction with O0 - Debuginfo extraction with O0