-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgetit
executable file
·216 lines (196 loc) · 6.96 KB
/
getit
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#! /bin/sh
#
# collect Healpix and healpy source and data files,
# before packing them up for a release (see ./pack)
#
NO_COLOR='\x1b[0m'
RED_COLOR='\x1b[31;01m'
GREEN_COLOR='\x1b[32;11m'
YELLOW_COLOR='\x1b[33;11m'
BLUE_COLOR='\x1b[34;11m'
MAGENTA_COLOR='\x1b[35;11m'
CYAN_COLOR='\x1b[36;11m'
echoBlu (){
echo "${BLUE_COLOR}$1${NO_COLOR}"
}
echoGrn (){
echo "${GREEN_COLOR}$1${NO_COLOR}"
}
echoRed (){
echo "${RED_COLOR}$1${NO_COLOR}"
}
#---------------
WRKDIR="/tmp"
#healpytag="1.15.2"
healpytag="1.17.3"
healpytag_git=""
#healpytag_git=${healpytag}
healpygit=0 # 1: uses GIT, 0: uses tar.gz
healpyrepo="https://github.com/healpy/healpy.git"
#healpyarchive="https://github.com/healpy/healpy/archive/" # git (maybe partial package)
#healpyarchive="https://pypi.python.org/packages/source/h/healpy/" # pypi (full package)
# simple paths pypi:
# http://pypi.python.org/simple/healpy/healpy-${healpytag}.tar.gz
# https://pypi.debian.net/healpy/healpy-${healpytag}.tar.gz
#
# healpyarchive="https://github.com/healpy/healpy/releases/download/${healpytag}/" # (partial)
healpyarchive="https://pypi.debian.net/healpy/" # (full)
# from https://files.pythonhosted.org/packages/ec/75/8e8e546ef8f173555ce097ba98487a510f6a56764ed28ea3e6d11ad684cf/healpy-1.15.1.tar.gz to /Users/hivon/healpy
# https://pypi.org/project/healpy/1.15.2/#files
#healpyarchive_alt="https://github.com/healpy/healpy/archive/refs/tags/"
#healpyarchive_alt="https://github.com/healpy/healpy/archive/" # partial package (no cfitsio/, no healpy/src/_*.cpp)
#healpyarchive="/Users/hivon/healpy/"
##
mixed=0
if [ "$mixed" = "1" ]; then
healpixbranch="trunk"
healpixbranch_cxx="branches/branch_v330r807"
healpixbranch_java=${healpixbranch}
else
#healpixbranch="branches/branch_v320r670" # r926 for 3.40
healpixbranch="trunk"
healpixbranch_cxx=${healpixbranch}
healpixbranch_java=${healpixbranch}
fi
#healpixrepo="svn://svn.code.sf.net/p/healpix/code/" # read-only
healpixrepo="svn+ssh://[email protected]/p/healpix/code/" # read-only
#healpixrepo="https://healpix.svn.sourceforge.net/svnroot/healpix/"
#
#
current=`grep -v '#' ./Version`
version=${current}
printf "Enter version number [$current] "
read answer
[ "x$answer" != "x" ] && version="$answer"
VERSION=$version
echoBlu "Version: ${VERSION} in ${WRKDIR}"
if [ ${healpygit} = 1 ] ; then
echoBlu "healpy: ${healpyrepo} ${healpytag_git}"
else
echoBlu "healpy: ${healpyarchive} ${healpytag}"
fi
echoBlu "healpix: ${healpixrepo}${healpixbranch}"
[ ${healpixbranch_cxx} != ${healpixbranch} ] && echo " C++: ${healpixrepo}${healpixbranch_cxx}"
[ ${healpixbranch_java} != ${healpixbranch} ] && echo " java: ${healpixrepo}${healpixbranch_java}"
printf "Do you want to proceed (y/n) [n]: "
read answer
doit=0
[ "x$answer" = "xy" ] && doit=1
if [ ${doit} = 1 ] ; then
cd ${WRKDIR}
\rm -rf ${WRKDIR}/Healpix_${VERSION}
\rm -rf ${WRKDIR}/healpy
cd ${WRKDIR}
echoGrn "-------------------- HEALPix ------------------"
echo "svn co ${healpixrepo}${healpixbranch} Healpix_${VERSION}"
svn co ${healpixrepo}${healpixbranch} Healpix_${VERSION} || exit
if [ ${healpixbranch_cxx} != ${healpixbranch} ] ; then
echoGrn "-------------------- C++ ------------------"
\rm -rf Healpix_${VERSION}/src/cxx
svn co ${healpixrepo}${healpixbranch_cxx}/src/cxx Hc++_${VERSION}
mv Hc++_${VERSION} Healpix_${VERSION}/src/cxx
fi
if [ ${healpixbranch_java} != ${healpixbranch} ] ; then
echoGrn "-------------------- Java ------------------"
\rm -rf Healpix_${VERSION}/src/java
svn co ${healpixrepo}${healpixbranch_java}/src/java Hjava_${VERSION}
mv Hjava_${VERSION} Healpix_${VERSION}/src/java
fi
echoGrn "---------------------- Healpy ----------------"
if [ ${healpygit} = 1 ] ; then
git clone ${healpyrepo} healpy
cd healpy
git checkout ${healpytag_git}
git branch
cd healpy
cp version.py version.py_BK
echo '__version__ = "'"${healpytag}"'"' > version.py
grep "${healpytag}" version.py
cd ..
# fills in cfitsio and healpixsubmodule
git submodule init
git submodule update
cd healpixsubmodule
\rm `find . -type f -depth 1`
\rm -r data doc test src/C src/f90 src/idl src/java src/python
cd ..
else
if [ "${healpyarchive:0:4}" = "http" ] ; then
hpyops="--no-check-certificate -O healpy-${healpytag}.tar.gz"
hpy1=${healpyarchive}healpy-${healpytag}.tar.gz # default
#hpy2=${healpyarchive_alt}${healpytag}.tar.gz # alternative
#wget -O/dev/null -q ${hpy1} && wget ${hpy1} ${hpyops} || wget ${hpy2} ${hpyops}
wget ${hpy1} ${hpyops}
else
echo ${healpyarchive}healpy-${healpytag}.tar.gz
ls -l ${healpyarchive}healpy-${healpytag}.tar.gz
cp ${healpyarchive}healpy-${healpytag}.tar.gz .
fi
tar -xvzpf healpy-${healpytag}.tar.gz
mv healpy-${healpytag} healpy
fi
cd ${WRKDIR}
cp -pr healpy Healpix_${VERSION}/src
cd Healpix_${VERSION}/src/healpy
\rm -rf .git*
if [ -d healpixsubmodule/src/common_libraries ] ; then # version 1.13.0 and above
cd healpixsubmodule/src/common_libraries/libsharp
echoBlu "in ${PWD}"
for dir in c_utils libsharp pocketfft ; do
echoRed "Replacing ${dir}"
\rm -r ${dir}
\ln -sf ../../../../../common_libraries/libsharp/${dir} .
ls -l ${dir}
done
cd -
cd healpixsubmodule/src/cxx
echoBlu "in ${PWD}"
\ln -sf ../../../../cxx .
for dir in Healpix_cxx cxxsupport ; do
echoRed "Replacing ${dir}"
\rm -r ${dir}
\ln -sf cxx/${dir} .
ls -l ${dir}
done
cd -
fi
# if [ -d healpixsubmodule/src/cxx/autotools ] ; then # version 1.7* and above
# cd healpixsubmodule/src/cxx/autotools
# \ln -sf ../../../../../cxx .
# #for dir in Healpix_cxx c_utils cxxsupport libfftpack libsharp ; do
# #for dir in Healpix_cxx c_utils cxxsupport pocketfft libsharp ; do
# for dir in Healpix_cxx c_utils cxxsupport ; do
# echoRed "Replacing ${dir}"
# \rm -r ${dir}
# \ln -sf cxx/${dir} .
# done
# cd -
# elif [ -d healpixcxx ] ; then # deprecated
# \rm -rf healpixcxx .git*
# mkdir -p healpixcxx/src
# cd healpixcxx/src
# ln -s ../../../cxx .
# cd -
# fi
# if [ ! -f cfitsio/License.txt ] ; then # put by hand cfitsio source
# echo "Put CFITSIO source files"
# \rm -rf cfitsio
# cfitsio_tarball=cfitsio_3.36_for_healpy_1.9.x.tar.gz
# cp -p ~/Healpix_releases/${cfitsio_tarball} .
# tar -xvzpf ${cfitsio_tarball}
# \rm ${cfitsio_tarball}
# fi
# if [ ! -d healpixsubmodules/src ] ; then # put by hand healpixsubmodules
# echo "Put links to HEALPix/C++ source files"
# \rm -rf healpixsubmodules
# hsm_tarball=healpixsubmodule_for_healpy_1.9.x.tar.gz
# cp -p ~/Healpix_releases/${hsm_tarball} .
# tar -xvzpf ${hsm_tarball}
# \rm ${hsm_tarball}
# fi
echoBlu "--------- Discrepancy in healpy -------------"
diff -qr ${PWD} ~/healpy/healpy-${healpytag}
echoGrn "-------------------- Done! ------------------"
cd ${WRKDIR}
fi
exit