[gtk-osx: 46/48] Fix in case of existing $HOME/.config/jhbuildrc and $HOME/.jhbuildrc-custom, see included Numbers ta



commit 52ea68243778c67bcb7a39b281ebabd5a3616a9f
Author: Blady <blady net orange fr>
Date:   Sat May 11 10:07:34 2019 +0200

    Fix in case of existing $HOME/.config/jhbuildrc and $HOME/.jhbuildrc-custom, see included Numbers table.

 gtk-osx-setup.sh | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/gtk-osx-setup.sh b/gtk-osx-setup.sh
index 9f382cc..4077a2e 100755
--- a/gtk-osx-setup.sh
+++ b/gtk-osx-setup.sh
@@ -216,18 +216,18 @@ $PIPENV install
 BASEURL="https://raw.githubusercontent.com/jralls/gtk-osx-build/pipenv";
 
 config_dir=""
+if test -n "$XDG_CONFIG_HOME"; then
+   config_dir="$XDG_CONFIG_HOME"
+else
+   config_dir="$HOME/.config"
+fi
+if test ! -d "$config_dir"; then
+    mkdir -p "$config_dir"
+fi
+
 if test -e "$HOME/.jhbuildrc"; then
     JHBUILDRC="$HOME/.jhbuildrc"
-    JHBUILDRC_CUSTOM="$HOME/.jhbuildrc-custom"
 else
-    if test -n "$XDG_CONFIG_HOME"; then
-       config_dir="$XDG_CONFIG_HOME"
-    else
-       config_dir="$HOME/.config"
-    fi
-    if test ! -d "$config_dir"; then
-        mkdir -p "$config_dir"
-    fi
     JHBUILDRC="$config_dir/jhbuildrc"
 fi
 echo "Installing jhbuild configuration at $JHBUILDRC"
@@ -236,8 +236,7 @@ curl -ks $BASEURL/jhbuildrc-gtk-osx -o "$JHBUILDRC"
 if test -z "$JHBUILDRC_CUSTOM"; then
     JHBUILDRC_CUSTOM="$config_dir/jhbuildrc-custom"
 fi
-
-if test ! -e "$JHBUILDRC_CUSTOM"; then
+if test ! -e "$JHBUILDRC_CUSTOM" -a ! -e "$HOME/.jhbuildrc-custom"; then
     JHBUILDRC_CUSTOM_DIR=`dirname $JHBUILDRC_CUSTOM`
     echo "Installing jhbuild custom configuration at $JHBUILDRC_CUSTOM"
     if test ! -d "$JHBUILDRC_CUSTOM_DIR"; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]