package/pkg-generic: keep file lists on reinstall
PATCH 1/1 package/pkg-generic: keep file lists on reinstall
Buildroot lists the files that each package installs, in .files-list*.txt in its build directory. These lists are used:
- by check-bin-arch, to check the architecture of the target files;
- in packages-file-list*.txt, for graph-size.
The .stamp_installed step makes the lists. It compares the target, staging, images and host directories with a snapshot taken by the configure step, then removes the snapshot.
'make <pkg>-reinstall' and 'make <pkg>-rebuild' run .stamp_installed again, but not the configure step, so the snapshot is missing. comm then fails, the pipe hides its error, and the lists are emptied. After that, check-bin-arch checks nothing for the package, and graph-size does not know its files.
Only make the lists when the snapshot exists. A reinstalled package installs the same files, so it keeps its lists.
--- package/pkg-generic.mk | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
package/pkg-generic.mk +14 -10
@@ -128,17 +128,21 @@ endef # $(1): base directory to search in # $(2): suffix of file (optional) +# Only after a configure step, that lists the files before +# (.files-list*.before): a package reinstalled keeps its list. define pkg_size_after - cd $(1); \ - LC_ALL=C find . -not -path './$(STAGING_SUBDIR)/*' \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \ - | LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(2).after - LC_ALL=C comm -13 \ - $($(PKG)_DIR)/.files-list$(2).before \ - $($(PKG)_DIR)/.files-list$(2).after \ - | sed -r -e 's/^[^,]+/$($(PKG)_NAME)/' \ - > $($(PKG)_DIR)/.files-list$(2).txt - rm -f $($(PKG)_DIR)/.files-list$(2).before - rm -f $($(PKG)_DIR)/.files-list$(2).after + if [ -e $($(PKG)_DIR)/.files-list$(2).before ]; then \ + cd $(1); \ + LC_ALL=C find . -not -path './$(STAGING_SUBDIR)/*' \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \ + | LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(2).after; \ + LC_ALL=C comm -13 \ + $($(PKG)_DIR)/.files-list$(2).before \ + $($(PKG)_DIR)/.files-list$(2).after \ + | sed -r -e 's/^[^,]+/$($(PKG)_NAME)/' \ + > $($(PKG)_DIR)/.files-list$(2).txt; \ + rm -f $($(PKG)_DIR)/.files-list$(2).before \ + $($(PKG)_DIR)/.files-list$(2).after; \ + fi endef define check_bin_arch
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot