Uglyish and not entirely tested form of init-build-sys.sh integration

This commit is contained in:
Alexander van Gessel 2012-08-10 17:41:15 +01:00
parent a91ee3b6b4
commit 79d1be5abf

View file

@ -150,6 +150,8 @@ if __name__ == "__main__":
github = libgithub.GitHub(wescamp_dir, git_version, userpass=git_userpass)
is_new_addon = False
# If the checkout doesn't exist we need to create it.
if(os.path.isdir(os.path.join(wescamp_dir, addon)) == False):
@ -159,6 +161,8 @@ if __name__ == "__main__":
if not github.addon_exists(addon):
github.create_addon(addon)
is_new_addon = True
# Update the directory
addon_obj = github.addon(addon)
addon_obj.update()
@ -176,6 +180,25 @@ if __name__ == "__main__":
logging.info("Addon '%s' hasn't been modified, thus not uploaded.",
addon)
if is_new_addon:
# Grab the build system
below_branch = os.path.basename(wescamp_dir.rstrip(os.sep))
possible_build_path = os.path.join(below_branch, "build-system")
build_system = libgithub.get_build_system([possible_build_path])
build_system.update()
init_script = os.path.join(build_system.get_dir(), "init-build-sys.sh")
# Uglyness
out, err = addon_obj._execute([init_script, "--{0}".format(git_version), addon, "."], check_error=False)
if not out.strip().endswith("Done."):
logging.error("Failed to init the build-system for addon {0}".format(addon))
return
out, err = addon_obj._execute(["git", "add", "po", "campaign.def", "Makefile"], check_error=True)
addon_obj.commit("Initialize build-system")
"""Update the translations from wescamp to the server.
server The url of the addon server eg