From 6f73e123d03ee2dac919f47d6f66c12727e98156 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 9 Nov 2020 16:36:18 +1100 Subject: [PATCH] Remove entry-point for element-info This is really an internal dib tool. Move it to the lib directory, and call it with the python we are running under. This is one less reason to require the virtualenv to be activated when you run 'disk-image-create'. Change-Id: Id689683a0b1fdcb446b04ba967284a216133d743 --- diskimage_builder/lib/common-functions | 2 +- diskimage_builder/lib/element-info.py | 7 +++++++ setup.cfg | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 diskimage_builder/lib/element-info.py diff --git a/diskimage_builder/lib/common-functions b/diskimage_builder/lib/common-functions index e38fc279..daeb360a 100644 --- a/diskimage_builder/lib/common-functions +++ b/diskimage_builder/lib/common-functions @@ -340,7 +340,7 @@ function arg_to_elements() { # element=$i # path=${image_elements[$i] # done - elinfo_out="$(element-info --env $IMAGE_ELEMENT)" + elinfo_out="$(${DIB_PYTHON_EXEC} ${_LIB}/element-info.py --env ${IMAGE_ELEMENT})" if [ $? -ne 0 ]; then echo "ERROR: element-info failed to expand elements." exit 1 diff --git a/diskimage_builder/lib/element-info.py b/diskimage_builder/lib/element-info.py new file mode 100644 index 00000000..b8ec672b --- /dev/null +++ b/diskimage_builder/lib/element-info.py @@ -0,0 +1,7 @@ +import sys + +from diskimage_builder.element_dependencies import main + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/setup.cfg b/setup.cfg index b1a444a8..ae86fa1e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,6 @@ data_files = [entry_points] console_scripts = - element-info = diskimage_builder.element_dependencies:main dib-block-device = diskimage_builder.block_device.cmd:main disk-image-create = diskimage_builder.disk_image_create:main ramdisk-image-create = diskimage_builder.disk_image_create:main