Browse Source

travis: new build script with uid juggling

K. Lange 3 years ago
parent
commit
39307c34f7
1 changed files with 17 additions and 1 deletions
  1. 17 1
      util/build-travis.sh

+ 17 - 1
util/build-travis.sh

@@ -1,5 +1,21 @@
 #!/bin/bash
 
+# Give other users access to /root
+# (We probably should have just built the build tools somewhere else...)
+chmod o+x /root
+
+# Who owns this directory?
+NEWUID=`stat -c '%u' .`
+
+# Create a fake user with this name
+useradd -u $NEWUID local
+
+# Map the build tools
 ln -s /root/gcc_local util/local
 
-make -j4
+# Run make as local
+runuser -u local -- make -j4
+
+# Remove the build tools
+rm util/local
+