Module: check_mk
Branch: master
Commit: 60ce3998e06bbc3202bb69dbcb34f60a703490c9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=60ce3998e06bbc…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Wed Oct 18 15:13:15 2017 +0200
Call Windows make-agent script with sudo
Change-Id: I61924bb606c36309765a5fd2df39e5e9bd73c5f9
---
agents/Makefile | 2 +-
agents/windows/make-agent | 17 +++++++----------
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/agents/Makefile b/agents/Makefile
index 9c8706a..0c24442 100644
--- a/agents/Makefile
+++ b/agents/Makefile
@@ -64,7 +64,7 @@ setversion:
build:
$(MAKE) packages
- cd windows && ./make-agent
+ cd windows && sudo ./make-agent
packages: rpm deb
diff --git a/agents/windows/make-agent b/agents/windows/make-agent
index 8183fd4..7603f03 100755
--- a/agents/windows/make-agent
+++ b/agents/windows/make-agent
@@ -44,23 +44,20 @@ fi
if [ -z $create ] ; then
echo "chroot is up to date."
else
- sudo apt-get -y install "${chroot_dependencies[@]}"
- sudo VERSIONFILE=$versionfile \
- CHROOT_PATH=$CHROOT_PATH \
- CHROOT_BUILD_DIR=$CHROOT_BUILD_DIR ./make-chroot
+ apt-get -y install "${chroot_dependencies[@]}"
+ VERSIONFILE=$versionfile CHROOT_PATH=$CHROOT_PATH \
+ CHROOT_BUILD_DIR=$CHROOT_BUILD_DIR ./make-chroot
fi
# Build the Windows agent within chroot by calling the 'build-agent' script.
-sudo CHROOT_PATH=$CHROOT_PATH \
- CHROOT_BUILD_DIR=$CHROOT_BUILD_DIR \
- NEW_VERSION=$NEW_VERSION \
- ./do-chroot \
- "$CHROOT_BUILD_DIR/agents/windows/build-agent -j${njobs} $targets"
+CHROOT_PATH=$CHROOT_PATH CHROOT_BUILD_DIR=$CHROOT_BUILD_DIR \
+ NEW_VERSION=$NEW_VERSION ./do-chroot \
+ "$CHROOT_BUILD_DIR/agents/windows/build-agent -j${njobs} $targets"
EXIT_CODE=$?
# Some cleanup: chown build artifacts to the original user.
find . -maxdepth 1 -regextype egrep \
-regex
'(.*\.(exe|msi|m4|cache|in))|.*\/.*build.*|.*plugins|.*Makefile.*|.*configure|.*comp.*|.*install.*|.*missing'
\
--exec sudo chown -R $USER:$USER {} \;
+-exec chown -R $USER:$USER {} \;
exit $EXIT_CODE