summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorPaul Spooren <paul@spooren.de>2017-06-13 21:59:14 +0200
committerDaniel Golle <daniel@makrotopia.org>2017-06-15 00:36:08 +0200
commit19ac879954210df3c6a010990bef42ad5c7fd967 (patch)
tree3b58b1160aa2c15ce5c748126e23f7b2ede2d8d0 /target
parent8180bbac7c237a31bd6e06c63e342c72342b7303 (diff)
downloadmtk-20170518-19ac879954210df3c6a010990bef42ad5c7fd967.zip
mtk-20170518-19ac879954210df3c6a010990bef42ad5c7fd967.tar.gz
mtk-20170518-19ac879954210df3c6a010990bef42ad5c7fd967.tar.bz2
imagebuilder: add package_list function
The imagebuilder can now list all available packages by using make package_list. This is usefull for scripts to retrieve a list of all packages with versions (and size) Signed-off-by: Paul Spooren <paul@spooren.de> [daniel@makrotopia.org: fixed commit message]
Diffstat (limited to 'target')
-rw-r--r--target/imagebuilder/files/Makefile21
1 files changed, 14 insertions, 7 deletions
diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile
index f0e2bd1..f8702b5 100644
--- a/target/imagebuilder/files/Makefile
+++ b/target/imagebuilder/files/Makefile
@@ -111,13 +111,7 @@ _call_image: staging_dir/host/.prereq-build
echo
rm -rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
- if [ ! -f "$(PACKAGE_DIR)/Packages" ] || [ ! -f "$(PACKAGE_DIR)/Packages.gz" ] || [ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/Packages.gz`" ]; then \
- echo "Package list missing or not up-to-date, generating it.";\
- $(MAKE) package_index; \
- else \
- mkdir -p $(TARGET_DIR)/tmp; \
- $(OPKG) update || true; \
- fi
+ $(MAKE) package_reload
$(MAKE) package_install
ifneq ($(USER_FILES),)
$(MAKE) copy_files
@@ -135,6 +129,19 @@ package_index: FORCE
) >/dev/null 2>/dev/null
$(OPKG) update || true
+package_reload:
+ if [ ! -f "$(PACKAGE_DIR)/Packages" ] || [ ! -f "$(PACKAGE_DIR)/Packages.gz" ] || [ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/Packages.gz`" ]; then \
+ echo "Package list missing or not up-to-date, generating it.";\
+ $(MAKE) package_index; \
+ else \
+ mkdir -p $(TARGET_DIR)/tmp; \
+ $(OPKG) update || true; \
+ fi
+
+package_list: FORCE
+ @$(MAKE) -s package_reload
+ @$(OPKG) list --size 2>/dev/null | awk -F" - " '{printf "%s %s %s\n", $$1, $$2, $$3}'
+
package_install: FORCE
@echo
@echo Installing packages...