From 6469cc5f088c46d5be55b05456760de8f5f27599 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Tue, 24 Sep 2019 07:40:50 -0400 Subject: [PATCH] Improve the way we determine the distro/release --- templates/setup-functions | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/templates/setup-functions b/templates/setup-functions index f5166f1..94f441e 100755 --- a/templates/setup-functions +++ b/templates/setup-functions @@ -123,10 +123,11 @@ chown -R opensrf:opensrf /openils } InstallOpenSRFfromGit () { -OSRF_REPODIR=$(echo $OSRF_GIT_URL | awk -F/ '{print $NF}' | sed -e 's/.git%//') -DISTRONAME=ubuntu-xenial +OSRF_REPODIR=$(echo $OSRF_GIT_URL | awk -F/ '{print $NF}' | sed -e 's/.git//') +DISTRONAME="$(lsb_release -si | tr [:upper:] [:lower:])-$(lsb_release -sc | tr [:upper:] [:lower:])" useradd -m -s /bin/bash opensrf -su - opensrf -c git clone --branch $OSRF_GIT_BRANCH $OSRF_GIT_URL +su - opensrf -c "git clone $OSRF_GIT_URL" +su - opensrf -c "git checkout $OSRF_GIT_BRANCH" cd /home/opensrf/$OSRF_REPODIR make -f src/extras/Makefile.install $DISTRONAME su - opensrf -c "cd $OSRF_REPODIR && autoreconf -i && ./configure --prefix=/openils --sysconfdir=/openils/conf && make" @@ -135,12 +136,13 @@ chown -R opensrf:opensrf /openils } InstallEvergreenfromGit () { -EG_REPODIR=$(echo $EG_GIT_URL | awk -F/ '{print $NF}' | sed -e 's/.git%//') -DISTRONAME=ubuntu-xenial -su - opensrf -c git clone --branch $EG_GIT_BRANCH $EG_GIT_URL +EG_REPODIR=$(echo $EG_GIT_URL | awk -F/ '{print $NF}' | sed -e 's/.git//') +DISTRONAME="$(lsb_release -si | tr [:upper:] [:lower:])-$(lsb_release -sc | tr [:upper:] [:lower:])" +su - opensrf -c "git clone $EG_GIT_URL" +su - opensrf -c "git checkout $EG_GIT_BRANCH" cd /home/opensrf/$EG_REPODIR -make -f src/extras/Makefile.install $DISTRONAME -make -f src/extras/Makefile.install ${DISTRONAME}-developer +make -f Open-ILS/src/extras/Makefile.install $DISTRONAME +make -f Open-ILS/src/extras/Makefile.install ${DISTRONAME}-developer su - opensrf -c "cd $EG_REPODIR/Open-ILS/web/js/ui/default/staff && npm install && npm run build-prod && npm run test" su - opensrf -c "cd $EG_REPODIR/Open-ILS/src/eg2 && npm install && ng build --prod && npm run test" su - opensrf -c "cd $EG_REPODIR && autoreconf -i && ./configure --prefix=/openils --sysconfdir=/openils/conf && make" -- 2.11.0