Skip to contentSkip to conversation

pkg-generic: include symbolic links to files in packages-file-list.txt

PATCH New Thomas De Schampheleire 2 participants 3 messages Feb 3, 2017 – Feb 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pkg-generic: include symbolic links to files in packages-file-list.txt

From: Thomas De Schampheleire <[email protected]>

Using the package instrumentation hooks, a file packages-file-list.txt is created containing the list of files installed by a package with their size.

Due to the use of 'find -type f', symbolic links to files are not included in this file list. Since the original purpose of this file was to calculate the total size of a package and symbolic links have file size 0, this was not a problem.

However, if packages-file-list.txt is reused for other purposes, for example to get a complete list of files installed by a package regardless of size, symbolic links are important.
Using 'find -xtype f' instead solves the problem.

---
 package/pkg-generic.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/pkg-generic.mk +2 -2
index 3ca71b0..511e5c1 100644
@@ -62,7 +62,7 @@ GLOBAL_INSTRUMENTATION_HOOKS += step_time
 # files currently installed in the target. Note that the MD5 is also
 # stored, in order to identify if the files are overwritten.
 define step_pkg_size_start
-	(cd $(TARGET_DIR) ; find . -type f -print0 | xargs -0 md5sum) | sort > \
+	(cd $(TARGET_DIR) ; find . -xtype f -print0 | xargs -0 md5sum) | sort > \
 		$($(PKG)_DIR)/.br_filelist_before
 endef
 
@@ -72,7 +72,7 @@ endef
 # a diff with the .br_filelist_before to compute the list of files
 # installed by this package.
 define step_pkg_size_end
-	(cd $(TARGET_DIR); find . -type f -print0 | xargs -0 md5sum) | sort > \
+	(cd $(TARGET_DIR); find . -xtype f -print0 | xargs -0 md5sum) | sort > \
 		$($(PKG)_DIR)/.br_filelist_after
 	comm -13 $($(PKG)_DIR)/.br_filelist_before $($(PKG)_DIR)/.br_filelist_after | \
 		while read hash file ; do \
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/1 pkg-generic: include symbolic links to files in packages-file-list.txt

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas De Schampheleire <[email protected]> writes:

From: Thomas De Schampheleire <[email protected]> Using the package instrumentation hooks, a file packages-file-list.txt is created containing the list of files installed by a package with their size.

Due to the use of 'find -type f', symbolic links to files are not included in this file list. Since the original purpose of this file was to calculate the total size of a package and symbolic links have file size 0, this was not a problem.

Quoted 4 lines

However, if packages-file-list.txt is reused for other purposes, for example to get a complete list of files installed by a package regardless of size, symbolic links are important.
Using 'find -xtype f' instead solves the problem.

So what about directories and symlinks to directories?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 pkg-generic: include symbolic links to files in packages-file-list.txt

Quoted 11 lines · Peter Korsgaard
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas De Schampheleire <[email protected]> writes:

From: Thomas De Schampheleire <[email protected]> Using the package instrumentation hooks, a file packages-file-list.txt is created containing the list of files installed by a package with their size.

Due to the use of 'find -type f', symbolic links to files are not included in this file list. Since the original purpose of this file was to calculate the total size of a package and symbolic links have file size 0, this was not a problem.

Quoted 6 lines
Quoted 4 lines

However, if packages-file-list.txt is reused for other purposes, for example to get a complete list of files installed by a package regardless of size, symbolic links are important.
Using 'find -xtype f' instead solves the problem.

So what about directories and symlinks to directories?

Ok, I guess there's no problem in including them too. I'll try it, thanks.