#!/usr/bin/env lua5.1 -- used to maintain the symbolic links REPOSITORY_DIR = os.getenv("HOME").."/public_html/repository/bootstraptools" -- Are there bootstraptools packs ? files = io.popen("ls $HOME/openbus/packs/openbus*bootstraptools*.tar.gz") -- indexed by platform newer = {} plat = "" rev = "" filename = "" while (plat) do filename = files:read("*l") if not filename then break end parse = filename:gmatch("openbus%-(.*)%-bootstraptools%-(.+)%.tar%.gz") rev,plat = parse() -- saving in table the last revision package if type(plat) == "string" then newer[plat] = filename end end for plat, file in pairs(newer) do print("Updating symbolic link to the bootstraptools package named:"..file) assert(os.execute(" cd "..REPOSITORY_DIR.." && rm -f openbus-*-bootstraptools-"..plat..".tar.gz") == 0) assert(os.execute(" cd "..REPOSITORY_DIR.." && ln -s "..file.." .") == 0) end