Index: Rpm.java =================================================================== RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java,v retrieving revision 1.23 diff -c -r1.23 Rpm.java *** Rpm.java 8 Feb 2005 18:51:26 -0000 1.23 --- Rpm.java 13 Feb 2005 14:34:19 -0000 *************** *** 152,168 **** streamhandler = new PumpStreamHandler(outputstream, errorstream); } ! Execute exe = new Execute(streamhandler, null); ! ! exe.setAntRun(getProject()); ! if (topDir == null) { ! topDir = getProject().getBaseDir(); ! } ! exe.setWorkingDirectory(topDir); ! ! exe.setCommandline(toExecute.getCommandline()); try { log("Building the RPM based on the " + specFile + " file"); int returncode = exe.execute(); if (returncode != 0) { throw new BuildException("'" + --- 152,161 ---- streamhandler = new PumpStreamHandler(outputstream, errorstream); } ! Execute exe = getExecute(toExecute, streamhandler); try { log("Building the RPM based on the " + specFile + " file"); + // exe.execute(); int returncode = exe.execute(); if (returncode != 0) { throw new BuildException("'" + *************** *** 178,183 **** --- 171,194 ---- } /** + * @param toExecute + * @param streamhandler + * @return + */ + protected Execute getExecute(Commandline toExecute, ExecuteStreamHandler streamhandler) { + Execute exe = new Execute(streamhandler, null); + + exe.setAntRun(getProject()); + if (topDir == null) { + topDir = getProject().getBaseDir(); + } + exe.setWorkingDirectory(topDir); + + exe.setCommandline(toExecute.getCommandline()); + return exe; + } + + /** * The directory which will have the expected * subdirectories, SPECS, SOURCES, BUILD, SRPMS ; optional. * If this isn't specified,