Bug 26270 - lack of rpm-build isn't handled well
Summary: lack of rpm-build isn't handled well
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.1
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard: Florence Gold
: 38332 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-02-06 02:15 UTC by Kees Cook
Modified: 2007-04-18 16:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-02-07 00:19:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Kees Cook 2001-02-06 02:15:53 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.1 i686; en-US; 0.7) Gecko/20010118


When running "rpm -b...", if "rpm-build" isn't installed, rpm
quietly ignores the fail to exec /usr/lib/rpm/rpmb, and just
displays the Usage summary.


Reproducible: Always
Steps to Reproduce:
1. Install rpm
2. Don't install rpm-build
3. Run "rpm -ba whatever.spec"
	

Actual Results:
[root] stompy:/usr/src/redhat/SPECS > rpm -bp XFree86.spec
RPM version 4.0.2
Copyright (C) 1998-2000 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL

Usage: rpm {--help}
       rpm {--version}
       rpm {--initdb}   [--dbpath <dir>]
       rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]
                        [--replacepkgs] [--replacefiles] [--root <dir>]
                        [--excludedocs] [--includedocs] [--noscripts]
                        [--rcfile <file>] [--ignorearch] [--dbpath <dir>]
                        [--prefix <dir>] [--ignoreos] [--nodeps] [--allfiles]
                        [--ftpproxy <host>] [--ftpport <port>]
                        [--httpproxy <host>] [--httpport <port>]
                        [--justdb] [--noorder] [--relocate oldpath=newpath]
                        [--badreloc] [--notriggers] [--excludepath <path>]
                        [--ignoresize] file1.rpm ... fileN.rpm
       rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]
                        [--oldpackage] [--root <dir>] [--noscripts]
                        [--excludedocs] [--includedocs] [--rcfile <file>]
                        [--ignorearch]  [--dbpath <dir>] [--prefix <dir>]
                        [--ftpproxy <host>] [--ftpport <port>]
                        [--httpproxy <host>] [--httpport <port>]
                        [--ignoreos] [--nodeps] [--allfiles] [--justdb]
                        [--noorder] [--relocate oldpath=newpath]
                        [--badreloc] [--excludepath <path>] [--ignoresize]
                        file1.rpm ... fileN.rpm
       rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]
                        [--scripts] [--root <dir>] [--rcfile <file>]
                        [--whatprovides] [--whatrequires] [--requires]
                        [--triggeredby]
                        [--ftpproxy <host>] [--ftpport <port>]
                        [--httpproxy <host>] [--httpport <port>]
                        [--provides] [--triggers] [--dump]
                        [--changelog] [--dbpath <dir>] [targets]
       rpm {--verify -V -y} [-afpg] [--root <dir>] [--rcfile <file>]
                        [--dbpath <dir>] [--nodeps] [--nofiles] [--noscripts]
                        [--nomd5] [targets]
       rpm {--setperms} [-afpg] [target]
       rpm {--setugids} [-afpg] [target]
       rpm {--freshen -F} file1.rpm ... fileN.rpm
       rpm {--erase -e} [--root <dir>] [--noscripts] [--rcfile <file>]
                 [--dbpath <dir>] [--nodeps] [--allmatches]
                        [--justdb] [--notriggers] package1 ... packageN
       rpm {--resign} [--rcfile <file>] package1 package2 ... packageN
       rpm {--addsign} [--rcfile <file>] package1 package2 ... packageN
       rpm {--checksig -K} [--nopgp] [--nogpg] [--nomd5] [--rcfile <file>]
                           package1 ... packageN
       rpm {--rebuilddb} [--rcfile <file>] [--dbpath <dir>]
       rpm {--querytags}



