* check for existence of configuration directory prior to doing
authorAndres Loeh <kosmikus@gentoo.org>
Wed, 24 Nov 2004 15:05:49 +0000 (15:05 +0000)
committerAndres Loeh <kosmikus@gentoo.org>
Wed, 24 Nov 2004 15:05:49 +0000 (15:05 +0000)
  anything in ghc-reregister function

eclass/ghc-package.eclass

index e0754f8d2a60a8a5d413bcf4209e091204202b57..087b34de0d8931be9a9707bfb5d8cad9c231245c 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.4 2004/11/04 14:16:14 kosmikus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.5 2004/11/24 15:05:49 kosmikus Exp $
 #
 # Author: Andres Loeh <kosmikus@gentoo.org>
 #
@@ -101,12 +101,14 @@ ghc-register-pkg() {
 ghc-reregister() {
        einfo "Re-adding packages ..."
        ewarn "This may cause several warnings, but they should be harmless."
-       pushd $(ghc-confdir)
-       for conf in *.conf; do
-               einfo "Processing ${conf} ..."
-               ghc-register-pkg ${conf}
-       done
-       popd
+       if [ -d "$(ghc-confdir)" ]; then
+               pushd $(ghc-confdir)
+               for conf in *.conf; do
+                       einfo "Processing ${conf} ..."
+                       ghc-register-pkg ${conf}
+               done
+               popd
+       fi
 }
 
 # unregisters ...