forked from Expander/FlexibleSUSY
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding helper script which installs a file, w/o export markers
- Loading branch information
Expander
authored and
Expander
committed
Apr 17, 2014
1 parent
5b6b41a
commit c56a258
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
# This script installs a file [$1] to destiation [$2]. Optional | ||
# install arguments can be given in [$3]. | ||
|
||
if test $# -lt 2; then | ||
echo "Usage: ./install_stripped source destination [install args]" | ||
exit 1 | ||
fi | ||
|
||
# directory of this script | ||
BASEDIR=$(dirname $0) | ||
|
||
source="$1" | ||
shift | ||
dest="$1" | ||
shift | ||
args="$*" | ||
|
||
if test ! -e "${source}"; then | ||
echo "Error: source does not exist: ${source}" | ||
exit 1 | ||
fi | ||
|
||
stripped_source="${source}.stripped" | ||
|
||
# strip source file | ||
${BASEDIR}/remove_export_markers.sh ${source} > ${stripped_source} | ||
|
||
install ${args} ${stripped_source} ${dest} | ||
|
||
rm -f ${stripped_source} |