From 8e888c3d9bc02204dc697aad0a62a463ea48e085 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Mon, 18 Mar 2019 12:57:33 +0000 Subject: [PATCH 1/5] Update Makefile.in --- Makefile.in | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 53a6c402..e1cacaad 100755 --- a/Makefile.in +++ b/Makefile.in @@ -58,10 +58,9 @@ endif quick: QUICK=1 $(MAKE) build -#.PHONY: submodules -#submodules: -# git submodule init -# git submodule update --recursive +.PHONY: submodules +submodules: + git submodule update --init --recursive .PHONY: btest btest: bash-test @@ -75,12 +74,8 @@ bash-test: push: git push -.PHONY: common -common: system-packages submodules - : - .PHONY: system-packages -system-packages: +system-packages: submodules if [ -x /sbin/apk ]; then $(MAKE) apk-packages; fi if [ -x /usr/bin/apt-get ]; then $(MAKE) apt-packages; fi if [ -x /usr/bin/yum ]; then $(MAKE) yum-packages; fi From 1621e2d251f21c7bb6b4ddb0b1c83e615fb38cd3 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Mon, 18 Mar 2019 12:59:42 +0000 Subject: [PATCH 2/5] Update Makefile.in --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index e1cacaad..c2ecc437 100755 --- a/Makefile.in +++ b/Makefile.in @@ -283,7 +283,7 @@ update2: update-no-recompile .PHONY: update-no-recompile update-no-recompile: git pull - git submodule update --init --recursive + $(MAKE) submodules .PHONY: update-submodules update-submodules: From 856bf4607d499ef38e6c665a05399a1b33a2d876 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Mon, 18 Mar 2019 16:31:13 +0000 Subject: [PATCH 3/5] Update .travis.yml --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2efef302..20f17dad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,7 @@ # http://www.linkedin.com/in/harisekhon # -# there's no 'language: bash' -language: generic +language: bash sudo: false From 96c0541775ed25148082d876b6e7e86c32458d43 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Mon, 18 Mar 2019 16:59:41 +0000 Subject: [PATCH 4/5] set pip and cpan module system package installs to only happen when not in perlbrew or virtualenv --- Makefile.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index c2ecc437..49a37c58 100755 --- a/Makefile.in +++ b/Makefile.in @@ -118,7 +118,7 @@ apk-packages-perl: done #for x in apk-packages-{optional,cpan,pip}.txt; do \ for x in apk-packages-cpan.txt; do \ - if [ -f "setup/$$x" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(SUDO_PERL)" ]; then \ NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apk-install-packages.sh "setup/$$x"; \ fi; \ done @@ -131,7 +131,7 @@ apk-packages-python: fi; \ done for x in apk-packages-pip.txt; do \ - if [ -f "setup/$$x" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(SUDO_PIP)" ]; then \ NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apk-install-packages.sh "setup/$$x"; \ fi; \ done @@ -159,7 +159,7 @@ apt-packages-perl: fi; \ done for x in deb-packages-cpan.txt; do \ - if [ -f "setup/$$x" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(SUDO_PERL)" ]; then \ NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apt-install-packages.sh "setup/$$x"; \ fi; \ done @@ -172,7 +172,7 @@ apt-packages-python: fi; \ done for x in deb-packages-pip.txt; do \ - if [ -f "setup/$$x" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(SUDO_PIP)" ]; then \ NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apt-install-packages.sh "setup/$$x"; \ fi; \ done @@ -202,7 +202,7 @@ yum-packages-perl: fi; \ done for x in rpm-packages-cpan.txt; do \ - if [ -f "setup/$$x" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(SUDO_PERL)" ]; then \ NO_FAIL=1 $(BASH_TOOLS)/yum-install-packages.sh "setup/$$x"; \ fi; \ done @@ -216,7 +216,7 @@ yum-packages-python: fi; \ done for x in rpm-packages-pip.txt; do \ - if [ -f "setup/$$x" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(SUDO_PIP)" ]; then \ NO_FAIL=1 $(BASH_TOOLS)/yum-install-packages.sh "setup/$$x"; \ fi; \ done From d6d427e3d31719f7155c1127ad437a66deaa4dab Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Mon, 18 Mar 2019 18:08:29 +0000 Subject: [PATCH 5/5] set system packages to not install when not in virtual env or perlbrew, do not use sudo it could be reset to blank if root and outside virtual env or perlbrew --- Makefile.in | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 49a37c58..0ed2279b 100755 --- a/Makefile.in +++ b/Makefile.in @@ -26,6 +26,8 @@ SUDO := sudo SUDO_PIP := sudo -H SUDO_PERL := sudo +PYTHON_VIRTUALENV := + ifdef PERLBREW_PERL # can't put this here otherwise gets error - "commands commence before first target. Stop." #@echo "Perlbrew environment detected, not calling sudo" @@ -39,9 +41,11 @@ endif ifdef VIRTUAL_ENV #@echo "Virtual Env / Conda detected, not calling sudo" SUDO_PIP := + PYTHON_VIRTUALENV := 1 endif ifdef CONDA_DEFAULT_ENV SUDO_PIP := + PYTHON_VIRTUALENV := 1 endif # must come after to reset SUDO_PERL/SUDO_PIP to blank if root @@ -118,7 +122,7 @@ apk-packages-perl: done #for x in apk-packages-{optional,cpan,pip}.txt; do \ for x in apk-packages-cpan.txt; do \ - if [ -f "setup/$$x" ] && [ -n "$(SUDO_PERL)" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(PERLBREW_PERL)" ]; then \ NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apk-install-packages.sh "setup/$$x"; \ fi; \ done @@ -131,7 +135,7 @@ apk-packages-python: fi; \ done for x in apk-packages-pip.txt; do \ - if [ -f "setup/$$x" ] && [ -n "$(SUDO_PIP)" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(PYTHON_VIRTUALENV)" ]; then \ NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apk-install-packages.sh "setup/$$x"; \ fi; \ done @@ -159,7 +163,7 @@ apt-packages-perl: fi; \ done for x in deb-packages-cpan.txt; do \ - if [ -f "setup/$$x" ] && [ -n "$(SUDO_PERL)" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(PERLBREW_PERL)" ]; then \ NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apt-install-packages.sh "setup/$$x"; \ fi; \ done @@ -172,7 +176,7 @@ apt-packages-python: fi; \ done for x in deb-packages-pip.txt; do \ - if [ -f "setup/$$x" ] && [ -n "$(SUDO_PIP)" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(PYTHON_VIRTUALENV)" ]; then \ NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apt-install-packages.sh "setup/$$x"; \ fi; \ done @@ -202,7 +206,7 @@ yum-packages-perl: fi; \ done for x in rpm-packages-cpan.txt; do \ - if [ -f "setup/$$x" ] && [ -n "$(SUDO_PERL)" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(PERLBREW_PERL)" ]; then \ NO_FAIL=1 $(BASH_TOOLS)/yum-install-packages.sh "setup/$$x"; \ fi; \ done @@ -216,7 +220,7 @@ yum-packages-python: fi; \ done for x in rpm-packages-pip.txt; do \ - if [ -f "setup/$$x" ] && [ -n "$(SUDO_PIP)" ]; then \ + if [ -f "setup/$$x" ] && [ -n "$(PYTHON_VIRTUALENV)" ]; then \ NO_FAIL=1 $(BASH_TOOLS)/yum-install-packages.sh "setup/$$x"; \ fi; \ done