Commit cee4954f authored by PoroCYon's avatar PoroCYon
Browse files

more fixes

parent 3e5c9f22
......@@ -21,7 +21,7 @@ sspt_install() {
install -D -t "$instdir/bin/" "local/bin/sspt"
install -D -t "$instdir/libexec/" \
local/libexec/sspt/sspt-{autogen,bin-cb,build,clean,clean-config,configure,edit,install,list,orphanize,pkgcmd,pull,purge,src-db,strace,uninstall,update}
local/libexec/sspt/sspt-{autogen,bin-db,build,clean,clean-config,configure,edit,install,list,orphanize,pkgcmd,pull,purge,src-db,strace,uninstall,update}
}
sspt_clean() {
true
......
......@@ -24,6 +24,7 @@ exit_cleanup() {
unset SSPT_THISSCRIPT
unset SSPT_RUNDIR
unset SSPT_CONFIG_FILE
exit $@
}
......@@ -86,15 +87,17 @@ CONFIG_PATH="$XDG_CONFIG_HOME"
if [ -z "$CONFIG_PATH" ]; then
CONFIG_PATH="$HOME/.config"
fi
CONFIG_FILE="$CONFIG_PATH/sspt.conf"
if [ -z "$SSPT_CONFIG_FILE" ]; then
export SSPT_CONFIG_FILE="$CONFIG_PATH/sspt.conf"
fi
load_config() {
if ! [ -f "$CONFIG_FILE" ]; then
(>&2 echo "Config file '$CONFIG_FILE' does not exist!")
if ! [ -f "$SSPT_CONFIG_FILE" ]; then
(>&2 echo "Config file '$SSPT_CONFIG_FILE' does not exist!")
exit_cleanup 1
fi
source "$CONFIG_FILE"
source "$SSPT_CONFIG_FILE"
}
export -f load_config
......@@ -108,6 +111,8 @@ exec_subcommand () {
exit_cleanup 1
fi
if ! [ -d "$SSPT_DB_DIR" ]; then mkdir "$SSPT_DB_DIR"; fi
export SSPT_SRC_DB_FILE="$SSPT_DB_DIR/sources"
export SSPT_BIN_DB_FILE="$SSPT_DB_DIR/installs"
......@@ -138,7 +143,7 @@ parse_arg() {
exit_cleanup 1
fi
CONFIG_FILE="$2"
SSPT_CONFIG_FILE="$2"
return 2
;;
-h|--help|-?)
......@@ -158,7 +163,7 @@ parse_arg() {
if ! [ -d "$CONFIG_PATH" ]; then
mkdir -p "$CONFIG_PATH"
fi
cat > "$CONFIG_FILE" <<EOF
cat > "$SSPT_CONFIG_FILE" <<EOF
# SSPT_DEST_DIR controls e.g. the PREFIX variable in makefile builds.
# NOTE: This variable is used when configuring packages. If you change
# this, it will not have any effect unless you reconfigure all packages.
......
......@@ -23,7 +23,7 @@ main() {
esac
}
if [ $? -eq 0 ]; then
if [ $# -eq 0 ]; then
print_help
exit
fi
......
......@@ -25,7 +25,8 @@ pull_with_vcs() {
exec_subcommand src-db exists "$PKG_NAME"
if [ $? -eq 0 ]; then
(>&2 echo "Package '$PKG_NAME' is already pulled.")
(>&2 echo "Package '$PKG_NAME' is already pulled, updating remote repository...")
exec_subcommand pkgcmd pull "$PKG_NAME"
return
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment