diff options
author | bradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 04:56:26 +0000 |
---|---|---|
committer | bradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 04:56:26 +0000 |
commit | 947be23b065106512e86df8795ccdc7c2cdd0afa (patch) | |
tree | bb1fe5ccef93a6429d28026c44266a567410c255 /native_client_sdk | |
parent | 6275f2cbd77822efe44aae6bb1e1a96cdc4c95f3 (diff) | |
download | chromium_src-947be23b065106512e86df8795ccdc7c2cdd0afa.zip chromium_src-947be23b065106512e86df8795ccdc7c2cdd0afa.tar.gz chromium_src-947be23b065106512e86df8795ccdc7c2cdd0afa.tar.bz2 |
Fixing symlink handling logic.
Need to actually read the symlink :-(
BUG=None
TEST=None
R=noelallen@google.com
Review URL: http://codereview.chromium.org/8743004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r-- | native_client_sdk/src/build_tools/nsis_script.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/native_client_sdk/src/build_tools/nsis_script.py b/native_client_sdk/src/build_tools/nsis_script.py index f34f211..f670659 100644 --- a/native_client_sdk/src/build_tools/nsis_script.py +++ b/native_client_sdk/src/build_tools/nsis_script.py @@ -90,18 +90,22 @@ class NsisScript(path_set.PathSet): if file_filter: self._files = set(file_filter(self._files)) - def IsCygwinSymlink(path): + def ReadCygwinSymlink(path): if not os.path.isfile(path): - return False - data = open(path, 'rb').read(10) - return data == '!<symlink>' + return None + header = open(path, 'rb').read(12) + if header != '!<symlink>\xff\xfe': + return None + data = open(path, 'rb').read()[12:] + return ''.join([ch for ch in data if ch != '\x00']) # Pick out cygwin symlinks. all_files = self._files self._files = set() for f in all_files: - if IsCygwinSymlink(f): - self._symlinks.add(f) + link = ReadCygwinSymlink(f) + if link: + self._symlinks[f] = link else: self._files.add(f) |