Merge "Corrected element-info usage"

This commit is contained in:
Jenkins 2015-02-03 15:50:06 +00:00 committed by Gerrit Code Review
commit df7ae94df2
2 changed files with 9 additions and 7 deletions

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from __future__ import print_function
import argparse import argparse
import collections import collections
import os import os
@ -115,16 +116,17 @@ def expand_dependencies(user_elements, elements_dir=None):
def main(argv): def main(argv):
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('elements', nargs='+', parser.add_argument('elements', nargs='+',
help='elements to inspect') help='display dependencies of the given elements')
parser.add_argument('--expand-dependencies', '-d', action='store_true', parser.add_argument('--expand-dependencies', '-d', action='store_true',
default=False, default=False,
help='Print expanded dependencies of all args') help=('(DEPRECATED) print expanded dependencies '
'of all args'))
args = parser.parse_args(argv[1:]) args = parser.parse_args(argv[1:])
if args.expand_dependencies: if args.expand_dependencies:
print(' '.join(expand_dependencies(args.elements))) print("WARNING: expand-dependencies flag is deprecated, "
return 0 "and is now on by default.", file=sys.stderr)
sys.stderr.write("ERROR: please choose an option.\n") print(' '.join(expand_dependencies(args.elements)))
return -1 return 0

View File

@ -221,7 +221,7 @@ function arg_to_elements() {
fi fi
echo "Building elements: $IMAGE_ELEMENT" echo "Building elements: $IMAGE_ELEMENT"
IMAGE_ELEMENT=$($SCRIPT_HOME/element-info --expand-dependencies $IMAGE_ELEMENT) IMAGE_ELEMENT=$($SCRIPT_HOME/element-info $IMAGE_ELEMENT)
export IMAGE_ELEMENT export IMAGE_ELEMENT
echo "Expanded element dependencies to: $IMAGE_ELEMENT" echo "Expanded element dependencies to: $IMAGE_ELEMENT"