diff mbox

[1/3,v2] core/pkg-generic: rmove intermediate file-list files

Message ID dedc397770e0af15eac2c7cbac771dbd9260c716.1491427248.git.yann.morin.1998@free.fr
State Changes Requested
Headers show

Commit Message

Yann E. MORIN April 5, 2017, 9:20 p.m. UTC
To compute the list of files added by a package, we first store the list
of files before the install, do the install, list the files after the
install, and finally compare the two lists. The two lists are stored in
dot-files, hidden in the package's build dir.

We currently keep those two files, and only list the files installed in
target/

In followup patches, we'll also list files installed in staging/ as well
as files installed in host/.

Rather than add even more internal, hidden files in the package build
dir, we'll just re-use the same two temporary files to store the bfore
and after lists.

So, remove them after the comparison is done.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/pkg-generic.mk | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Petazzoni April 6, 2017, 6:01 a.m. UTC | #1
Hello,

On Wed,  5 Apr 2017 23:20:57 +0200, Yann E. MORIN wrote:
> To compute the list of files added by a package, we first store the list
> of files before the install, do the install, list the files after the
> install, and finally compare the two lists. The two lists are stored in
> dot-files, hidden in the package's build dir.

Typo in commit title: rmove -> remove

Thanks,

Thomas
Arnout Vandecappelle April 10, 2017, 2:21 p.m. UTC | #2
s/rmove/remove/

On 05-04-17 23:20, Yann E. MORIN wrote:
> To compute the list of files added by a package, we first store the list
> of files before the install, do the install, list the files after the
> install, and finally compare the two lists. The two lists are stored in
> dot-files, hidden in the package's build dir.
> 
> We currently keep those two files, and only list the files installed in
> target/
> 
> In followup patches, we'll also list files installed in staging/ as well
> as files installed in host/.
> 
> Rather than add even more internal, hidden files in the package build
> dir, we'll just re-use the same two temporary files to store the bfore
                                                                    ^e
> and after lists.

 Actually, I like to have as much as possible build info lingering around, so
I'd tend not to do this removal and instead rename to something with 'target' in
it. For example, I think we have no other way at the moment to detect when two
packages write the same file. IMO having internal hidden files in the package
build dir doesn't hurt anyone. I certainly do like the applied patches list!

 That said, I don't see any other reason to keep those files, and we probably
want explicit support for detecting collisions, so I'm OK with removing them
after all.

 Regards,
 Arnout

> 
> So, remove them after the comparison is done.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/pkg-generic.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 31dbc54..6b3c69c 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -78,6 +78,7 @@ define step_pkg_size_end
>  		while read hash file ; do \
>  			echo "$(1),$${file}" >> $(BUILD_DIR)/packages-file-list.txt ; \
>  		done
> +	rm -f $($(PKG)_DIR)/.br_filelist_before $($(PKG)_DIR)/.br_filelist_after
>  endef
>  
>  define step_pkg_size
>
Arnout Vandecappelle April 10, 2017, 2:23 p.m. UTC | #3
On 10-04-17 16:21, Arnout Vandecappelle wrote:
>  s/rmove/remove/
> 
> On 05-04-17 23:20, Yann E. MORIN wrote:
>> To compute the list of files added by a package, we first store the list
>> of files before the install, do the install, list the files after the
>> install, and finally compare the two lists. The two lists are stored in
>> dot-files, hidden in the package's build dir.
>>
>> We currently keep those two files, and only list the files installed in
>> target/
>>
>> In followup patches, we'll also list files installed in staging/ as well
>> as files installed in host/.
>>
>> Rather than add even more internal, hidden files in the package build
>> dir, we'll just re-use the same two temporary files to store the bfore
>                                                                     ^e
>> and after lists.
> 
>  Actually, I like to have as much as possible build info lingering around, so
> I'd tend not to do this removal and instead rename to something with 'target' in
> it. For example, I think we have no other way at the moment to detect when two
> packages write the same file. 

 D'oh, the file will of course simply appear twice in packages-file-list if two
packages write it... Silly me.

 Regards,
 Arnout


> IMO having internal hidden files in the package
> build dir doesn't hurt anyone. I certainly do like the applied patches list!
> 
>  That said, I don't see any other reason to keep those files, and we probably
> want explicit support for detecting collisions, so I'm OK with removing them
> after all.
[snip]
diff mbox

Patch

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 31dbc54..6b3c69c 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -78,6 +78,7 @@  define step_pkg_size_end
 		while read hash file ; do \
 			echo "$(1),$${file}" >> $(BUILD_DIR)/packages-file-list.txt ; \
 		done
+	rm -f $($(PKG)_DIR)/.br_filelist_before $($(PKG)_DIR)/.br_filelist_after
 endef
 
 define step_pkg_size