mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernel/.gitignore: ignore temporary kheaders_data directory
@ 2023-01-17  5:15 Thomas Weißschuh
  2023-01-17  8:34 ` Nicolas Schier
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Weißschuh @ 2023-01-17  5:15 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kernel, linux-kbuild, Thomas Weißschuh

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/

---
base-commit: d532dd102151cc69fcd00b13e5a9689b23c0c8d9
change-id: 20230117-kernel-kheaders-gitignore-f0d73456cb6b

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/.gitignore: ignore temporary kheaders_data directory
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Schier @ 2023-01-17  8:34 UTC (permalink / raw)
  To: Thomas Weißschuh; +Cc: Masahiro Yamada, linux-kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

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.

Kind regards,
Nicolas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/.gitignore: ignore temporary kheaders_data directory
  2023-01-17  8:34 ` Nicolas Schier
@ 2023-01-17 13:52   ` Thomas Weißschuh
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Weißschuh @ 2023-01-17 13:52 UTC (permalink / raw)
  To: Nicolas Schier; +Cc: Masahiro Yamada, linux-kernel, linux-kbuild

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-17 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®