All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Nicolas Schier <n.schier@avm.de>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] kernel/.gitignore: ignore temporary kheaders_data directory
Date: Tue, 17 Jan 2023 13:52:08 +0000	[thread overview]
Message-ID: <20230117135208.pyyziocg7kc25vfy@t-8ch.de> (raw)
In-Reply-To: <Y8ZdGIDj+0nSqjkF@buildd.core.avm.de>

On Tue, Jan 17, 2023 at 09:34:01AM +0100, Nicolas Schier wrote:
> On Tue, Jan 17, 2023 at 05:15:25AM +0000, Thomas Weißschuh wrote:
> > If the kheaders archive generation is interrupted then this directory
> > may be left. Ignore it, it will be deleted by the next run of
> > kernel/gen_kheaders.sh.
> > 
> > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > ---
> >  kernel/.gitignore | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/kernel/.gitignore b/kernel/.gitignore
> > index c6b299a6b786..57ab1d703763 100644
> > --- a/kernel/.gitignore
> > +++ b/kernel/.gitignore
> > @@ -1,3 +1,4 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >  /config_data
> >  /kheaders.md5
> > +/kheaders_data.tar.xz.tmp/
> 
> What about removing the temporary directory on failure instead?  E.g.:
> 
> diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh
> index 473036b43c83..c656b72a3cdc 100755
> --- a/kernel/gen_kheaders.sh
> +++ b/kernel/gen_kheaders.sh
> @@ -61,6 +61,8 @@ echo "  GEN     $tarfile"
>  rm -rf $cpio_dir
>  mkdir $cpio_dir
>  
> +trap "rm -rf ${cpio_dir}" EXIT
> +
>  if [ "$building_out_of_srctree" ]; then
>         (
>                 cd $srctree
> 
> 
> Otherwise, I'd suggest to extent this .gitignore patch by also adding
> 
>    clean-files += kheaders_data.tar.xz.tmp/
> 
> to kernel/Makefile.

Thanks for the suggestions.
I went with the clean-files aproach.
This allows the introspection of the directory on errors and seems to
match what is done elsewhere.

Thomas

      reply	other threads:[~2023-01-17 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17  5:15 [PATCH] kernel/.gitignore: ignore temporary kheaders_data directory Thomas Weißschuh
2023-01-17  8:34 ` Nicolas Schier
2023-01-17 13:52   ` Thomas Weißschuh [this message]

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=20230117135208.pyyziocg7kc25vfy@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=n.schier@avm.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.