#!/usr/bin/env python
import urllib2, re, glob, shutil

dlpage = urllib2.urlopen("http://www.boost.org/users/download/")
version, = re.findall(r'''https?://sourceforge\.net/projects/boost/files/boost/([0-9.]+)''', dlpage.read())

newBuildFile = "boost-" + version + ".build"
buildFile, = glob.glob("boost-*.build")

if buildFile != newBuildFile:
    print "mv {old} {new}".format(old=buildFile, new=newBuildFile)
    shutil.move(buildFile, newBuildFile)
