summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/conf.sh.in29
-rw-r--r--src/libretools.conf2
2 files changed, 26 insertions, 5 deletions
diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in
index 603a28c..46366d0 100644
--- a/src/lib/conf.sh.in
+++ b/src/lib/conf.sh.in
@@ -18,14 +18,35 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+## configuration begin ##
+
+# NOTE: $LIBREUSER is $SUDO_USER unless UID->0, or $USER otherwise
+
+# hackers.git login
+# default: $LIBREUSER
+REPOUSER=
+
+# parent directory of default $WORKDIR (per /etc/libretools.conf)
+# default: ~$LIBREUSER/ unless SUDO_USER != $USER,
+# $HOME/$LIBREUSER/ otherwise
+# NOTE: $WORKDIR and $LIBREHOME/.cache must be writable by $LIBREUSER
+LIBREHOME=
+
+## configuration end ##
+
+
if [[ "$(id -u "${SUDO_USER:-root}")" == 0 ]]; then
unset SUDO_USER
fi
LIBREUSER="${SUDO_USER:-$USER}"
-if [[ $LIBREUSER == "$USER" ]]; then
- LIBREHOME=$HOME
-else
- eval "LIBREHOME=~$LIBREUSER"
+REPOUSER="${REPOUSER:-LIBREUSER}"
+if [[ -z "$LIBREHOME" ]]; then
+ if [[ $LIBREUSER == "$USER" ]]; then
+ LIBREHOME=$HOME
+ else
+ eval "LIBREHOME=~$LIBREUSER"
+ fi
fi
if [[ -z ${XDG_CONFIG_HOME:-} ]]; then
export XDG_CONFIG_HOME="${LIBREHOME}/.config"
diff --git a/src/libretools.conf b/src/libretools.conf
index cacd0c9..7b3cd29 100644
--- a/src/libretools.conf
+++ b/src/libretools.conf
@@ -26,7 +26,7 @@ ABSLIBRESEND=ssh://git@git.parabola.nu:1863/~git/abslibre/abslibre.git
################################################################################
## Where to upload packages to
-REPODEST=ssh://$LIBREUSER@repo.parabola.nu:1863/~/staging/
+REPODEST=ssh://$REPOUSER@repo.parabola.nu:1863/~/staging/
## Which config file to use with db-update (on the $REPODEST server)
DBSCRIPTS_CONFIG=/etc/dbscripts/config.local.parabola