diff --git a/SConscript.dist b/SConscript.dist index 631e9595..0e1b0ede 100644 --- a/SConscript.dist +++ b/SConscript.dist @@ -6,6 +6,7 @@ import tarfile import zipfile import sys from glob import glob +from StringIO import StringIO sdk_dir = path.join(build.dir, 'sdk') excludes = ['.pdb', '.exp', '.ilk', '.db', '.gitignore','.psd', '.xib' @@ -80,6 +81,9 @@ def build_packaging_tools(target, source, env): print "Packing packaging tools (%s) " % tgz_file_path tgz_file = tarfile.open(tgz_file_path, 'w:gz') add_files_to_archive(tgz_file, effess.add_to_tgz) + tgz_file.addfile(tarfile.TarInfo( + '/'.join(['sdk', build.os, build.version, '.packager'])), + StringIO('#')) tgz_file.close() # Builder for all module and runtime component zip files diff --git a/sdk/env.py b/sdk/env.py index 55adead5..bdb41dc8 100644 --- a/sdk/env.py +++ b/sdk/env.py @@ -11,6 +11,7 @@ class PackagingEnvironment(object): def __init__(self, target_os, packaging_server=False): + self.components_dir = None self.version = __init__.get_titanium_version() self.excludes = ['.pdb', '.exp', '.ilk', '.lib', '.svn', '.git', '.gitignore', '.cvsignore'] @@ -27,19 +28,19 @@ def init_packaging_server_dirs(self, script_dir): self.install_dirs = [p.join(script_dir, '..', '..', '..')] def init_normal_dirs(self, script_dir): - if (self.target_os is 'linux'): + if (self.target_os == 'linux'): self.install_dirs = [ p.expanduser('~/.titanium'), "/opt/titanium", "/usr/local/lib/titanium", "/usr/lib/titanium" ] - elif (self.target_os is 'osx'): + elif (self.target_os == 'osx'): self.install_dirs = [ p.expanduser('~/Library/Application Support/Titanium'), '/Library/Application Support/Titanium' ] - elif (self.target_os is 'win32'): + elif (self.target_os == 'win32'): self.install_dirs = [ p.join(os.environ['APPDATA'], 'Titanium'), # TODO: Is there a better way to determine this directory? @@ -61,11 +62,11 @@ def init_normal_dirs(self, script_dir): self.components_dir = p.join(script_dir, '..') def create_app(self, path): - if self.target_os is 'linux': + if self.target_os == 'linux': return linux_app.LinuxApp(self, path) - if self.target_os is 'osx': + if self.target_os == 'osx': return osx_app.OSXApp(self, path) - if self.target_os is 'win32': + if self.target_os == 'win32': return win32_app.Win32App(self, path) def log(self, text): diff --git a/sdk/linux_app.py b/sdk/linux_app.py index 7e48f6f2..697aef54 100644 --- a/sdk/linux_app.py +++ b/sdk/linux_app.py @@ -16,7 +16,11 @@ def package(self, package_dir, bundle=False): longname = self.name + "-" + self.version def tar_callback(f, tar_file): print f - tar_file.add(f, longname + "/" + f.replace(self.stage_dir + os.sep, "")) + # tar paths in <= 2.5 must be non unicode + f = f.encode('ascii', 'ignore') + tarname = longname + "/" + f.replace(self.stage_dir + os.sep, "") + tarname = tarname.encode('ascii', 'ignore') + tar_file.add(f, tarname) effess.make_tgz(self.stage_dir, p.join(package_dir, longname + '.tgz'), callback=tar_callback)