forked from sabnzbd/sabnzbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.py
executable file
·663 lines (562 loc) · 21.2 KB
/
package.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
#!/usr/bin/env python -OO
#
# Copyright 2008-2012 The SABnzbd-Team <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from distutils.core import setup
import glob
import sys
import os
import platform
import tarfile
import re
import subprocess
import shutil
import time
try:
import py2exe
except ImportError:
py2exe = None
try:
import py2app
from setuptools import setup
OSX_ML = [int(n) for n in platform.mac_ver()[0].split('.')] >= [10, 8, 0]
OSX_LION = not OSX_ML and [int(n) for n in platform.mac_ver()[0].split('.')] >= [10, 7, 0]
OSX_SL = not OSX_LION and not OSX_ML
class WindowsError (): pass
except ImportError:
py2app = None
OSX_ML = OSX_LION = OSX_SL = False
VERSION_FILE = 'sabnzbd/version.py'
VERSION_FILEAPP = 'osx/resources/InfoPlist.strings'
my_version = 'unknown'
my_baseline = 'unknown'
def delete_files(name):
""" Delete one file or set of files from wild-card spec """
for f in glob.glob(name):
try:
if os.path.exists(f):
os.remove(f)
except:
print "Cannot remove file %s" % f
exit(1)
def CheckPath(name):
if os.name == 'nt':
sep = ';'
ext = '.exe'
else:
sep = ':'
ext = ''
for path in os.environ['PATH'].split(sep):
full = os.path.join(path, name+ext)
if os.path.exists(full):
return name+ext
print "Sorry, cannot find %s%s in the path" % (name, ext)
return None
def PatchVersion(name):
""" Patch in the Git commit hash, but only when this is
an unmodified checkout
"""
global my_version, my_baseline
commit = ''
try:
pipe = subprocess.Popen(GitVersion, shell=True, stdout=subprocess.PIPE).stdout
for line in pipe.read().split('\n'):
if 'commit ' in line:
commit = line.split(' ')[1].strip()
break
pipe.close()
except:
print 'Cannot run %s' % GitVersion
exit(1)
state = ' (not committed)'
try:
pipe = subprocess.Popen(GitStatus, shell=True, stdout=subprocess.PIPE).stdout
for line in pipe.read().split('\n'):
if 'nothing to commit' in line or 'nothing added to commit' in line:
state = ''
break
pipe.close()
except:
print 'Cannot run %s' % GitStatus
exit(1)
if not commit:
print "WARNING: Cannot run %s" % GitVersion
commit = 'unknown'
try:
ver = open(VERSION_FILE, 'rb')
text = ver.read()
ver.close()
except:
print "WARNING: cannot patch " + VERSION_FILE
return
my_baseline = commit + state
my_version = name
text = re.sub(r'__baseline__\s*=\s*"[^"]*"', '__baseline__ = "%s"' % my_baseline, text)
text = re.sub(r'__version__\s*=\s*"[^"]*"', '__version__ = "%s"' % my_version, text)
try:
ver = open(VERSION_FILE, 'wb')
ver.write(text)
ver.close()
except:
print "WARNING: cannot patch " + VERSION_FILE
def PairList(src):
""" Given a list of files and dirnames,
return a list of (destn-dir, sourcelist) tuples.
A file returns (path, [name])
A dir returns for its root and each of its subdirs
(path, <list-of-files>)
Always return paths with Unix slashes.
Skip all Git elements, .bak .pyc .pyo and *.~*
"""
lst = []
for item in src:
if item.endswith('/'):
for root, dirs, files in os.walk(item.rstrip('/\\')):
path = root.replace('\\', '/')
if path.find('.git') < 0:
flist = []
for file in files:
if not (file.endswith('.bak') or file.endswith('.pyc') or file.endswith('.pyo') or '~' in file):
flist.append(os.path.join(root, file).replace('\\','/'))
if flist:
lst.append((path, flist))
else:
path, name = os.path.split(item)
items = [name]
lst.append((path, items))
return lst
def CreateTar(folder, fname, release):
""" Create tar.gz file for source distro """
tar = tarfile.open(fname, "w:gz")
for root, dirs, files in os.walk(folder):
for _file in files:
uroot = root.replace('\\','/')
if (uroot.find('/win') < 0) and (uroot.find('licenses/Python') < 0) and not _file.endswith('.git'):
path = os.path.join(root, _file)
fpath = path.replace('srcdist\\', release+'/').replace('\\', '/')
tarinfo = tar.gettarinfo(path, fpath)
tarinfo.uid = 0
tarinfo.gid = 0
if _file in ('SABnzbd.py', 'Sample-PostProc.sh', 'make_mo.py', 'msgfmt.py'): # One day add: 'setup.py'
# Force Linux/OSX scripts as excutable
tarinfo.mode = 0755
else:
tarinfo.mode = 0644
f= open(path, "rb")
tar.addfile(tarinfo, f)
f.close()
tar.close()
def Dos2Unix(name):
""" Read file, remove \r and write back """
base, ext = os.path.splitext(name)
if ext.lower() not in ('.py', '.txt', '.css', '.js', '.tmpl', '.sh', '.cmd'):
return
print name
try:
f = open(name, 'rb')
data = f.read()
f.close()
except:
print "File %s does not exist" % name
exit(1)
data = data.replace('\r', '')
try:
f = open(name, 'wb')
f.write(data)
f.close()
except:
print "Cannot write to file %s" % name
exit(1)
def Unix2Dos(name):
""" Read file, remove \r, replace \n by \r\n and write back """
base, ext = os.path.splitext(name)
if ext.lower() not in ('.py', '.txt', '.css', '.js', '.tmpl', '.sh', '.cmd', '.mkd'):
return
print name
try:
f = open(name, 'rb')
data = f.read()
f.close()
except:
print "File %s does not exist" % name
exit(1)
data = data.replace('\r', '')
data = data.replace('\n', '\r\n')
try:
f = open(name, 'wb')
f.write(data)
f.close()
except:
print "Cannot write to file %s" % name
exit(1)
def rename_file(folder, old, new):
oldpath = "%s/%s" % (folder, old)
newpath = "%s/%s" % (folder, new)
try:
if os.path.exists(newpath):
os.remove(newpath)
os.rename(oldpath, newpath)
except WindowsError:
print "Cannot create %s" % newpath
exit(1)
print sys.argv[0]
Git = CheckPath('git')
ZipCmd = CheckPath('zip')
UnZipCmd = CheckPath('unzip')
if os.name != 'nt':
PanDoc = CheckPath('pandoc')
else:
PanDoc = None
if os.name == 'nt':
msg = 'Requires the standard version of NSIS'
NSIS = CheckPath('makensis')
if NSIS:
log = '%s.log' % NSIS
os.system('%s >%s' % (NSIS, log))
if 'Unicode' not in open(log).read():
msg = ''
delete_files(log)
if msg:
print msg
exit(1)
else:
NSIS = '-'
GitRevertApp = Git + ' checkout -- '
GitRevertVersion = GitRevertApp + ' ' + VERSION_FILE
GitVersion = Git + ' log -1'
GitStatus = Git + ' status'
if not (Git and ZipCmd and UnZipCmd):
print 'Missing programs. Need "git", "zip" and "unzip"'
exit(1)
if len(sys.argv) < 2:
target = None
else:
target = sys.argv[1]
if target not in ('source', 'binary', 'installer', 'app'):
print 'Usage: package.py binary|installer|source|app'
exit(1)
# Derive release name from path
base, release = os.path.split(os.getcwd())
prod = 'SABnzbd-' + release
Win32ServiceName = 'SABnzbd-service.exe'
Win32ServiceHelpName = 'SABnzbd-helper.exe'
Win32ConsoleName = 'SABnzbd-console.exe'
Win32WindowName = 'SABnzbd.exe'
Win32HelperName = 'SABHelper.exe'
Win32TempName = 'SABnzbd-windows.exe'
fileIns = prod + '-win32-setup.exe'
fileBin = prod + '-win32-bin.zip'
fileSrc = prod + '-src.tar.gz'
fileDmg_ml = prod + '-osx-mountainlion.dmg'
fileDmg_lion = prod + '-osx-lion.dmg'
fileDmg_sl = prod + '-osx-snowleopard.dmg'
fileOSr = prod + '-osx-src.tar.gz'
fileImg = prod + '.sparseimage'
if OSX_SL: postfix = 'sl'
if OSX_LION: postfix = 'lion'
if OSX_ML: postfix = 'ml'
PatchVersion(release)
# List of data elements, directories end with a '/'
data_files = [
'ABOUT.txt',
'README.mkd',
'INSTALL.txt',
'GPL2.txt',
'GPL3.txt',
'CHANGELOG.txt',
'COPYRIGHT.txt',
'ISSUES.txt',
'Sample-PostProc.cmd',
'Sample-PostProc.sh',
'PKG-INFO',
'licenses/',
'locale/',
'email/',
'interfaces/Classic/',
'interfaces/smpl/',
'interfaces/Plush/',
'interfaces/Mobile/',
'interfaces/wizard/',
'interfaces/Config/',
'win/par2/',
'win/unzip/',
'win/unrar/',
'icons/'
]
options = dict(
name = 'SABnzbd',
version = release,
url = 'http://sourceforge.net/projects/sabnzbdplus',
author = 'The SABnzbd-Team',
author_email = '[email protected]',
scripts = ['SABnzbd.py', 'SABHelper.py'], # One day, add 'setup.py'
packages = ['sabnzbd', 'sabnzbd.utils', 'util'],
platforms = ['posix'],
license = 'GNU General Public License 2 (GPL2) or later',
data_files = []
)
if target == 'app':
if not platform.system() == 'Darwin':
print "Sorry, only works on Apple OSX!"
os.system(GitRevertVersion)
exit(1)
if not PanDoc:
print "Sorry, requires pandoc in the $PATH"
os.system(GitRevertVersion)
exit(1)
# Check which Python flavour
apple_py = 'ActiveState' not in sys.copyright
options['description'] = 'SABnzbd ' + str(my_version)
# Remove previous build result
os.system('rm -rf dist/ build/')
# Create MO files
os.system('python ./tools/make_mo.py')
# build SABnzbd.py
sys.argv[1] = 'py2app'
APP = ['SABnzbd.py']
DATA_FILES = ['interfaces', 'locale', 'email', ('', glob.glob("osx/resources/*"))]
NZBFILE = dict(
CFBundleTypeExtensions = [ "nzb" ],
CFBundleTypeIconFile = 'nzbfile.icns',
CFBundleTypeMIMETypes = [ "text/nzb" ],
CFBundleTypeName = 'NZB File',
CFBundleTypeRole = 'Viewer',
LSTypeIsPackage = 0,
NSPersistentStoreTypeKey = 'Binary',
)
OPTIONS = {'argv_emulation': not apple_py,
'iconfile': 'osx/resources/sabnzbdplus.icns',
'plist': {
'NSUIElement':1,
'CFBundleShortVersionString':release,
'NSHumanReadableCopyright':'The SABnzbd-Team',
'CFBundleIdentifier':'org.sabnzbd.team',
'CFBundleDocumentTypes':[NZBFILE],
},
'packages': "email,xml,Cheetah",
'excludes': ["pywin", "pywin.debugger", "pywin.debugger.dbgcon", "pywin.dialogs",
"pywin.dialogs.list", "Tkconstants", "Tkinter", "tcl"]
}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS },
setup_requires=['py2app'],
)
# Remove 64bit code
if not OSX_SL:
os.system("mv dist/SABnzbd.app dist/SABnzbd.app.temp")
os.system("ditto --arch i386 --arch ppc dist/SABnzbd.app.temp dist/SABnzbd.app/")
os.system("rm -rf dist/SABnzbd.app.temp")
# copy unrar & par2 binary
os.system("mkdir dist/SABnzbd.app/Contents/Resources/osx>/dev/null")
os.system("mkdir dist/SABnzbd.app/Contents/Resources/osx/par2>/dev/null")
os.system("cp -pR osx/par2/ dist/SABnzbd.app/Contents/Resources/osx/par2>/dev/null")
os.system("mkdir dist/SABnzbd.app/Contents/Resources/osx/unrar>/dev/null")
os.system("cp -pR osx/unrar/license.txt dist/SABnzbd.app/Contents/Resources/osx/unrar/ >/dev/null")
if OSX_SL:
os.system("cp -pR osx/unrar/unrar-leopard dist/SABnzbd.app/Contents/Resources/osx/unrar/unrar >/dev/null")
else:
os.system("cp -pR osx/unrar/unrar dist/SABnzbd.app/Contents/Resources/osx/unrar/ >/dev/null")
os.system("cp icons/sabnzbd.ico dist/SABnzbd.app/Contents/Resources >/dev/null")
os.system("pandoc -f markdown -t rtf -s -o dist/SABnzbd.app/Contents/Resources/Credits.rtf README.mkd >/dev/null")
os.system("find dist/SABnzbd.app -name .git | xargs rm -rf")
# Remove source files to prevent re-compilation, which would invalidate signing
py_ver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
os.system("find dist/SABnzbd.app/Contents/Resources/lib/python%s/Cheetah -name '*.py' | xargs rm" % py_ver)
os.system("find dist/SABnzbd.app/Contents/Resources/lib/python%s/xml -name '*.py' | xargs rm" % py_ver)
os.system('rm dist/SABnzbd.app/Contents/Resources/site.py')
# Add the SabNotifier app
if OSX_ML and os.path.exists(os.path.join(os.environ['HOME'], 'sabnotifier/SABnzbd.app')):
os.system("cp -pR $HOME/sabnotifier/SABnzbd.app dist/SABnzbd.app/Contents/Resources/")
# Add License files
os.mkdir("dist/SABnzbd.app/Contents/Resources/licenses/")
os.system("cp -p licenses/*.txt dist/SABnzbd.app/Contents/Resources/licenses/")
os.system("cp -p *.txt dist/SABnzbd.app/Contents/Resources/licenses/")
os.system("sleep 5")
# Archive result to share, if present
dest_path = os.environ.get('SHARE')
if dest_path and os.path.exists(dest_path):
cpio_path = os.path.join(dest_path, prod) + '-' + postfix + '.cpio'
print 'Create CPIO file %s' % cpio_path
delete_files(cpio_path)
os.system('ditto -c -z dist/ "%s"' % cpio_path)
else:
print 'No SHARE variable set, build result not copied'
if OSX_ML:
print 'Create src %s' % fileOSr
delete_files(fileOSr)
os.system('tar -czf "%s" --exclude ".git*" --exclude "sab*.zip" --exclude "SAB*.tar.gz" --exclude "*.cmd" --exclude "*.pyc" '
'--exclude "*.sparseimage*" --exclude "dist" --exclude "build" --exclude "*.nsi" --exclude "win" --exclude "*.dmg" '
'./ >/dev/null' % os.path.join(dest_path, fileOSr) )
os.system(GitRevertApp + VERSION_FILEAPP)
os.system(GitRevertApp + VERSION_FILE)
elif target in ('binary', 'installer'):
if not py2exe:
print "Sorry, only works on Windows!"
os.system(GitRevertVersion)
exit(1)
# Create MO files
os.system('tools\\make_mo.py all')
options['data_files'] = PairList(data_files)
options['description'] = 'SABnzbd ' + str(my_version)
sys.argv[1] = 'py2exe'
program = [ {'script' : 'SABnzbd.py', 'icon_resources' : [(0, "icons/sabnzbd.ico")] } ]
options['options'] = {"py2exe":
{
"bundle_files": 3,
"packages": "email,xml,Cheetah,win32file",
"excludes": ["pywin", "pywin.debugger", "pywin.debugger.dbgcon", "pywin.dialogs",
"pywin.dialogs.list", "Tkconstants", "Tkinter", "tcl"],
"optimize": 2,
"compressed": 0
}
}
options['zipfile'] = 'lib/sabnzbd.zip'
options['scripts'] = ['SABnzbd.py']
############################
# Generate the console-app
options['console'] = program
setup(**options)
rename_file('dist', Win32WindowName, Win32ConsoleName)
# Make sure that all TXT and CMD files are DOS format
for tup in options['data_files']:
for file in tup[1]:
name, ext = os.path.splitext(file)
if ext.lower() in ('.txt', '.cmd', '.mkd'):
Unix2Dos("dist/%s" % file)
delete_files('dist/Sample-PostProc.sh')
delete_files('dist/PKG-INFO')
delete_files('*.ini')
############################
# Generate the windowed-app
options['windows'] = program
del options['data_files']
del options['console']
setup(**options)
rename_file('dist', Win32WindowName, Win32TempName)
############################
# Generate the service-app
options['service'] = [{'modules':["SABnzbd"], 'cmdline_style':'custom'}]
del options['windows']
setup(**options)
rename_file('dist', Win32WindowName, Win32ServiceName)
# Give the Windows app its proper name
rename_file('dist', Win32TempName, Win32WindowName)
############################
# Generate the Helper service-app
options['scripts'] = ['SABHelper.py']
options['zipfile'] = 'lib/sabhelper.zip'
options['service'] = [{'modules':["SABHelper"], 'cmdline_style':'custom'}]
options['packages'] = ['util']
options['data_files'] = []
options['options']['py2exe']['packages'] = "win32file"
setup(**options)
rename_file('dist', Win32HelperName, Win32ServiceHelpName)
############################
# Remove unwanted system DLL files that Py2Exe copies when running on Win7
delete_files(r'dist\lib\API-MS-Win-*.dll')
delete_files(r'dist\lib\MSWSOCK.DLL')
delete_files(r'dist\lib\POWRPROF.DLL')
delete_files(r'dist\lib\KERNELBASE.dll')
############################
# Remove .git residue
delete_files(r'dist\interfaces\Config\.git')
############################
# Copy Curl if needed
if sys.version_info < (2, 6):
# Curl for Python 2.5
os.system(r'unzip -o win\curl\curl.zip -d dist\lib')
############################
# Fix icon issue with NZB association
os.system(r'copy dist\icons\nzb.ico dist')
############################
# Rename MKD file
rename_file('dist', 'README.mkd', 'README.txt')
############################
if target == 'installer':
delete_files(fileIns)
os.system('makensis.exe /v3 /DSAB_PRODUCT=%s /DSAB_VERSION=%s /DSAB_FILE=%s NSIS_Installer.nsi.tmp' % \
(prod, release, fileIns))
delete_files('NSIS_Installer.nsi.tmp')
if not os.path.exists(fileIns):
print 'Fatal error creating %s' % fileIns
exit(1)
delete_files(fileBin)
os.rename('dist', prod)
os.system('zip -9 -r -X %s %s' % (fileBin, prod))
time.sleep(1.0)
os.rename(prod, 'dist')
os.system(GitRevertVersion)
############################
# Check for uncompressed sqlite3.dll
if os.path.getsize('dist/lib/sqlite3.dll') < 400000L:
print
print '>>>> WARNING: compressed version of sqlite3.dll detected, use uncompressed version!!'
print
else:
# Prepare Source distribution package.
# Make sure all source files are Unix format
import shutil
# Create MO files
os.system('python tools/make_mo.py all')
root = 'srcdist'
root = os.path.normpath(os.path.abspath(root))
if not os.path.exists(root):
os.mkdir(root)
# Set data files
data_files.extend(['po/', 'cherrypy/', 'gntp/'])
options['data_files'] = PairList(data_files)
options['data_files'].append(('tools', ['tools/make_mo.py', 'tools/msgfmt.py']))
# Copy the data files
for set in options['data_files']:
dest, src = set
ndir = root + '/' + dest
ndir = os.path.normpath(os.path.abspath(ndir))
if not os.path.exists(ndir):
os.makedirs(ndir)
for file in src:
shutil.copy2(file, ndir)
Dos2Unix(ndir + '/' + os.path.basename(file))
# Copy the script files
for name in options['scripts']:
file = os.path.normpath(os.path.abspath(name))
shutil.copy2(file, root)
base = os.path.basename(file)
fullname = os.path.normpath(os.path.abspath(root + '/' + base))
Dos2Unix(fullname)
# Copy all content of the packages (but skip backups and pre-compiled stuff)
for unit in options['packages']:
unitpath = unit.replace('.','/')
dest = os.path.normpath(os.path.abspath(root + '/' + unitpath))
if not os.path.exists(dest):
os.makedirs(dest)
for name in glob.glob("%s/*.*" % unitpath):
file = os.path.normpath(os.path.abspath(name))
front, ext = os.path.splitext(file)
base = os.path.basename(file)
fullname = os.path.normpath(os.path.abspath(dest + '/' + base))
if (ext.lower() not in ('.pyc', '.pyo', '.bak')) and '~' not in ext:
shutil.copy2(file, dest)
Dos2Unix(fullname)
############################
# Rename MKD file
rename_file(root, 'README.mkd', 'README.txt')
os.chdir(root)
os.chdir('..')
# Prepare the TAR.GZ pacakge
CreateTar('srcdist', fileSrc, prod)
os.system(GitRevertVersion)