]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2005-12-25 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Sun, 25 Dec 2005 17:04:32 +0000 (17:04 +0000)
committerokuji <okuji@localhost>
Sun, 25 Dec 2005 17:04:32 +0000 (17:04 +0000)
        * geninit.sh: Made more robust, and more portable.

ChangeLog
geninit.sh

index 736714473f56762e2bbf3c5d99ffed97a52c2f7e..719fc732b72ae6c96b1d4993800dff3a03e542ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-25  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * geninit.sh: Made more robust, and more portable.
+
 2005-12-25  Marco Gerards  <marco@gnu.org>
 
        Add support for Apple HFS+ filesystems.
index 8fc21489537e257436c0ebc41575f611937b6639..965b695e107ef701d12da32fa1e2ec04e3d20120 100644 (file)
@@ -12,7 +12,7 @@
 # PARTICULAR PURPOSE.
 
 cat <<EOF
-/* This file is automatically generated by gensymlist.sh. DO NOT EDIT! */
+/* This file is automatically generated by geninit.sh. DO NOT EDIT! */
 /*
  *  GRUB  --  GRand Unified Bootloader
  *  Copyright (C) 2002, 2005  Free Software Foundation, Inc.
@@ -41,12 +41,13 @@ void
 grub_init_all (void)
 {
 EOF
-(
-  cat grub_modules_init.lst
-  for i in $*; do
-    echo $i':'
-  done
-) | sort -r | uniq -d -W1 -t':' | sed -n '/GRUB_MOD_INIT *([a-zA-Z0-9_]*)/{s/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/  grub_\1_init ();/;p;}'
+
+while read line; do
+  file=`echo $line | cut -f1 -d:`
+  if echo $@ | grep $file >/dev/null; then
+    echo $line | sed -e 's/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/  grub_\1_init ();/'
+  fi
+done < grub_modules_init.lst
 
 cat <<EOF
 }
@@ -58,12 +59,12 @@ grub_fini_all (void)
 {
 EOF
 
-(
-  cat grub_modules_init.lst
-  for i in $*; do
-    echo $i':'
-  done
-) | sort -r | uniq -d -W1 -t':' | sed -n '/GRUB_MOD_INIT *([a-zA-Z0-9_]*)/{s/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/  grub_\1_fini ();/;p;}'
+while read line; do
+  file=`echo $line | cut -f1 -d:`
+  if echo $@ | grep $file >/dev/null; then
+    echo $line | sed -e 's/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/  grub_\1_fini ();/'
+  fi
+done < grub_modules_init.lst
 
 cat <<EOF
 }