SF.net SVN: geany:[5398] trunk/waf

eht16 at users.sourceforge.net eht16 at xxxxx
Thu Nov 11 13:42:36 UTC 2010


Revision: 5398
          http://geany.svn.sourceforge.net/geany/?rev=5398&view=rev
Author:   eht16
Date:     2010-11-11 13:42:36 +0000 (Thu, 11 Nov 2010)

Log Message:
-----------
Update Waf to version 1.6.1

Modified Paths:
--------------
    trunk/waf

Modified: trunk/waf
===================================================================
--- trunk/waf	2010-11-11 13:27:34 UTC (rev 5397)
+++ trunk/waf	2010-11-11 13:42:36 UTC (rev 5398)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-# encoding: utf-8
-# Thomas Nagy, 2005-2009
+# encoding: ISO8859-1
+# Thomas Nagy, 2005-2010
 
 """
 Redistribution and use in source and binary forms, with or without
@@ -31,24 +31,19 @@
 """
 
 import os, sys
-if sys.hexversion<0x203000f: raise ImportError("Waf requires Python >= 2.3")
 
-if 'PSYCOWAF' in os.environ:
-	try:import psyco;psyco.full()
-	except:pass
-
-VERSION="1.5.7"
-REVISION="8edda22ed216daab7aed3d430dc291cf"
+VERSION="1.6.1"
+REVISION="1369902f3a1b0afb93dd6cdf3068f626"
 INSTALL=''
-C1='#+'
-C2='#)'
+C1='#)'
+C2='#('
 cwd = os.getcwd()
 join = os.path.join
 
+
 WAF='waf'
 def b(x):
 	return x
-
 if sys.hexversion>0x300000f:
 	WAF='waf3'
 	def b(x):
@@ -60,14 +55,14 @@
 
 def unpack_wafdir(dir):
 	f = open(sys.argv[0],'rb')
-	c = "corrupted waf (%d)"
+	c = 'corrupt archive (%d)'
 	while 1:
 		line = f.readline()
-		if not line: err("run waf-light from a folder containing wafadmin")
+		if not line: err('run waf-light from a folder containing waflib')
 		if line == b('#==>\n'):
 			txt = f.readline()
 			if not txt: err(c % 1)
-			if f.readline()!=b('#<==\n'): err(c % 2)
+			if f.readline() != b('#<==\n'): err(c % 2)
 			break
 	if not txt: err(c % 3)
 	txt = txt[1:-1].replace(b(C1), b('\n')).replace(b(C2), b('\r'))
@@ -75,39 +70,59 @@
 	import shutil, tarfile
 	try: shutil.rmtree(dir)
 	except OSError: pass
-	try: os.makedirs(join(dir, 'wafadmin', 'Tools'))
-	except OSError: err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
+	try:
+		for x in ['Tools', 'extras']:
+			os.makedirs(join(dir, 'waflib', x))
+	except OSError:
+		err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
 
 	os.chdir(dir)
-	tmp = 't.tbz2'
+	tmp = 't.bz2'
 	t = open(tmp,'wb')
 	t.write(txt)
 	t.close()
 
 	try:
 		t = tarfile.open(tmp)
-		for x in t: t.extract(x)
-		t.close()
 	except:
-		os.chdir(cwd)
-		try: shutil.rmtree(dir)
-		except OSError: pass
-		err("Waf cannot be unpacked, check that bzip2 support is present")
+		try:
+			os.system('bunzip2 t.bz2')
+			t = tarfile.open('t')
+			tmp = 't'
+		except:
+			os.chdir(cwd)
+			try: shutil.rmtree(dir)
+			except OSError: pass
+			err("Waf cannot be unpacked, check that bzip2 support is present")
 
-	os.chmod(join('wafadmin','Tools'), 493)
+	for x in t: t.extract(x)
+	t.close()
 
-	os.unlink(tmp)
+	for x in ['Tools', 'extras']:
+		os.chmod(join('waflib',x), 493)
 
-	if sys.hexversion>0x300000f:
-		sys.path = [join(dir, 'wafadmin')] + sys.path
-		import py3kfixes
-		py3kfixes.fixdir(dir)
+	if sys.hexversion<0x300000f:
+		sys.path = [join(dir, 'waflib')] + sys.path
+		import fixpy2
+		fixpy2.fixdir(dir)
 
+	os.unlink(tmp)
 	os.chdir(cwd)
 
+	try: dir = unicode(dir, 'mbcs')
+	except: pass
+	try:
+		from ctypes import windll
+		windll.kernel32.SetFileAttributesW(dir, 2)
+	except:
+		pass
+
 def test(dir):
-	try: os.stat(join(dir, 'wafadmin')); return os.path.abspath(dir)
-	except OSError: pass
+	try:
+		os.stat(join(dir, 'waflib'))
+		return os.path.abspath(dir)
+	except OSError:
+		pass
 
 def find_lib():
 	name = sys.argv[0]
@@ -121,17 +136,15 @@
 	if name.endswith('waf-light'):
 		w = test(base)
 		if w: return w
-		err("waf-light requires wafadmin -> export WAFDIR=/folder")
+		err('waf-light requires waflib -> export WAFDIR=/folder')
 
-	dir = "/lib/%s-%s-%s/" % (WAF, VERSION, REVISION)
+	dirname = '%s-%s-%s' % (WAF, VERSION, REVISION)
 	for i in [INSTALL,'/usr','/usr/local','/opt']:
-		w = test(i+dir)
+		w = test(i + '/lib/' + dirname)
 		if w: return w
 
 	#waf-local
-	s = '.%s-%s-%s'
-	if sys.platform == 'win32': s = s[1:]
-	dir = join(base, s % (WAF, VERSION, REVISION))
+	dir = join(base, (sys.platform != 'win32' and '.' or '') + dirname)
 	w = test(dir)
 	if w: return w
 
@@ -140,14 +153,13 @@
 	return dir
 
 wafdir = find_lib()
-w = join(wafdir, 'wafadmin')
-t = join(w, 'Tools')
-sys.path = [w, t] + sys.path
+sys.path.insert(0, wafdir)
 
-import Scripting
-Scripting.prepare(t, cwd, VERSION, wafdir)
-sys.exit(0)
+if __name__ == '__main__':
+	import waflib.extras.compat15
+	from waflib import Scripting
+	Scripting.waf_entry_point(cwd, VERSION, wafdir)
 
 #==>

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list