Bug 453121 - ant fails to build rpm package when build directory contains "-" char due to missing space char between option and directory
ant fails to build rpm package when build directory contains "-" char due to ...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: ant (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-27 08:47 EDT by Volodymyr M. Lisivka
Modified: 2010-12-05 02:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-05 02:10:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Volodymyr M. Lisivka 2008-06-27 08:47:35 EDT
Description of problem:

rpmbuild cannot build rpm when called from ant. Ant called rpmbuid with
following parameters (example taken using strace):

"/usr/bin/rpmbuild" "--define"
"_topdir/home/vlisivka/svnwork/ops/trunk-clean/tools/prr-mysqld_multi/build"
"-bb" "--clean" "SPECS/prr-mysqld_multi.spec"

rpmbuild reports following error:

      [rpm] Building the RPM based on the prr-mysqld_multi.spec file
      [rpm] error: File
/home/vlisivka/svnwork/ops/trunk_clean/tools/prr_mysqld_multi/build/SOURCES/prr-mysqld_multi-3.2.tar.gz:
No such file or directory

BUILD FAILED

Note the strange "_" character inserted instead of "-" in ".../trunk-clean/...".

Version-Release number of selected component (if applicable):

rpm-4.4.2.3-2.fc9.i386

How reproducible:


Steps to Reproduce:
1. Copy directory /usr/src/redhat to  /usr/src/redhat-test
2. Cd into that directory.
3. Issue command /usr/bin/rpmbuild --define _topdir`pwd` -bs --clean
SPECS/A_SPEC_FILE.spec

Actual result:
$ pwd
/usr/src/redhat-test
$ /usr/bin/rpmbuild --define _topdir`pwd` -bs --clean SPECS/firefox.spec
error: File /usr/src/redhat_test/SOURCES/firefox-2.0-source.tar.bz2: No such
file or directory


Workaround: install rpm from Fedora 8 instead of shipped with Fedora 9.
Comment 1 Ville Skyttä 2008-06-27 15:49:44 EDT
Reassigning to rpm, rpmdevtools does not have anything to do with this AFAICT.
Comment 2 Volodymyr M. Lisivka 2008-07-01 09:05:41 EDT
This problem can be solved on ant side by inserting space between "_topdir" and
path. See also: https://issues.apache.org/bugzilla/show_bug.cgi?id=45316

Workaround:

This small shell wrapper script can be used as workaround:

#!/bin/bash
OPTIONS=( )
for I in "$@"
do
  [[ "$I" == _topdir* ]] && I="_topdir ${I#_topdir}"
  OPTIONS[${#OPTIONS[@]}]="$I"
done
rpmbuild.orig "${OPTIONS[@]}"


Just rename original rpmbuild tool to rpmbuild.orig and sotre the shell script
as /usr/bin/rpmbuild (don't forget to chmod a+rwx /usr/bin/rpmbuild).


Comment 3 Volodymyr M. Lisivka 2008-07-02 09:47:13 EDT
Patch:
diff -rub
apache-ant-1.7.0.orig/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
apache-ant-1.7.0/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
---
apache-ant-1.7.0.orig/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java 
    2006-12-13 14:16:22.000000000 +0200
+++ apache-ant-1.7.0/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java  
2008-07-02 16:10:42.000000000 +0300
@@ -120,7 +120,7 @@
                                 : rpmBuildCommand);
         if (topDir != null) {
             toExecute.createArgument().setValue("--define");
-            toExecute.createArgument().setValue("_topdir" + topDir);
+            toExecute.createArgument().setValue("_topdir " + topDir);
         }

         toExecute.createArgument().setLine(command);

-


See also: https://www.jpackage.org/bugzilla/show_bug.cgi?id=301
Comment 4 Bug Zapper 2009-06-09 21:48:29 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Volodymyr M. Lisivka 2009-06-10 05:09:46 EDT
This bug is still not fixed in mainstream.

This trivial patch must be applied to ant to fix it:
https://issues.apache.org/bugzilla/show_bug.cgi?id=45316#c3
Comment 6 Bug Zapper 2009-11-16 03:08:37 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Bug Zapper 2010-11-04 07:51:58 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 8 Bug Zapper 2010-12-05 02:10:12 EST
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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