diff options
author | Mu Qiao <qiaomuf@gentoo.org> | 2011-06-07 19:10:41 +0800 |
---|---|---|
committer | Petteri Räty <petsku@petteriraty.eu> | 2011-06-09 14:41:23 +0300 |
commit | 28d34b34f5a431b3660c5c050f57413b2cb7e1e7 (patch) | |
tree | 1d76e23bfb73a4d0e30e03f88a467c5a434a3d15 /utils | |
parent | Utility: fix some Portage functions (diff) | |
download | libbash-28d34b34f5a431b3660c5c050f57413b2cb7e1e7.tar.gz libbash-28d34b34f5a431b3660c5c050f57413b2cb7e1e7.tar.bz2 libbash-28d34b34f5a431b3660c5c050f57413b2cb7e1e7.zip |
Test: add test for Portage functions
Diffstat (limited to 'utils')
-rw-r--r-- | utils/variable_printer.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/utils/variable_printer.cpp b/utils/variable_printer.cpp index 252ee9b..9104273 100644 --- a/utils/variable_printer.cpp +++ b/utils/variable_printer.cpp @@ -36,6 +36,15 @@ static const std::vector<std::string> special_variables "IFS", "?", "*", "0" }; +static std::string get_src_dir() +{ + std::string srcdir("."); + if(getenv("srcdir")) + srcdir = getenv("srcdir"); + + return srcdir; +} + int main(int argc, char** argv) { if(argc != 2) @@ -48,7 +57,7 @@ int main(int argc, char** argv) std::vector<std::string> functions; try { - libbash::interpret(argv[1], variables, functions); + libbash::interpret(argv[1], get_src_dir() + "/utils/isolated-functions.sh", variables, functions); } catch(interpreter_exception& e) { |