-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcleanup.win
More file actions
executable file
·29 lines (24 loc) · 1.03 KB
/
Copy pathcleanup.win
File metadata and controls
executable file
·29 lines (24 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env sh
rm -fr src/*.o src/*.so autom4te.cache config.log config.status inst
RLIBKRIGING_PATH="src/libK/bindings/R/rlibkriging"
# sync Version number & date (only if submodules are initialized)
if [ -f "$RLIBKRIGING_PATH/DESCRIPTION" ]; then
LK_VERSION=`sed -n 's/^Version: *//p' $RLIBKRIGING_PATH/DESCRIPTION`
R_VERSION=`sed -n 's/^Version: *//p' DESCRIPTION`
# update Version only if libKriging's is newer: keeps rlibkriging-only bumps (1.2-3, 1.2-2.1)
if [ "$LK_VERSION" != "$R_VERSION" ] && \
[ "`printf '%s\n%s\n' "$R_VERSION" "$LK_VERSION" | sort -V | tail -n 1`" = "$LK_VERSION" ]; then
sed -i.bak "s/^Version:.*/Version: $LK_VERSION/" DESCRIPTION
fi
DATE=`date '+%Y-%m-%d'`
sed -i.bak "s/Date:.*/Date: $DATE/g" DESCRIPTION
rm -f DESCRIPTION.bak
fi
rm -rf src/libK/build
# It is required that setup.sh is run before R CMD build rlibkriging when submit to CRAN.
if [ ! -d R ]; then
echo "R directory does not exist, running setup.sh"
tools/setup.sh
else
echo "R directory exists, skipping setup.sh"
fi