1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

selftest: add save.env.sh helper script.

This can be used to store the environment from within
make testenv.

It can be restored with:

. bin/restore.env.source

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher 2016-01-22 21:24:31 +01:00 committed by Andrew Bartlett
parent 1ce7721b17
commit 3076b1ed44

15
selftest/save.env.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
{
vars=`set | \
grep "^[a-zA-Z][^=]*='[^']*'$" | \
grep -v '^IFS=' | \
grep -v '^TERM' | \
grep -v '^PPID' | \
grep -v '^PS[1-9]=' | \
cat `
echo "${vars}"
echo "${vars}" | sed -e 's!^\([a-zA-Z][^=]*\)=.*$!export \1!'
} > bin/restore.env.source
echo "RUN: '. bin/restore.env.source'"