Skip to content

Commit

Permalink
Merge pull request #365 from binpash/release-fixes
Browse files Browse the repository at this point in the history
Fix cloning libdash on non git repo
  • Loading branch information
dkarnikis authored Oct 18, 2021
2 parents e13d767 + 522df26 commit 8e5c47b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
1 change: 0 additions & 1 deletion compiler/pash.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def execute_script(compiled_script_filename, command, arguments, shell_name):
shell_name,
" ".join(subprocess_args)))
exec_obj = subprocess.run(subprocess_args, env=new_env, close_fds=False)

return exec_obj.returncode

if __name__ == "__main__":
Expand Down
40 changes: 21 additions & 19 deletions scripts/setup-pash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ if git rev-parse --git-dir > /dev/null 2>&1; then
# set PASH_TOP
PASH_TOP=${PASH_TOP:-$(git rev-parse --show-toplevel)}
else
# we are in package mode, no .git information is available
git clone https://github.com/angelhof/libdash/ compiler/parser/libdash/ --depth 1
# set PASH_TOP to the root folder of the project if it is not available
PASH_TOP=${PASH_TOP:-$PWD/..}
# remove previous installation if it exists
rm -rf $PASH_TOP/compiler/parser/libdash
# we are in package mode, no .git information is available
git clone https://github.com/angelhof/libdash/ $PASH_TOP/compiler/parser/libdash
fi
cd $PASH_TOP

Expand All @@ -27,31 +29,31 @@ echo "Building parser..."
cd compiler/parser

if type lsb_release >/dev/null 2>&1 ; then
distro=$(lsb_release -i -s)
distro=$(lsb_release -i -s)
elif [ -e /etc/os-release ] ; then
distro=$(awk -F= '$1 == "ID" {print $2}' /etc/os-release)
distro=$(awk -F= '$1 == "ID" {print $2}' /etc/os-release)
fi

echo "|-- making libdash..."
# convert to lowercase
distro=$(printf '%s\n' "$distro" | LC_ALL=C tr '[:upper:]' '[:lower:]')
# now do different things depending on distro
case "$distro" in
freebsd*)
gsed -i 's/ make/ gmake/g' Makefile
gmake libdash &> $LOG_DIR/make_libdash.log
echo "Building runtime..."
# Build runtime tools: eager, split
cd ../../runtime/
gmake &> $LOG_DIR/make.log
;;
*)
make libdash &> $LOG_DIR/make_libdash.log
echo "Building runtime..."
# Build runtime tools: eager, split
cd ../../runtime/
make &> $LOG_DIR/make.log
;;
freebsd*)
gsed -i 's/ make/ gmake/g' Makefile
gmake libdash &> $LOG_DIR/make_libdash.log
echo "Building runtime..."
# Build runtime tools: eager, split
cd ../../runtime/
gmake &> $LOG_DIR/make.log
;;
*)
make libdash &> $LOG_DIR/make_libdash.log
echo "Building runtime..."
# Build runtime tools: eager, split
cd ../../runtime/
make &> $LOG_DIR/make.log
;;
esac

# save distro in the init file
Expand Down

0 comments on commit 8e5c47b

Please sign in to comment.