File: update-mingwlibs.py

package info (click to toggle)
spring 103.0%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 43,720 kB
  • ctags: 63,685
  • sloc: cpp: 368,283; ansic: 33,988; python: 12,417; java: 12,203; awk: 5,879; sh: 1,846; xml: 655; perl: 405; php: 211; objc: 194; makefile: 77; sed: 2
file content (26 lines) | stat: -rwxr-xr-x 900 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python

import os, subprocess, shutil
import prepare

MINGWLIBS_PATH="vclibs"
if "MINGWLIBS_PATH" in os.environ:
	MINGWLIBS_PATH = os.environ["MINGWLIBS_PATH"]
print('MINGWLIBS_PATH=%s' %(MINGWLIBS_PATH))

assert(len(MINGWLIBS_PATH) > 0)

if not os.path.isdir(MINGWLIBS_PATH):
	print("cloning mingwlibs git-repo...")
	subprocess.call(["git", "clone", "git://github.com/spring/vclibs14.git", MINGWLIBS_PATH])
else:
	process = subprocess.Popen(["git", "fetch"], cwd=MINGWLIBS_PATH, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
	stdout, stderr = process.communicate()
	output = stdout + stderr
	print(output)
	if len(output) > 0:
		print("removing builddir %s (mingwlibs updated)"%(prepare.BUILDDIR))
		shutil.rmtree(prepare.BUILDDIR)
		subprocess.call(["git","clean", "-f", "-d"], cwd=MINGWLIBS_PATH)
		subprocess.call(["git","reset", "--hard", "origin/master"], cwd=MINGWLIBS_PATH)