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]
(cherry picked from commit 19ac879954)
lede-17.01
Paul Spooren 2017-06-13 21:59:14 +02:00 committed by Jo-Philipp Wich
parent 9c3e4b5434
commit c7234e3036
1 changed files with 14 additions and 7 deletions

View File

@ -112,13 +112,7 @@ _call_image: staging_dir/host/.prereq-build
echo echo
rm -rf $(TARGET_DIR) rm -rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_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 \ $(MAKE) package_reload
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_install $(MAKE) package_install
ifneq ($(USER_FILES),) ifneq ($(USER_FILES),)
$(MAKE) copy_files $(MAKE) copy_files
@ -136,6 +130,19 @@ package_index: FORCE
) >/dev/null 2>/dev/null ) >/dev/null 2>/dev/null
$(OPKG) update || true $(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 package_install: FORCE
@echo @echo
@echo Installing packages... @echo Installing packages...