This repository has been archived by the owner on Jul 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildit.py
executable file
·66 lines (60 loc) · 1.91 KB
/
buildit.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python
# encoding: utf-8
import re, os, sys, time, urllib2, getopt
import fileinput
def main():
# try:
# opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
# except getopt.GetoptError, err:
# # print help information and exit:
# print str(err) # will print something like "option -a not recognized"
# usage()
# sys.exit(2)
# output = None
# verbose = False
# for o, a in opts:
# if o == "-u":
# verbose = True
# elif o in ("-h", "--help"):
# usage()
# sys.exit()
# elif o in ("-o", "--output"):
# output = a
# else:
# assert False, "unhandled option"
print("about to build")
bob_the_builder()
def usage():
print("USAGE: buildit.py [-r REV] repos-path file")
sys.exit(1)
def patch_file(file, version):
data = open(file).read()
o = open(file, 'w')
data = re.sub("FFVERSION",str(version),data)
data = re.sub("FFMINORVERSION",str(version),data)
o.write(data)
o.close()
# for line in fileinput.FileInput(file,inplace=1):
# if "[VERSION]" in line:
# line=line.replace("[VERSION]",str(version))
# if "[MINORVERSION]" in line:
# line=line.replace("[MINORVERSION]",str(version))
#print "Patched "+str(file)+" on line"+line
#return
def bob_the_builder():
print("Bob be building")
os.popen("mkdir build/")
os.popen("rm -rf dsb.xpi")
os.popen("cp -R chrome build/")
os.popen("cp -R components build/")
os.popen("cp -R translations build/")
os.popen("cp -R defaults build/")
os.popen("cp -R install.rdf build/")
os.popen("cp -R chrome.manifest build/")
os.popen("cp -R license.txt build/")
os.chdir("build")
os.popen("zip -r ../dsb.xpi ./")
os.chdir("../")
os.popen("rm -rf build")
if __name__ == "__main__":
main()