Expected Results:
[root] stompy:/usr/src/redhat/SPECS > rpm -bp XFree86.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.83421
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf XFree86-4.0.2
+ /bin/mkdir -p XFree86-4.0.2
+ cd XFree86-4.0.2
+ /usr/bin/bzip2 -dc /usr/src/redhat/SOURCES/XFree86-4.0.2.tar.bz2
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,g-w,o-w .
+ echo 'Patch #1 (XFree86-4.0.2-xf-4_0_2-branch-2001-01-23.patch.bz2):'
Patch #1 (XFree86-4.0.2-xf-4_0_2-branch-2001-01-23.patch.bz2):
+ /usr/bin/bzip2 -d
+ patch -p0 -b --suffix .xf-4_0_2-branch -s
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ find . -name CVS -type d
+ xargs rm -rf
+ pushd xc/programs/Xserver/hw/xfree86/drivers/
/usr/src/redhat/BUILD/XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers
/usr/src/redhat/BUILD/XFree86-4.0.2
+ bzcat /usr/src/redhat/SOURCES/mga_os_g450_402.tar.bz2
+ tar xf -
+ popd
/usr/src/redhat/BUILD/XFree86-4.0.2
+ echo 'Patch #7 (XFree86-4.0-xtermresources.patch):'
Patch #7 (XFree86-4.0-xtermresources.patch):
+ patch -p1 -b --suffix .xtermresources -s
+ echo 'Patch #12 (XFree86-4.0-broken-includes.patch):'
Patch #12 (XFree86-4.0-broken-includes.patch):
+ patch -p1 -b --suffix .broken -s
+ echo 'Patch #19 (XFree86-4.0-Xwrapper.patch):'
Patch #19 (XFree86-4.0-Xwrapper.patch):
+ patch -p1 -b --suffix .Xwrapper -s
+ echo 'Patch #201 (xdm-4.0-servonly.patch):'
Patch #201 (xdm-4.0-servonly.patch):
+ patch -p1 -b --suffix .xdm-servonly -s
+ echo 'Patch #204 (XFree86-4.0.1-dri-sym.patch):'
Patch #204 (XFree86-4.0.1-dri-sym.patch):
+ patch -p1 -b --suffix .dri-sym -s
+ echo 'Patch #209 (XFree86-4.0.1-cpp.patch):'
Patch #209 (XFree86-4.0.1-cpp.patch):
+ patch -p1 -b --suffix .use-cpp -s
+ echo 'Patch #211 (XFree86-4.0.1-xman.patch):'
Patch #211 (XFree86-4.0.1-xman.patch):
+ patch -p1 -b --suffix .xman -s
+ echo 'Patch #215 (XFree86-4.0.1-xterm-appdefaults.patch):'
Patch #215 (XFree86-4.0.1-xterm-appdefaults.patch):
+ patch -p1 -b --suffix .xterm-appdefaults -s
+ echo 'Patch #220 (XFree86-4.0.1Z-nokernelmodules.patch):'
Patch #220 (XFree86-4.0.1Z-nokernelmodules.patch):
+ patch -p1 -b --suffix .nomodules -s
+ echo 'Patch #300 (XFree86-4.0.1-parallelmake.patch):'
Patch #300 (XFree86-4.0.1-parallelmake.patch):
+ patch -p1 -b --suffix .parallelmake -s
+ echo 'Patch #302 (XFree86-4.0.1Z-locale.alias.patch):'
Patch #302 (XFree86-4.0.1Z-locale.alias.patch):
+ patch -p0 -b --suffix .locale.alias -s
+ echo 'Patch #303 (XFree86-4.0.2-fhs.patch):'
Patch #303 (XFree86-4.0.2-fhs.patch):
+ patch -p1 -b --suffix .fhs -s
+ echo 'Patch #304 (XFree86-4.0.2-portuguese.patch):'
Patch #304 (XFree86-4.0.2-portuguese.patch):
+ patch -p1 -b --suffix .portuguese -s
+ echo 'Patch #305 (XFree86-4.0.2-xfree86.lst.patch):'
Patch #305 (XFree86-4.0.2-xfree86.lst.patch):
+ patch -p0 -b --suffix .xfree86.lst -s
+ echo 'Patch #308 (XFree86-4.0.2-romanian-keyboard-fix.patch):'
Patch #308 (XFree86-4.0.2-romanian-keyboard-fix.patch):
+ patch -p0 -b --suffix .romanian-keyboard-fix -s
+ echo 'Patch #309 (XFree86-4.0.2-Xft-update.patch):'
Patch #309 (XFree86-4.0.2-Xft-update.patch):
+ patch -p0 -b --suffix .Xft-update -s
+ pwd



I found this problem after examining the strace output for rpm....

.....
open("/usr/lib/rpm/rpmpopt-4.0.2", O_RDONLY) = 3
lseek(3, 0, SEEK_END)                   = 11479
lseek(3, 0, SEEK_SET)                   = 0
read(3, "#\n# This file *should not be mod"..., 11479) = 11479
close(3)                                = 0
brk(0x81ac000)                          = 0x81ac000
open("/etc/popt", O_RDONLY)             = -1 ENOENT (No such file or directory)
getuid32()                              = 0
geteuid32()                             = 0
open("/root/.popt", O_RDONLY)           = -1 ENOENT (No such file or directory)
execve("/usr/lib/rpm/rpmb", ["/usr/lib/rpm/rpmb", "-bp", "--",
"XFree86.spec"], [/* 45 vars */]) = -1 ENOENT (No such file or directory)


....

Comment 1 Glen Foster 2001-02-07 00:19:45 UTC
We (Red Hat) should really try to fix this before next release.

Comment 2 Jeff Johnson 2001-02-07 17:53:45 UTC
The usage message is dead-on accurate, as all rpm build modes are in a different
executable (/usr/bin/rpmbuild), as their is simply no other way to make rpm
easier
to use other than to factor the many options into separate executables.

What still remains is 10 lines of popt magic that Do The Right Thing for the
majority
of users who expect the (now legacy) rpm build behavior. The "correct" and
eventual
fix will be to remove those 10 lines of "magic" configuration, as it's silly to
have
one executable document another executable's options to preserve legacy behavior
forever. Removing those lines will create support problems for everyone,
howvere, not just
the few people who have neglected to install the rpm-build package, and so the
lines
remain.

Adding a message to popt triggered by the failed exec of /usr/lib/rpmb is not
the right
solution, as that breaks the design of popt exec/alias. Adding a message will
also only
prolong the transition from the (now legacy) rpm behavior, far better to just
remove the
popt configuration.

Other alternatives include

1) Having rpm Require: rpm-build
	This is not possible because rpm-build requires perl, and the desire is
	to have no package in the base components Require: perl.

2) Moving rpmbuild back to the rpm package
	This is not possible because of 1), and also causes unnecessary bloat for the
majority
	of rpm users who do not desire rpm build functionality.

So, until it's time to remove the popt magic that already provides a great
degree of legacy
compatibility, I say WONTFIX. Please reopen if you wish me to remove the magic
immediately.

Comment 3 Jeff Johnson 2001-04-29 19:44:14 UTC
*** Bug 38332 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.