Add etc/profile.d/* reading to bash package
authorFredrik Fornwall <fredrik@fornwall.net>
Sat, 20 Jun 2015 13:12:04 +0000 (09:12 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Sat, 20 Jun 2015 13:12:04 +0000 (09:12 -0400)
packages/bash/build.sh
packages/bash/etc-profile [new file with mode: 0644]

index 90c504d..52fbb3a 100755 (executable)
@@ -17,3 +17,7 @@ termux_step_pre_configure () {
                patch -p0 -i $PATCHFILE
        done
 }
                patch -p0 -i $PATCHFILE
        done
 }
+
+termux_step_post_make_install () {
+       sed "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" $TERMUX_PKG_BUILDER_DIR/etc-profile > $TERMUX_PREFIX/etc/profile
+}
diff --git a/packages/bash/etc-profile b/packages/bash/etc-profile
new file mode 100644 (file)
index 0000000..6328df4
--- /dev/null
@@ -0,0 +1,8 @@
+if [ -d @TERMUX_PREFIX@/etc/profile.d ]; then
+       for i in @TERMUX_PREFIX@/etc/profile.d/*.sh; do
+               if [ -r $i ]; then
+                       . $i
+               fi
+       done
+       unset i
+fi