-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_eps_json
executable file
·88 lines (66 loc) · 1.56 KB
/
generate_eps_json
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
#! /bin/bash
DATA_FILE="data/f8_active.list"
LOG_FILE="data/gen.log"
dstamp () {
date -uIsec | grep -Eo '.*[+]'
}
log () {
echo "$( dstamp ) $1" >> $LOG_FILE
}
# Remove any existing generation log
if [[ -e "$LOG_FILE" ]]
then
echo "Removing old log"
rm "$LOG_FILE"
fi
# Skipping the restart, to see if the JSON
# update still works correctly without starting
# fresh.
# # Restart the entry points JSON
# python eps_json.py init --restart
# log "JSON Restarted"
# Loop over all the indicated packages
for pkg in $( cat $DATA_FILE )
do
log "====== Start $pkg"
# Install the package from PyPI w/o dependencies
log "---- Attempt install"
pip install --no-deps $pkg
install_result=$?
if [[ $install_result -eq 0 ]]
then
log ".. OK"
else
log ".. FAILED (exit $install_result)"
fi
# Run the entry points JSON recorder if install worked
if [[ $install_result -eq 0 ]]
then
log "---- Attempt entry point retrieval"
python eps_json.py $pkg
json_result=$?
if [[ $json_result -eq 0 ]]
then
log ".. OK"
else
log ".. FAILED (exit $json_result)"
fi
else
log "---- SKIP entry point retrieval"
fi
# Uninstall the package, regardless of whether install succeeded
log "---- Uninstall package"
# flufl-flake8 installs as flufl.flake8
# Always try to remove it
pip uninstall -y $pkg flufl.flake8
uninst_result=$?
if [[ $uninst_result -eq 0 ]]
then
log ".. OK"
else
log ".. CRITICAL (exit $uninst_result), invalid state! Halting!"
exit 1
fi
done
log "====== DONE"
exit 0