a5bd9f6
From dc00947d8ca3b793b23cf0c3c3c3af24ae57e043 Mon Sep 17 00:00:00 2001
a5bd9f6
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
a5bd9f6
Date: Sat, 12 Jan 2013 16:14:09 +0100
a5bd9f6
Subject: [PATCH 096/364] 	* autogen.sh: Do not try to delete nonexistant
a5bd9f6
 files. 	* util/import_gcrypth.sed: Add some missing header removals.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog               |  5 +++++
a5bd9f6
 autogen.sh              | 12 +++++++++---
a5bd9f6
 util/import_gcrypth.sed | 11 ++++++++---
a5bd9f6
 3 files changed, 22 insertions(+), 6 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 61bf8e7..d83d10a 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,3 +1,8 @@
a5bd9f6
+2013-01-11  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
+
a5bd9f6
+	* autogen.sh: Do not try to delete nonexistant files.
a5bd9f6
+	* util/import_gcrypth.sed: Add some missing header removals.
a5bd9f6
+
a5bd9f6
 2013-01-12  Colin Watson  <cjwatson@ubuntu.com>
a5bd9f6
 
a5bd9f6
 	Clean up dangling references to grub-setup.
a5bd9f6
diff --git a/autogen.sh b/autogen.sh
a5bd9f6
index 5524083..7a4b5c8 100755
a5bd9f6
--- a/autogen.sh
a5bd9f6
+++ b/autogen.sh
a5bd9f6
@@ -14,13 +14,19 @@ python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt
a5bd9f6
 echo "Importing libgcrypt..."
a5bd9f6
 python util/import_gcry.py grub-core/lib/libgcrypt/ grub-core
a5bd9f6
 sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h
a5bd9f6
-rm include/grub/gcrypt/g10lib.h
a5bd9f6
-rm -rf grub-core/lib/libgcrypt-grub/mpi/generic
a5bd9f6
+if [ -f include/grub/gcrypt/g10lib.h ]; then
a5bd9f6
+    rm include/grub/gcrypt/g10lib.h
a5bd9f6
+fi
a5bd9f6
+if [ -d grub-core/lib/libgcrypt-grub/mpi/generic ]; then 
a5bd9f6
+    rm -rf grub-core/lib/libgcrypt-grub/mpi/generic
a5bd9f6
+fi
a5bd9f6
 ln -s ../../../grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h
a5bd9f6
 cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic
a5bd9f6
 
a5bd9f6
 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
a5bd9f6
-    rm grub-core/lib/libgcrypt-grub/mpi/"$x"
a5bd9f6
+    if [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
a5bd9f6
+	rm grub-core/lib/libgcrypt-grub/mpi/"$x"
a5bd9f6
+    fi
a5bd9f6
     ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
a5bd9f6
 done
a5bd9f6
 
a5bd9f6
diff --git a/util/import_gcrypth.sed b/util/import_gcrypth.sed
a5bd9f6
index 1cf31bd..dead8e6 100644
a5bd9f6
--- a/util/import_gcrypth.sed
a5bd9f6
+++ b/util/import_gcrypth.sed
a5bd9f6
@@ -1,7 +1,12 @@
a5bd9f6
 /^#@INSERT_SYS_SELECT_H@/ d
a5bd9f6
 /^@FALLBACK_SOCKLEN_T@/ d
a5bd9f6
-/^#include <stdlib\.h>/ d
a5bd9f6
-/^#include <string\.h>/ d
a5bd9f6
-/^#include <gpg-error\.h>/ s,#include <gpg-error.h>,#include <grub/gcrypt/gpg-error.h>,
a5bd9f6
+/^# *include <stdlib\.h>/ d
a5bd9f6
+/^# *include <string\.h>/ d
a5bd9f6
+/^# *include <winsock2\.h>/ d
a5bd9f6
+/^# *include <ws2tcpip\.h>/ d
a5bd9f6
+/^# *include <time\.h>/ d
a5bd9f6
+/^# *include <sys\/socket\.h>/ d
a5bd9f6
+/^# *include <sys\/time\.h>/ d
a5bd9f6
+/^# *include <gpg-error\.h>/ s,#include <gpg-error.h>,#include <grub/gcrypt/gpg-error.h>,
a5bd9f6
 s,_gcry_mpi_invm,gcry_mpi_invm,g
a5bd9f6
 p
a5bd9f6
\ No newline at end of file
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6