From 22c370a6a19626b1c377690c1a6bb6dcfb98de36 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sat, 8 Oct 2016 02:02:07 +0000 Subject: [PATCH] buildx.sh: use "mkdir -p" to create $PREFIX_DIR, don't retry Improve messages about $PREFIX_DIR --- xorg/X11R7.6/buildx.sh | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/xorg/X11R7.6/buildx.sh b/xorg/X11R7.6/buildx.sh index 22dfe15f..3b8e0acd 100755 --- a/xorg/X11R7.6/buildx.sh +++ b/xorg/X11R7.6/buildx.sh @@ -218,37 +218,28 @@ else export PREFIX_DIR=$1 fi -if ! test -d $PREFIX_DIR; then - echo "dir does not exist, creating [$PREFIX_DIR]" - if ! mkdir $PREFIX_DIR - then - echo "mkdir failed [$PREFIX_DIR]" - exit 0 - fi -fi - -echo "using $PREFIX_DIR" - -export PKG_CONFIG_PATH=$PREFIX_DIR/lib/pkgconfig:$PREFIX_DIR/share/pkgconfig -export PATH=$PREFIX_DIR/bin:$PATH -export LDFLAGS=-Wl,-rpath=$PREFIX_DIR/lib -export CFLAGS="-I$PREFIX_DIR/include -fPIC -O2" - # prefix dir must exist... if [ ! -d $PREFIX_DIR ]; then - if ! mkdir -p $PREFIX_DIR - then - echo "$PREFIX_DIR does not exist; failed to create it - cannot continue" + echo "$PREFIX_DIR does not exist, creating it" + if ! mkdir -p $PREFIX_DIR; then + echo "$PREFIX_DIR cannot be created - cannot continue" exit 1 fi fi # ...and be writable if [ ! -w $PREFIX_DIR ]; then - echo "directory $PREFIX_DIR is not writable - cannot continue" + echo "$PREFIX_DIR is not writable - cannot continue" exit 1 fi +echo "installation directory: $PREFIX_DIR" + +export PKG_CONFIG_PATH=$PREFIX_DIR/lib/pkgconfig:$PREFIX_DIR/share/pkgconfig +export PATH=$PREFIX_DIR/bin:$PATH +export LDFLAGS=-Wl,-rpath=$PREFIX_DIR/lib +export CFLAGS="-I$PREFIX_DIR/include -fPIC -O2" + # create a downloads dir if [ ! -d downloads ]; then if ! mkdir downloads