Alternatively, you could just remove the "" when testing the file's
existence - it will then interpret *-* correctly.

Then there is no need to use find.

Also, checkfiles() should be called after the option parsing, so you
could do a -h even if stage1 is not found.

See the patch attached.

Best regards,

-- 
Clément 'nodens' Hermann <[EMAIL PROTECTED]>
- L'air pur ? c'est pas en RL, ça ? c'est pas hors charte ?
-- Jean in "l'Histoire des Pingouins" - http://tnemeth.free.fr/fmbl/linuxsf


--- grub-floppy.old	2005-03-10 14:50:53.000000000 +0100
+++ grub-floppy	2005-03-10 14:50:10.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Create GRUB boot floppy.
 #   Copyright (C) 2001 Jason Thomas <[EMAIL PROTECTED]>
@@ -33,9 +33,10 @@
 
 checkfiles()
 {
+echo $pkglibdir $stage1
         [ -x "$dd" ] || abort "Can't find $dd, aborting"
-        [ -f "$stage1" ] || abort "Can't find $stage1, aborting"
-        [ -f "$stage2" ] || abort "Can't find $stage2, aborting"
+        [ -f $stage1 ] || abort "Can't find $stage1, aborting"
+        [ -f $stage2 ] || abort "Can't find $stage2, aborting"
 }
 
 usage()
@@ -90,9 +91,6 @@
         /bin/echo -e "\nThat's All Folks!"
 }
 
-# test we have the necessary files first
-checkfiles
-
 case "$1" in
         -h | --help)
                 usage
@@ -102,6 +100,9 @@
                 if [ -z "$1" ] ; then
                         usage
                 else
+			# test we have the necessary files first
+			checkfiles
+
                         checkdevice "$1"
                         questiondevice "$1"
                         createfloppy "$1"

Reply via email to