summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2015-04-08 12:39:08 -0500
committerAndy Doan <andy.doan@linaro.org>2015-04-08 12:40:45 -0500
commita22bfb931095605cc202fdaf432cd01a3af43eac (patch)
treec32b57d39f953f0472b723737e93630e2a17c939
parent14475d3ed8aeadc3d17f13ce3ef08ebd3093def3 (diff)
downloadpublishing-api-a22bfb931095605cc202fdaf432cd01a3af43eac.tar.gz
supply a --make-link option
This allows you do something like: $ ./linaro-cp.py -a 2 foo andy-dest/foo/arch1 $ ./linaro-cp.py -a 2 foo andy-dest/foo/arch2 $ ./linaro-cp.py -a 2 --make-link andy-dest/foo Change-Id: I7ff9daffb51995cc0b2a4d798deabac51553e954
-rwxr-xr-xlinaro-cp.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/linaro-cp.py b/linaro-cp.py
index 7bb04ce..ed5fc10 100755
--- a/linaro-cp.py
+++ b/linaro-cp.py
@@ -166,7 +166,10 @@ def main():
help='Verbose operation')
parser.add_argument('--dry-run', action='store_true',
help="Don't actually publish files")
- parser.add_argument('src', help='source directory with files to publish')
+ g = parser.add_mutually_exclusive_group(required=True)
+ g.add_argument('--make-link', action='store_true', required=False,
+ help='Don\'t publish files, just create "latest"')
+ g.add_argument('src', nargs='?', help='source directory with files to publish')
parser.add_argument('dst', help='destination to publish to')
arguments = parser.parse_args()
@@ -198,9 +201,11 @@ def main():
# as required for android-build publishing.
arguments.dst = re.sub(r"^(.+?)/([^/]+?)_([^/]+?)/([0-9]+)/?$", r"\1/~\2/\3/\4/", arguments.dst)
- transfer_failures = api.upload(arguments.src, arguments.dst, arguments)
+ transfer_failures = []
+ if not arguments.make_link:
+ transfer_failures = api.upload(arguments.src, arguments.dst, arguments)
- if arguments.link_latest:
+ if arguments.link_latest or arguments.make_link:
err = api.link_latest(arguments.dst)
if err:
transfer_failures.append('unable to create symlink: ' + err)