[CalendarServer-changes] [14263] CalendarServer/trunk/bin/dependencies

source_changes at macosforge.org source_changes at macosforge.org
Wed Jan 7 18:09:16 PST 2015


Revision: 14263
          http://trac.calendarserver.org//changeset/14263
Author:   wsanchez at apple.com
Date:     2015-01-07 18:09:15 -0800 (Wed, 07 Jan 2015)
Log Message:
-----------
Add -l option

Modified Paths:
--------------
    CalendarServer/trunk/bin/dependencies

Modified: CalendarServer/trunk/bin/dependencies
===================================================================
--- CalendarServer/trunk/bin/dependencies	2015-01-08 00:25:24 UTC (rev 14262)
+++ CalendarServer/trunk/bin/dependencies	2015-01-08 02:09:15 UTC (rev 14263)
@@ -2,7 +2,7 @@
 # -*- sh-basic-offset: 2 -*-
 
 ##
-# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
+# Copyright (c) 2015 Apple Inc. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -27,6 +27,66 @@
 do_setup="false";
 develop > /dev/null;
 
+##
+# Argument handling
+##
+
+output="nested";
+
+extras () {
+  PYTHONPATH="${wd}:${PYTHONPATH:-}" "${bootstrap_python}" - 2>/dev/null << EOF
+from __future__ import print_function
+import setup
+print(" ".join(setup.extras_requirements.keys()))
+EOF
+}
+
+usage ()
+{
+    program="$(basename "$0")";
+
+    if [ "${1--}" != "-" ]; then echo "$@"; echo; fi;
+
+    echo "Usage: ${program} [-h] [extra ...]";
+    echo "Supported extras: $(extras)";
+    echo "Options:";
+    echo "    -h Print this help and exit";
+
+    if [ "${1-}" == "-" ]; then return 0; fi;
+    exit 64;
+}
+
+while getopts 'hl' option; do
+    case "${option}" in
+        '?') usage; ;;
+        'h') usage -; exit 0; ;;
+        'l') output="list"; ;;
+    esac;
+done;
+
+shift $((${OPTIND} - 1));
+
+
+##
+# Do The Right Thing
+##
+
+cmd="${py_bindir}/eggdeps";
+
 extras="$(echo $@ | sed 's| |,|g')";
+spec="calendarserver[${extras}]";
 
-exec "${py_bindir}/eggdeps" "calendarserver[${extras}]";
+case "${output}" in
+
+  'nested')
+    "${cmd}" "${spec}";
+    ;;
+
+  'list')
+    PYTHONPATH="${wd}:${PYTHONPATH:-}" "${bootstrap_python}" - 2>/dev/null << EOF
+from __future__ import print_function
+import setup
+print("\n".join($("${cmd}" --requirements "${spec}")))
+EOF
+
+esac;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150107/22a4725b/attachment.html>


More information about the calendarserver-changes mailing list