Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 1 May 2011 23:44:56 -1000
From: cpb@....log2.net
To: owl-dev@...ts.openwall.com
Subject: Propose change to fix rpmbuild patch command line

Hello, I want to propose a change to an Owl patch file. I could not use
"rpmbuild --rebuild /path/to/some/software.src.rpm" in Owl-3.0-stable
until I made this change and rebuilt Owl's rpmbuild package.

Line from rpm-4.2-owl-xz-macros.diff (Owl-3.0-stable and current) has this:

+    sprintf(args, "-p%d -s", strip);

Proposal: change above line to the following (add space after -s):

+    sprintf(args, "-p%d -s ", strip);

Before making the above change, my attempt to rebuild an SRPM from
CentOS 4.9 failed during the %prep stage, because the command line
for "patch" contained "-s-b", which made patch choke:

-----------------------------------------------------------
$ rpmbuild --rebuild /usr/src/Archive/rcs-5.7-26.src.rpm
Installing /usr/src/Archive/rcs-5.7-26.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.34607
+ umask 022
+ cd /usr/src/.rpm.d/BUILD
+ cd /usr/src/.rpm.d/BUILD
+ rm -rf rcs-5.7
+ echo 'Source #0 (rcs-5.7.tar.gz):'
Source #0 (rcs-5.7.tar.gz):
+ /bin/gzip -dc /usr/src/.rpm.d/SOURCES/rcs-5.7.tar.gz
+ /bin/tar -xf -
+ cd rcs-5.7
++ /usr/bin/id -u
+ '[' 500 = 0 ']'
++ /usr/bin/id -u
+ '[' 500 = 0 ']'
+ /bin/chmod -Rf a+rX,g-w,o-w .
+ echo 'Patch #0 (rcs-5.7-stupidrcs.patch):'
Patch #0 (rcs-5.7-stupidrcs.patch):
+ /usr/bin/patch -p1 -s-b --suffix .stupidrcs
/usr/bin/patch: invalid option -- -
/usr/bin/patch: Try `/usr/bin/patch --help' for more information.
error: Bad exit status from /var/tmp/rpm-tmp.34607 (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.34607 (%prep)
-----------------------------------------------------------

After making the one-line change to rpm-4.2-owl-xz-macros.diff, rebuilding
the Owl rpm package, installing the new rpmbuild package, and repeating
the attempt to rebuild rcs as above, I got success:

-----------------------------------------------------------
$ rpmbuild --rebuild /usr/src/Archive/rcs-5.7-26.src.rpm
Installing /usr/src/Archive/rcs-5.7-26.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.25811
+ umask 022
+ cd /usr/src/.rpm.d/BUILD
+ cd /usr/src/.rpm.d/BUILD
+ rm -rf rcs-5.7
+ echo 'Source #0 (rcs-5.7.tar.gz):'
Source #0 (rcs-5.7.tar.gz):
+ /bin/gzip -dc /usr/src/.rpm.d/SOURCES/rcs-5.7.tar.gz
+ /bin/tar -xf -
+ cd rcs-5.7
++ /usr/bin/id -u
+ '[' 500 = 0 ']'
++ /usr/bin/id -u
+ '[' 500 = 0 ']'
+ /bin/chmod -Rf a+rX,g-w,o-w .
+ echo 'Patch #0 (rcs-5.7-stupidrcs.patch):'
Patch #0 (rcs-5.7-stupidrcs.patch):
+ /usr/bin/patch -p1 -s -b --suffix .stupidrcs
+ echo 'Patch #1 (rcs-5.7-security.patch):'
Patch #1 (rcs-5.7-security.patch):
+ /usr/bin/patch -p1 -s -b --suffix .security
...skipping about 150 lines...
Wrote: /usr/src/.rpm.d/RPMS/x86_64/rcs-5.7-26.x86_64.rpm
...skipping about 10 lines...
+ exit 0
-----------------------------------------------------------

The "patch" command line originally contained "-p1 -s-b --suffix ...",
but after the change, the patch command was "-p1 -s -b --suffix ..",
which is OK.

I hope I'm not the only one with this problem, but I could not find anything
in Google or searching the owl-dev list.
There is a line involving a "-E" option a bit below the proposed change--I
can't tell if it's another potential problem or not. I know this patch was
added to support xz compression, and I don't know why it doesn't affect the
ordinary Owl build process...perhaps "rpmbuild" is unused or deprecated?
Anyway, my problem is solved for now.

It can be tricky appending to a command line--perhaps it would be good to
add spaces /before/ the dashed options as well as /afterward/? I don't know.

If I have misunderstood something, please let me know the correct solution
to my problem. Thanks very much (in advance). I can build from source, but
I'd rather use SRPMS for certain things. I created a user "centosbuild"
and created the directories under /usr/src/.rpm.d/, as you can see. I know
about topdir/%_topdir, just was not using that today.

-Chris Bopp, Honolulu

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.