Bug 863005 - ant overrides ANT_HOME
Summary: ant overrides ANT_HOME
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: ant
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaromír Cápík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-04 08:07 UTC by Rasmus Kaj
Modified: 2016-02-01 01:57 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-04 10:22:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
fixed ant.conf (459 bytes, application/octet-stream)
2012-10-04 08:07 UTC, Rasmus Kaj
no flags Details

Description Rasmus Kaj 2012-10-04 08:07:44 UTC
Created attachment 621431 [details]
fixed ant.conf

Description of problem:

   Ant overrides ANT_HOME in /etc/ant.conf

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

   ant-1.8.3-1.fc17

How reproducible:

   Always

Steps to Reproduce:
1. export ANT_HOME=/some/path/ant-other-version
2. ant
3. note that the system packaged 1.8.3 runs instead of (or interferes with) the old version
  
Actual results:

  Ant runs with ANT_HOME=/usr/share/ant

Expected results:

  Ant should run with the ANT_HOME exported from the shell.

Additional info:

  The attached replacing /etc/ant.conf with the attached file fixes the problem by checking if ANT_HOME is set before overriding it.  Also, if ANT_HOME has a user-provided value, rpm_mode should probably be false.

Comment 1 Alexander Kurtakov 2012-10-04 09:10:46 UTC
exporting ANT_HOME does not change your PATH so calling ant will still start /usr/bin/ant.
If you want to use another ant version do export PATH=/path/to/your/new/ant/bin:$PATH

Comment 2 Alexander Kurtakov 2012-10-04 09:19:25 UTC
Also you need to provide patches against http://pkgs.fedoraproject.org/cgit/ant.git/. 
Also if you look into /usr/bin/ant (which I think you're running) there is 
if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ]; then
      if [ -f "/etc/ant.conf" ] ; then
          . /etc/ant.conf
      fi
  fi

and this is what you have done in ant.conf but /etc/ant.conf is sourced only if ANT_HOME is not defined or points to /usr/share/ant so I don't see how does changing ant.conf to consider ANT_HOME help at all.

Comment 3 Rasmus Kaj 2012-10-04 10:22:40 UTC
Ah, sorry.  I should just make sure that /some/path/ant-other-version/bin/ant contains a similar conditional and ignores /etc/ant.conf if ANT_HOME is set then.

Yes, that is probably a better solution.

Thank you.  I'm closing this issue as NOTABUG.


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