diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-09-30 18:29:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-30 18:29:56 -0500 |
commit | 7fbd35efab8d7c999846d4953515d02e6e9f0872 (patch) | |
tree | 483831ad6a6866a10600131849f1e7333a2ae467 /python/servo/package_commands.py | |
parent | 31415588a384427392324ba03b6c65206ff09620 (diff) | |
parent | d672750ca4f702857466728a38831fe57a955d52 (diff) | |
download | servo-7fbd35efab8d7c999846d4953515d02e6e9f0872.tar.gz servo-7fbd35efab8d7c999846d4953515d02e6e9f0872.zip |
Auto merge of #12850 - Coder206:newFolderLinux, r=aneeshusa
New folder linux
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #11983 (github issue number if applicable).
- [x] There are tests for these changes (./mach package)
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12850)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo/package_commands.py')
-rw-r--r-- | python/servo/package_commands.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 41a0f35467b..fb4d669c966 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -287,24 +287,22 @@ class PackageCommands(CommandBase): msi_path = path.join(dir_to_msi, "Servo.msi") print("Packaged Servo into {}".format(msi_path)) else: - dir_to_package = '/'.join(binary_path.split('/')[:-1]) - dir_to_root = '/'.join(binary_path.split('/')[:-3]) - resources_dir = dir_to_package + '/resources' - if os.path.exists(resources_dir): - delete(resources_dir) - shutil.copytree(dir_to_root + '/resources', resources_dir) + dir_to_temp = path.join(os.path.dirname(binary_path), 'packaging-temp') browserhtml_path = find_dep_path_newest('browserhtml', binary_path) if browserhtml_path is None: print("Could not find browserhtml package; perhaps you haven't built Servo.") return 1 - print("Deleting unused files") - keep = ['servo', 'resources', 'build'] - for f in os.listdir(dir_to_package + '/'): - if f not in keep: - delete(dir_to_package + '/' + f) - for f in os.listdir(dir_to_package + '/build/'): - if 'browserhtml' not in f: - delete(dir_to_package + '/build/' + f) + if path.exists(dir_to_temp): + # TODO(aneeshusa): lock dir_to_temp to prevent simultaneous builds + print("Cleaning up from previous packaging") + delete(dir_to_temp) + + print("Copying files") + dir_to_resources = path.join(dir_to_temp, 'resources') + shutil.copytree(path.join(self.get_top_dir(), 'resources'), dir_to_resources) + shutil.copytree(browserhtml_path, path.join(dir_to_temp, 'build')) + shutil.copy(binary_path, dir_to_temp) + print("Writing runservo.sh") # TODO: deduplicate this arg list from post_build_commands servo_args = ['-b', @@ -313,17 +311,19 @@ class PackageCommands(CommandBase): '--pref', 'shell.builtin-key-shortcuts.enabled=false', path.join('./build/' + browserhtml_path.split('/')[-1], 'out', 'index.html')] - runservo = os.open(dir_to_package + '/runservo.sh', os.O_WRONLY | os.O_CREAT, int("0755", 8)) + runservo = os.open(dir_to_temp + '/runservo.sh', os.O_WRONLY | os.O_CREAT, int("0755", 8)) os.write(runservo, "#!/usr/bin/env sh\n./servo " + ' '.join(servo_args)) os.close(runservo) + print("Creating tarball") - tar_path = '/'.join(dir_to_package.split('/')[:-1]) + '/' time = datetime.utcnow().replace(microsecond=0).isoformat() time = time.replace(':', "-") - tar_path += time + "-servo-tech-demo.tar.gz" + tar_path = path.join(self.get_target_dir(), time + '-servo-tech-demo.tar.gz') - archive_deterministically(dir_to_package, tar_path, prepend_path='servo/') + archive_deterministically(dir_to_temp, tar_path, prepend_path='servo/') + print("Cleaning up") + delete(dir_to_temp) print("Packaged Servo into " + tar_path) @Command('install', |