Commits

Etienne Perot committed ad85a2c

Make DamnVid {Arch-style-python3-is-the-default}-friendly

Comments (0)

Files changed (4)

-#!/usr/bin/env python
+#!/usr/bin/env python2
 # -*- coding: utf-8 -*-
 # Copyright 2008 Etienne Perot
 

build-any/build-required-files.py

 if OSNAME=='posix' and sys.platform=='darwin':
 	OSNAME='mac'
 os.chdir(os.path.abspath(os.path.dirname(sys.argv[0]) + os.sep + '..'))
-procs(['python', 'build-any' + os.sep + 'cleanup.py'])
+try:
+	procs(['python2', 'build-any' + os.sep + 'cleanup.py'])
+except:
+	procs(['python', 'build-any' + os.sep + 'cleanup.py'])
 opts, args = getopt.getopt(sys.argv[1:], 'o:d:f:')
 outputFile = 'required-files.txt'
 destFolder = None
 		os.remove('modules' + os.sep + f)
 for f in os.listdir('modules'):
 	if os.path.isdir('modules' + os.sep + f) and goodFile(f):
-		procs(['python', 'build-any' + os.sep + 'module-package.py', 'modules' + os.sep + f])
+		try:
+			procs(['python2', 'build-any' + os.sep + 'module-package.py', 'modules' + os.sep + f])
+		except:
+			procs(['python', 'build-any' + os.sep + 'module-package.py', 'modules' + os.sep + f])
 for f in os.listdir('.'):
 	if f[-15:]=='.module.damnvid':
 		if os.path.exists('modules' + os.sep + f):

build-any/module-package.py

-#!/usr/bin/env python
+#!/usr/bin/env python2
 # -*- coding: utf-8 -*-
 
 import os
 args=sys.argv
 if len(args)!=2:
 	out('Invalid arguments.')
-	out('Usage: python ./module-package.py ./path-to-modules-folder/module')
+	out('Usage: ./module-package.py ./path-to-modules-folder/module')
 	out('Aborting.')
 	exit()
 module=args[1]
 			for i in os.listdir(DV.curdir + 'modules'):
 				if os.path.isdir(DV.curdir + 'modules/' + i) and i.find('svn') == -1:
 					Damnlog('Building module ' + i)
-					DamnSpawner(['python', 'build-any/module-package.py', DV.curdir + 'modules/' + i ], cwd=DV.curdir).wait()
+					try:
+						DamnSpawner(['python2', 'build-any/module-package.py', DV.curdir + 'modules/' + i ], cwd=DV.curdir).wait()
+					except:
+						DamnSpawner(['python', 'build-any/module-package.py', DV.curdir + 'modules/' + i ], cwd=DV.curdir).wait()
 			for i in os.listdir(DV.curdir):
 				if i.lower().endswith(u'.module.' + DV.safeProduct):
 					os.rename(DV.curdir + i, DV.curdir + 'modules/' + i)