New QtC 4.1 based IDE with LXD backend

This commit is contained in:
Benjamin Zeller
2016-08-26 16:14:29 +02:00
parent 6ccb277e73
commit 4d722b7954
9961 changed files with 404891 additions and 393997 deletions

37
get_git_source.py Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env python3
import os
import sys
import shutil
import subprocess
from optparse import OptionParser
parser = OptionParser(usage="usage: %prog [options] <repository>")
parser.add_option(
"-d", "--directory", dest="source_dir")
parser.add_option(
"-b", "--branch", dest="source_branch")
options, args = parser.parse_args()
if len(args) != 1:
parser.error("No branch URL given")
if options.source_dir is None:
parser.error("Source directory not specified")
if os.path.exists(options.source_dir):
print("Source directory exists.... removing it")
shutil.rmtree(options.source_dir)
print("Pulling branch "+args[0]+" into "+os.path.abspath(options.source_dir)+"\n")
if options.source_branch is None:
ret = subprocess.call(["git", "clone", "--depth", "1", args[0], options.source_dir])
else:
ret = subprocess.call(["git", "clone", "--depth", "1", "-b", options.source_branch, args[0], options.source_dir])
if ret != 0:
sys.exit(ret)
#destroy the git history
shutil.rmtree(options.source_dir+"/.git")
sys.exit(0)