Bug 51421 - RPM ant task does not search for rpmbuild command
Summary: RPM ant task does not search for rpmbuild command
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.2
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-22 18:44 UTC by Archie Cobbs
Modified: 2011-06-22 18:44 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Archie Cobbs 2011-06-22 18:44:12 UTC
The <rpm> task is documented to try rpmbuild first, then rpm, when building.

rpmbuild is indeed installed on this system (openSUSE 11.4):

    $ which rpmbuild
    /usr/bin/rpmbuild

In ant 1.8.2, however, it only tries rpm. The result is this error:

      [rpm] -bb: unknown option
            'rpm' failed with exit code 1

I verified this behavior via strace:

      [rpm] Building the RPM based on the pexp-web.spec file
[pid 24339] clone(Process 24346 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb482ebd8) = 24346
[pid 24346] execve("/home/archie/bin/rpm", ["rpm", "--define", "_topdir /home/archie/svn/ops/pex"..., "-bb", "--define", "_topdir /home/archie/svn/ops/pex"..., "--define", "svn_revision exported", "SPECS/pexp-web.spec"], [/* 51 vars */]) = -1 ENOENT (No such file or directory)
[pid 24346] execve("/usr/local/bin/rpm", ["rpm", "--define", "_topdir /home/archie/svn/ops/pex"..., "-bb", "--define", "_topdir /home/archie/svn/ops/pex"..., "--define", "svn_revision exported", "SPECS/pexp-web.spec"], [/* 51 vars */]) = -1 ENOENT (No such file or directory)
[pid 24346] execve("/usr/bin/rpm", ["rpm", "--define", "_topdir /home/archie/svn/ops/pex"..., "-bb", "--define", "_topdir /home/archie/svn/ops/pex"..., "--define", "svn_revision exported", "SPECS/pexp-web.spec"], [/* 51 vars */]) = -1 ENOENT (No such file or directory)
[pid 24346] execve("/bin/rpm", ["rpm", "--define", "_topdir /home/archie/svn/ops/pex"..., "-bb", "--define", "_topdir /home/archie/svn/ops/pex"..., "--define", "svn_revision exported", "SPECS/pexp-web.spec"], [/* 51 vars */]) = 0
[pid 24339] waitpid(24346, 0xb482e29c, WNOHANG) = 0
[pid 24289] clone(Process 24347 attached (waiting for parent)
Process 24347 resumed (parent 24289 ready)
child_stack=0xb382c484, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb382cbd8, {entry_number:6, base_addr:0xb382cb70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb382cbd8) = 24347
[pid 24289] clone(Process 24348 attached (waiting for parent)
Process 24348 resumed (parent 24289 ready)
child_stack=0xb402d484, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb402dbd8, {entry_number:6, base_addr:0xb402db70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb402dbd8) = 24348
[pid 24346] exit_group(1)               = ?
Process 24346 detached
[pid 24339] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid 24339] waitpid(24346, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG) = 24346
      [rpm] -bb: unknown option
[pid 24347] --- SIGHUP (Hangup) @ 0 (0) ---
[pid 24347] _exit(0)                    = ?
Process 24347 detached
[pid 24348] --- SIGHUP (Hangup) @ 0 (0) ---
[pid 24348] _exit(0)                    = ?
Process 24348 detached
[pid 24289] clone(Process 24349 attached (waiting for parent)
Process 24349 resumed (parent 24289 ready)
child_stack=0xb402d484, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb402dbd8, {entry_number:6, base_addr:0xb402db70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb402dbd8) = 24349
[pid 24349] _exit(0)                    = ?
Process 24349 detached

BUILD FAILED
/home/archie/svn/ops/pexp-web/build.xml:9: The following error occurred while executing this line:
/home/archie/svn/ops/pexp-web/src/build/macros.xml:411: 'rpm' failed with exit code 1