Skip to content

Commit db3a85e

Browse files
committed
Restore original build scripts as needed
1 parent 5fd9910 commit db3a85e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# cspice-sharedlib
44

5-
Shell script to build the [NAIF CSPICE Toolkit](https://naif.jpl.nasa.gov/naif/toolkit.html) with
6-
its shared library (`libcspice.so[.1]`), and dynamically link executable instead of the normal
7-
static libraries and static linking of the upstream distribution.
5+
Shell script to build the [NAIF CSPICE Toolkit](https://naif.jpl.nasa.gov/naif/toolkit.html) as
6+
a shared library (`libcspice.so[.1]`) and dynamically linked executables instead of the normal
7+
static libraries and static linking used by the the upstream distribution.
88

99
Author: Attila Kovacs `<attila.kovacs[AT]cfa.harvard.edu>`
1010
Version: 0.9

cspice-sharedlib.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ cd src
4343

4444
for component in * ; do
4545
if [ -d $component ] ; then
46-
# back up the build script
47-
cp -a $component/mkprodct.csh $component/mkprodct.bak
46+
47+
if [ -f $component/mkproduct.bak ] ; then
48+
# restore original scripts if needed
49+
cp $component/mkprodct.bak $component/mkprodct.csh
50+
elif [ -f $component/mkproduct.csh ] ; then
51+
# back up the original build script
52+
cp -a $component/mkprodct.csh $component/mkprodct.bak
53+
fi
4854

4955
# Don't used default build for static libs or cookbook examples.
5056
# We don't package these
@@ -105,10 +111,11 @@ csh makeall.csh
105111
echo "Restoring original build scripts..."
106112
for component in * ; do
107113
if [ -f $component/mkproduct.bak ] ; then
108-
# back up the build script
109114
mv $component/mkprodct.bak $component/mkprodct.csh
110115
fi
111116
done
112117

118+
# ----------------------------------------------------------------------------
119+
# Done.
113120
echo "All done."
114121

0 commit comments

Comments
 (0)