Browse Source

* If the local-configuration directory is used and does not exist, attempt to create it
* Removed a hard-coded reference to the fpcdir

git-svn-id: trunk@12465 -

joost 16 năm trước cách đây
mục cha
commit
c031a1fcde
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      compiler/utils/samplecfg

+ 7 - 1
compiler/utils/samplecfg

@@ -47,7 +47,7 @@ else
 fi
 FPCBIN=`dirname "$1"`/../../bin/fpc
 FPBIN=`dirname "$1"`/../../bin/fp
-sysfpdirbase=/usr/lib/fpc/`$FPCBIN -iW`
+sysfpdirbase=`dirname "$1"`/`$FPCBIN -iW`
 sysfpdirbase2=$sysfpdirbase/ide
 sysfpdir=$sysfpdirbase2/text
 fpctargetos=`$FPCBIN -iTO`
@@ -85,6 +85,12 @@ if [ -f "$FPBIN" -a -w "$sysfpdirbase" ] ; then
 fi
 #
 
+# When the local FP IDE configuration is used, check if the directory exists
+if [ $fpcfgfile == "$HOME"/.fp/fp.cfg -a ! -d "$HOME"/.fp ] ; then
+  echo Directory $HOME/.fp did not exist, attempting to create it now
+  mkdir "$HOME"/.fp >/dev/null 2>&1     
+fi
+
 if [ -f $fpccfgfile ] ; then
   mv "$fpccfgfile" "$fpccfgfile.orig"  >/dev/null 2>&1
   if [ $? = 0 ]; then