|
|
@ -207,7 +207,7 @@ def Dos2Unix(name): |
|
|
|
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'): |
|
|
|
if ext.lower() not in ('.py', '.txt', '.css', '.js', '.tmpl', '.sh', '.cmd', '.mkd'): |
|
|
|
return |
|
|
|
|
|
|
|
print name |
|
|
@ -246,7 +246,10 @@ print sys.argv[0] |
|
|
|
Git = CheckPath('git') |
|
|
|
ZipCmd = CheckPath('zip') |
|
|
|
UnZipCmd = CheckPath('unzip') |
|
|
|
PanDoc = CheckPath('pandoc') |
|
|
|
if os.name != 'nt': |
|
|
|
PanDoc = CheckPath('pandoc') |
|
|
|
else: |
|
|
|
PanDoc = None |
|
|
|
|
|
|
|
if os.name == 'nt': |
|
|
|
msg = 'Requires the standard version of NSIS' |
|
|
@ -307,7 +310,7 @@ PatchVersion(release) |
|
|
|
# List of data elements, directories end with a '/' |
|
|
|
data_files = [ |
|
|
|
'ABOUT.txt', |
|
|
|
'README.txt', |
|
|
|
'README.mkd', |
|
|
|
'INSTALL.txt', |
|
|
|
'GPL2.txt', |
|
|
|
'GPL3.txt', |
|
|
@ -353,6 +356,11 @@ if target == 'app': |
|
|
|
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 |
|
|
|
|
|
|
@ -459,7 +467,7 @@ if target == 'app': |
|
|
|
'--exclude "*.sparseimage*" --exclude "dist" --exclude "build" --exclude "*.nsi" --exclude "win" --exclude "*.dmg" ' |
|
|
|
'./ >/dev/null' % (fileOSr) ) |
|
|
|
|
|
|
|
# Copy README.txt |
|
|
|
# Generate README.rtf |
|
|
|
os.system("cp dist/SABnzbd.app/Contents/Resources/Credits.rtf /Volumes/%s/README.rtf" % volume) |
|
|
|
|
|
|
|
#Unmount sparseimage |
|
|
@ -523,7 +531,7 @@ elif target in ('binary', 'installer'): |
|
|
|
for tup in options['data_files']: |
|
|
|
for file in tup[1]: |
|
|
|
name, ext = os.path.splitext(file) |
|
|
|
if ext.lower() in ('.txt', '.cmd'): |
|
|
|
if ext.lower() in ('.txt', '.cmd', '.mkd'): |
|
|
|
Unix2Dos("dist/%s" % file) |
|
|
|
DeleteFiles('dist/Sample-PostProc.sh') |
|
|
|
DeleteFiles('dist/PKG-INFO') |
|
|
@ -585,6 +593,10 @@ elif target in ('binary', 'installer'): |
|
|
|
os.system(r'copy dist\icons\nzb.ico dist') |
|
|
|
|
|
|
|
############################ |
|
|
|
# Rename MKD file |
|
|
|
rename_file('dist', 'README.mkd', 'README.txt') |
|
|
|
|
|
|
|
############################ |
|
|
|
if target == 'installer': |
|
|
|
DeleteFiles(fileIns) |
|
|
|
os.system('makensis.exe /v3 /DSAB_PRODUCT=%s /DSAB_VERSION=%s /DSAB_FILE=%s NSIS_Installer.nsi.tmp' % \ |
|
|
@ -661,6 +673,10 @@ else: |
|
|
|
shutil.copy2(file, dest) |
|
|
|
Dos2Unix(fullname) |
|
|
|
|
|
|
|
############################ |
|
|
|
# Rename MKD file |
|
|
|
rename_file(root, 'README.mkd', 'README.txt') |
|
|
|
|
|
|
|
os.chdir(root) |
|
|
|
os.chdir('..') |
|
|
|
|
|
|
|