#!/bin/bash # get list of all builds and retrieve the last one LAST_BUILD=`curl -s http://bits.netbeans.org/download/trunk/nightly/ | grep "[DIR]" | grep ">2010" | sed 's/ *//g' | sed 's/<\/a>/|/g' | sed 's/\/|/g' | cut -f2 -d"|" | sort | tail -1` #LAST_BUILD="2010-11-16_00-01-05" echo "Downloading bundles list for build: $LAST_BUILD" # retrieve bundles BUNDLE_NAME=`curl -s http://bits.netbeans.org/download/trunk/nightly/$LAST_BUILD/bundles/ | grep "ml-macosx" | sed 's//|/g' | cut -f3 -d"|"` if [ "X$BUNDLE_NAME" != "X" ]; then echo "Downloading build:" echo "http://bits.netbeans.org/download/trunk/nightly/$LAST_BUILD/bundles/$BUNDLE_NAME" curl -s http://bits.netbeans.org/download/trunk/nightly/$LAST_BUILD/bundles/$BUNDLE_NAME -O $BUNDLE_NAME rm -rf /Applications/NetBeans # attach dmg file hdiutil attach -mountpoint /tmp/nb_installer ./$BUNDLE_NAME # install Net Beans at root directory (inside /Applications) PACKAGE_NAME=`find /tmp/nb_installer -name "*.mpkg" 2>/dev/null` installer -pkg "$PACKAGE_NAME" -target / # detach image and clean up hdiutil detach /tmp/nb_installer/ rm $BUNDLE_NAME else echo "Bundle for MacOSX is not available" fi