diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2020-08-14 12:06:45 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2020-11-20 22:53:31 -0500 |
commit | 1b77376ca488957cacdc8a0eccf9bd833339fd66 (patch) | |
tree | 8725ae8e10f38864837754b97964d06a8ed7bf57 | |
parent | 343946c08902aecad2b52cdda5761e6246825e99 (diff) |
allow local login to differ from hackers.git login
-rw-r--r-- | src/lib/conf.sh.in | 29 | ||||
-rw-r--r-- | src/libretools.conf | 2 |
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 |