summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-08-14 12:06:45 -0400
committerAndreas Grapentin <andreas@grapentin.org>2022-01-18 17:31:51 +0100
commit8a71cd066b756ef1f7a10f0a41b6783ec6fe73b3 (patch)
treeb1aa77168e62a6bc316e1b118f9ca02acf404042
parentd39024c278c60ede21e2d789d39662bab6192bb9 (diff)
allow local login to differ from hackers.git login
-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