Pull package version from specified branch instead of the working set

This commit is contained in:
Jason Perkins 2015-02-23 17:34:16 -05:00
parent fd11fd3f60
commit 6b5b04c03b

View File

@ -53,9 +53,8 @@
-- Figure out what I'm making.
--
local f = io.open("../src/host/premake.c", "r")
local text = f:read("*a")
f:close()
os.chdir("..")
local text = os.outputof(string.format('hg cat -r %s src/host/premake.c', branch))
local _, _, version = text:find('VERSION%s*"([%w%p]+)"')
local pkgName = "premake-" .. version
@ -84,13 +83,12 @@
--
print("Preparing release folder")
os.chdir("..")
os.mkdir("release")
os.chdir("release")
os.rmdir(pkgName)
print("Cloning source code")
local z = os.executef("hg clone .. -r %s %s", branch, pkgName)
z = os.executef("hg clone .. -r %s %s", branch, pkgName)
if z ~= 0 then
error("clone failed", 0)
end
@ -109,11 +107,9 @@
--
-- Generate a source package.
-- Clear out files I don't want included in any packages.
--
if kind == "source" then
print("Cleaning up the source tree...")
os.rmdir("packages")
@ -127,6 +123,13 @@ if kind == "source" then
end
end
--
-- Generate a source package.
--
if kind == "source" then
print("Generating project files...")
execQuiet("premake5 /to=build/vs2005 vs2005")
execQuiet("premake5 /to=build/vs2008 vs2008")