Skip to contentSkip to conversation

fix autogen.sh on "dirty" tree

PATCH In review Andrey Borzenkov 2 participants 3 messages Apr 9, 2013 – Apr 16, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix autogen.sh on "dirty" tree

bor@opensuse:~/obs/home:arvidjaar:grub2-next/grub2/grub-2.00> LC_MESSAGES=C ./autogen.sh Importing unicode...
Importing libgcrypt...
WARNING: grub-core/lib/libgcrypt-grub already exists
WARNING: grub-core/lib/libgcrypt-grub/cipher already exists
WARNING: grub-core/lib/libgcrypt-grub/mpi already exists
WARNING: grub-core/lib/libgcrypt-grub/src already exists
ln: failed to create symbolic link 'grub-core/lib/libgcrypt-grub/mpi/mpih-add1.c': File exists

These files are symbolic links, so was not caught by "test -f". Use "test -h".

---
 ChangeLog  | 5 +++++
 autogen.sh | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
ChangeLog +5 -0
index 083d86a..ecd6752 100644
@@ -1,3 +1,8 @@
+2013-04-09  Andrey Borzenkov <[email protected]>
+
+	* autogen.sh: Use "-h", not "-f", to test for existence of symbolic
+	links under grub-core/lib/libgcrypt-grub/mpi.
+
 2013-04-08  Andrey Borzenkov <[email protected]>
 
 	* grub-core/Makefile.core.def: Add kern/elfXX.c to elf module
autogen.sh +1 -1
index 7a4b5c8..d47650b 100755
@@ -24,7 +24,7 @@ ln -s ../../../grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10
 cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic
 
 for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c; do
-    if [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
+    if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
 	rm grub-core/lib/libgcrypt-grub/mpi/"$x"
     fi
     ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
Signature · 1 line
tg: (d051a42..) u/libcrypt-autogen (depends on: master)
#1 lore raw

В Tue, 9 Apr 2013 20:20:26 +0400
Andrey Borzenkov <[email protected]> пишет:

autogen.sh ln -s ../../../grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10 · line 30

Quoted 6 lines

for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c; do

autogen.sh +1 -1
-    if [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
+    if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
 	rm grub-core/lib/libgcrypt-grub/mpi/"$x"
     fi
     ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"

Hmm ... they become plain files in tardist ...

What is better - check for both -f and -h or simply use cp instead of ln? cp looks simpler and directory is regenerated from scratch anyway.

#2 lore raw
Quoted 11 lines · Andrey Borzenkov

В Tue, 9 Apr 2013 20:20:26 +0400
Andrey Borzenkov <[email protected]> пишет:

autogen.sh ln -s ../../../grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10 · line 30

Quoted 6 lines

for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c; do

autogen.sh +1 -1
-    if [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
+    if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
 	rm grub-core/lib/libgcrypt-grub/mpi/"$x"
     fi
     ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
Quoted 5 lines

Hmm ... they become plain files in tardist ...

What is better - check for both -f and -h or simply use cp instead of ln? cp looks simpler and directory is regenerated from scratch anyway.

The idea behind ln is that if compilation fails on a file then when if you modified the file reported in error your changes will be to definite file, not to a temporary copy.

Quoted 4 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel