Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv2 2/4] pkg-generic: add step_pkg_size global instrumentation hook
Date: Tue, 2 Dec 2014 13:23:49 +0100	[thread overview]
Message-ID: <20141202132349.5a02a3a4@free-electrons.com> (raw)
In-Reply-To: <1929636.NnvGLL6rO5@aquila>

Dear J?r?me Pouiller,

On Tue, 02 Dec 2014 12:00:51 +0100, J?r?me Pouiller wrote:

> > +# This hook will be called before the target installation of a
> > +# package. We store in a file named $(1).filelist_before the list of
> > +# 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 | xargs md5sum) | sort > \
> > +		$(BUILD_DIR)/$(1).filelist_before
> > +endef
> I think this does not work if filename contains spaces.

Hum, yes, very possible. But is Buildroot really working fine as a
whole if some file in the target filesystem has some spaces?

> > +# This hook will be called after the target installation of a
> > +# package. We store in a file named $(1).filelist_after the list
> > +# of files (and their MD5) currently installed in the target. We then
> > +# do a diff with the $(1).filelist_before to compute the list of
> > +# files installed by this package.
> > +define step_pkg_size_end
> > +	(cd $(TARGET_DIR); find . -type f | xargs md5sum) | sort > \
> > +		$(BUILD_DIR)/$(1).filelist_after
> > +	comm -13 $(BUILD_DIR)/$(1).filelist_before $(BUILD_DIR)/$(1).filelist_after | \
> > +		while read hash file ; do \
> > +			echo "$(1),$${file}" >> $(BUILD_DIR)/packages-file-list.txt ; \
> > +		done
> Does it would make sense if we also record removed lines? We may wrote 
> another script that detect if a file was in conflict between two packages.

I'm not sure to follow you here. We already take care of packages
installing the same file, that's the whole point of storing the MD5 of
each file. By using comm -13, we keep only the lines that are unique in
the second file (compared to the first file). So we keep lines for
either new files added by this package, or files already installed but
overwritten by the package (detected using the MD5).

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-12-02 12:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 21:41 [Buildroot] [PATCHv2 0/4] Generate package size statistics Thomas Petazzoni
2014-12-01 21:41 ` [Buildroot] [PATCHv2 1/4] toolchain-external: split target installation from staging installation Thomas Petazzoni
2014-12-02 11:00   ` Jérôme Pouiller
2015-01-10 17:02   ` Thomas Petazzoni
2014-12-01 21:41 ` [Buildroot] [PATCHv2 2/4] pkg-generic: add step_pkg_size global instrumentation hook Thomas Petazzoni
2014-12-02 11:00   ` Jérôme Pouiller
2014-12-02 12:23     ` Thomas Petazzoni [this message]
2014-12-02 13:22       ` Jérôme Pouiller
2014-12-02 13:40         ` Jérôme Pouiller
2014-12-01 21:41 ` [Buildroot] [PATCHv2 3/4] support/scripts: add size-stats script Thomas Petazzoni
2014-12-02 11:01   ` Jérôme Pouiller
2014-12-02 12:28     ` Thomas Petazzoni
2014-12-02 13:24       ` Jérôme Pouiller
2014-12-01 21:41 ` [Buildroot] [PATCHv2 4/4] Makefile: implement a size-stats target Thomas Petazzoni
2015-01-12 22:47   ` Romain Naour
2015-01-13  8:12     ` Thomas Petazzoni
2015-01-13 23:06       ` Romain Naour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141202132349.5a02a3a4@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox