forked from spacetelescope/crds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·68 lines (54 loc) · 2.24 KB
/
install
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
#! /bin/sh
cd `dirname $0`
# The clean script removes temporary and junk files that should not be
# committed to the source code repo.
if (test -e clean)
then
./clean
fi
if [ "$1" = "--skip-types" ]; then
shift;
dont_skip_types=0
else
dont_skip_types=1
fi
rm -f install.log
st=0
# CRDS type specifications are configured in code as individual files in the
# project "specs" subdirectories. This step creates combined versions of the
# specs files for faster loading at runtime by first removing the existing
# combined spec and then invoking the project package. Importing the project
# packages triggers loading type specs which will automatically rebuild the
# (intentionally removed) combined .json file for faster loading in the future.
# Once the combined .json spec has been generated, it is committed and
# installed as code by setup.py and it will be loaded in preference to the
# individual specs to reduce impact on the file system. Unless type specifications
# are being modified, regenerating the comined_specs.json files should have
# no effect. When types are added or modified, the combined_specs.json file
# will also automatically be modified during ./install, and the changes should be
# both committed to GitHub and later installed normally as source code by setup.py.
# (setup.py does not regenerate these combined spec files, it is assumed that
# type developers will execute this ./install script at least once after adding
# or changing CRDS type specs, after which the combined spec file is effectively
# source code.
if [ $dont_skip_types = 1 ]; then
find . -name combined_specs.json | xargs rm
find crds/hst/specs crds/jwst/specs crds/tobs/specs -name '*.rmap' | xargs python -m crds.refactoring.checksum
python -m crds.hst
python -m crds.jwst
python -m crds.tobs
fi
python setup.py install $* --force >> install.log
st=$st$?
# Optional CRDS test data is only installed by developers using ./install
# to install CRDS from source code. To support testing the
# setup_test_cache script should also be run to install other test files.
python setup_data.py install --force >>install.log
st=$st$?
if (test -e clean)
then
./clean
fi
echo final status $st
st=`echo $st | tr -d 0 | cut -c1-1`
exit $st