Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uninstalling with ANT's RPM target

 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can we uninstall a package from an ant's script. If yes, how?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://ant.apache.org/manual/Tasks/rpm.html lists the capabilities.
 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Verburg,
Thanks. Actually I have seen that page earlier. There is a task named "command". That seems helpful to me. But the thing is that we need to include the spec file in each step as it is mandatory. That is kind of a problem. Because I want to have two tasks in ant file
1)ant install from spec file
2)Ant uninstall by simply running the Linux's rpm -e foobar command.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Ant's exec task to execute commands on the command line
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't confuse the "rpm" command with the "rpmbuild" command. Unless at long last they finally laid it to rest, the official RPM docs say that the command to build RPMs is "rpm -ba" and that hasn't been the case for years.

To create an RPM, use Ant's rpmbuild task. To install, update, validate or remove an RPM, use the OS "rpm" command via Ant's exec task.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic