Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 453121 - ant fails to build rpm package when build directory contains "-" char due to missing space char between option and directory
Summary: ant fails to build rpm package when build directory contains "-" char due to ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: ant
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-27 12:47 UTC by Volodymyr M. Lisivka
Modified: 2010-12-05 07:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-05 07:10:12 UTC


Attachments (Terms of Use)

Description Volodymyr M. Lisivka 2008-06-27 12:47:35 UTC
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 19:49:44 UTC
Reassigning to rpm, rpmdevtools does not have anything to do with this AFAICT.

Comment 2 Volodymyr M. Lisivka 2008-07-01 13:05:41 UTC
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 13:47:13 UTC
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-10 01:48:29 UTC
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 09:09:46 UTC
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 08:08:37 UTC
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 11:51:58 UTC
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 07:10:12 UTC
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.