Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: upload_to_google_storage.py

Issue 42273002: Add a platform filtering and executable setting abilities to download_from_google_storage. (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « download_from_google_storage.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: upload_to_google_storage.py
===================================================================
--- upload_to_google_storage.py (revision 231381)
+++ upload_to_google_storage.py (working copy)
@@ -10,6 +10,7 @@
import os
import Queue
import re
+import stat
import sys
import threading
import time
@@ -103,7 +104,19 @@
(filename, file_url, err)))
continue
+ # Mark executable files with the header "x-goog-meta-executable: 1" which
+ # the download script will check for to preserve the executable bit.
+ if not sys.platform.startswith('win'):
+ if os.stat(filename).st_mode & stat.S_IEXEC:
+ code, _, err = gsutil.check_call('setmeta', '-h',
+ 'x-goog-meta-executable:1', file_url)
+ if code:
+ ret_codes.put(
+ (code,
+ 'Encountered error on setting metadata on %s\n%s' %
+ (file_url, err)))
+
def get_targets(args, parser, use_null_terminator):
if not args:
parser.error('Missing target.')
« no previous file with comments | « download_from_google_storage.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698