I'm working on a script to be able to setup a complete new drupal installation.
Apart from setting up the default project structure in our subversion tree
/trunk/db/
/trunk/docs/
/trunk/files/
/trunk/www/
and using a local subdomain like http://localhost.krimson for each project
i was also looking for a simple way to download and install the latest drupal version from the commandline.
We all know that you can query http://updates.drupal.org/release-history/drupal/6.x to get a complete release version history of the drupal project. The task now was to be able to grab the latest version from that XML.
Hurray, hurray.. thanks to bashcurescancer.com/the-best-in-command-line-xml-xmlstarlet i learned that xmlstarlet would do the trick for me.
I installed the latest xmlstarlet lib using
sudo apt-get install xmlstarlet
and than i ran
curl -s 'http://updates.drupal.org/release-history/drupal/6.x' | xmlstarlet sel -t -m '//releases/release[1]/version' -v '.' 6.x
which returned the simple answer
6.6
I love those open source tools!






Post new comment