Skip to contentSkip to conversation

kheaders: use standard naming for the temporary directory

PATCH In review Thomas Weißschuh 2 participants 5 messages Jan 18, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

v3 cover kheaders: use standard naming for the temporary directory

To: Masahiro Yamada <[email protected]>
To: Nathan Chancellor <[email protected]>
To: Nick Desaulniers <[email protected]>
To: Nicolas Schier <[email protected]>

---
Changes in v3:
- Use standard naming schema for temporary directories
- Modify toplevel Makefile to also clean temporary directories
- Link to v2: https://lore.kernel.org/r/20230117-kernel-kheaders-gitignore-v2-1-1c29b3adf04a@weissschuh.net

Changes in v2:
- Also add the directory to clean-files
- Link to v1: https://lore.kernel.org/r/20230117-kernel-kheaders-gitignore-v1-1-2a3a070efd0d@weissschuh.net

---
Thomas Weißschuh (2):
kbuild: also delete temporary directories
kheaders: use standard naming for the temporary directory

 Makefile               | 5 +++--
 kernel/gen_kheaders.sh | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

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

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
#1 lore raw

PATCH v3 1/2 kbuild: also delete temporary directories

Reuse the standard naming schema for temporary files also for temporary directories.

Such a directory will be used by the kheaders generation.

---
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Makefile +3 -2
index e09fe100efb2..863b3fdd4374 100644
@@ -2026,11 +2026,12 @@ clean: $(clean-dirs)
 		-o -name '*.lex.c' -o -name '*.tab.[ch]' \
 		-o -name '*.asn1.[ch]' \
 		-o -name '*.symtypes' -o -name 'modules.order' \
-		-o -name '.tmp_*' \
 		-o -name '*.c.[012]*.*' \
 		-o -name '*.ll' \
 		-o -name '*.gcno' \
-		-o -name '*.*.symversions' \) -type f -print | xargs rm -f
+		-o -name '*.*.symversions' \) -type f -print \
+		-o -name '.tmp_*' -print \
+		| xargs rm -rf
 
 # Generate tags for editors
 # ---------------------------------------------------------------------------
Signature · 1 line
2.39.1
Reviewed-by Tested-by on v3 1/2
#2 lore raw

Re: [PATCH v3 1/2] kbuild: also delete temporary directories

Quoted 33 lines · Thomas Weißschuh

Reuse the standard naming schema for temporary files also for temporary
directories.

Such a directory will be used by the kheaders generation.

---
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Makefile +3 -2
index e09fe100efb2..863b3fdd4374 100644
@@ -2026,11 +2026,12 @@ clean: $(clean-dirs)
 		-o -name '*.lex.c' -o -name '*.tab.[ch]' \
 		-o -name '*.asn1.[ch]' \
 		-o -name '*.symtypes' -o -name 'modules.order' \
-		-o -name '.tmp_*' \
 		-o -name '*.c.[012]*.*' \
 		-o -name '*.ll' \
 		-o -name '*.gcno' \
-		-o -name '*.*.symversions' \) -type f -print | xargs rm -f
+		-o -name '*.*.symversions' \) -type f -print \
+		-o -name '.tmp_*' -print \
+		| xargs rm -rf
 
 # Generate tags for editors
 # ---------------------------------------------------------------------------
Signature · 2 lines
-- 
2.39.1

Thanks!

#3 lore raw

PATCH v3 2/2 kheaders: use standard naming for the temporary directory

In reply to Thomas Weißschuh

If the kheaders archive generation is interrupted then this directory may be left on disk and not ignored by git.
By using the standard naming schema for temporary files and directories the default .gitignore and "make clean" rules will apply.

---
 kernel/gen_kheaders.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/gen_kheaders.sh +1 -1
index 473036b43c83..b477b763f262 100755
@@ -7,7 +7,7 @@ set -e
 sfile="$(readlink -f "$0")"
 outdir="$(pwd)"
 tarfile=$1
-cpio_dir=$outdir/$tarfile.tmp
+cpio_dir=$outdir/${tarfile%/*}/.tmp_cpio_dir
 
 dir_list="
 include/
Signature · 1 line
2.39.1
Reviewed-by Tested-by on v3 2/2
#4 lore raw
Quoted 28 lines · Thomas Weißschuh

If the kheaders archive generation is interrupted then this directory may be left on disk and not ignored by git.
By using the standard naming schema for temporary files and directories the default .gitignore and "make clean" rules will apply.

---
 kernel/gen_kheaders.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/gen_kheaders.sh +1 -1
index 473036b43c83..b477b763f262 100755
@@ -7,7 +7,7 @@ set -e
 sfile="$(readlink -f "$0")"
 outdir="$(pwd)"
 tarfile=$1
-cpio_dir=$outdir/$tarfile.tmp
+cpio_dir=$outdir/${tarfile%/*}/.tmp_cpio_dir
 
 dir_list="
 include/
Signature · 2 lines
-- 
2.39.1

Thanks!