This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
/
post-process.sh
executable file
·114 lines (102 loc) · 2.77 KB
/
post-process.sh
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
#!/usr/bin/env bash
. ${0%post-process.sh}configuration.sh
if [ $# -gt 1 ]; then
SAGE_ROOT="$1"
else
SAGE_ROOT="$(pwd)"
fi
SAGE_ROOT=$(readlink -f "$SAGE_ROOT")
cd "$SAGE_ROOT"
# remove .hg* files
git rm $(find -name '.hg*')
git commit -m "[CLEANUP] Mercurial-related data"
# final fix of file locations
git mv $SAGE_BUILD/standard/deps $SAGE_BUILD/deps
git commit -m "[REORG] Final fix of file locations"
# remove unused scripts
git rm $(find -name sage-push)
git rm $(find -name sage-pull)
git rm $(find $SAGE_SRC -name spkg-install)
git rm $(find $SAGE_SRC -name spkg-dist)
git rm $(find $SAGE_SRC -name spkg-delauto)
for file in $(cat <<FILES
$SAGE_SRC/bundle
$SAGE_SRC/README.txt
$SAGE_SRC/export
$SAGE_SRC/install
$SAGE_SRC/pull
$SAGE_SRC/sage/misc/hg.py
$SAGE_SCRIPTS_DIR/sage-sage
$SAGE_SCRIPTS_DIR/sage-spkg-install
$SAGE_SCRIPTS_DIR/sage-clone
$SAGE_SCRIPTS_DIR/sage-make_devel_packages
$SAGE_SCRIPTS_DIR/json_bundle.py
$SAGE_SCRIPTS_DIR/text-expand
$SAGE_SCRIPTS_DIR/text-collapse
$SAGE_SCRIPTS_DIR/sage-update
$SAGE_SCRIPTS_DIR/sage-update-build
$SAGE_SCRIPTS_DIR/sage-apply-ticket
$SAGE_BUILD/root-spkg-install
$SAGE_BUILD/gen_html
$SAGE_BUILD/standard
$SAGE_BUILD/README.txt
FILES
)
do
git rm -r $file
done
git commit -m "[CLEANUP] Unused files"
# add gitignores
add_gitignore() {
FILE=$1
case $FILE in
root) OUTDIR="." ;;
build*) OUTDIR="$(sed -e "s+\$build+$SAGE_BUILD+" <<<$FILE)" ;;
src*) OUTDIR="$(sed -e "s+\$src+$SAGE_SRC+" <<<$FILE)" ;;
*) OUTDIR="$FILE" ;;
esac
OUTDIR="$(sed 's+-+/+g' <<<$OUTDIR)"
cat_workflow_file post-process_files/gitignore-$FILE | sort > $OUTDIR/.gitignore
}
add_gitignore build
add_gitignore root
add_gitignore src
add_gitignore src-c_lib
add_gitignore src-doc
add_gitignore src-sage
add_gitignore src-sage-ext-interpreters
git add -f $(find -name '.gitignore')
git commit -m '[CLEANUP] Add gitignores'
# apply patchs
apply_patch () {
cat_workflow_file post-process_files/$1.patch | git am
}
#apply_patch sage-env1
cat_workflow_file post-process_files/sage-build > "$SAGE_SCRIPTS_DIR"/sage-build
chmod 755 "$SAGE_SCRIPTS_DIR"/sage-build
git add "$SAGE_SCRIPTS_DIR"/sage-build
git commit -m '(FIXUP) new sage-build script'
#apply_patch install1
#apply_patch prereq-install1
#apply_patch deps1
#apply_patch sage-spkg1
#apply_patch sage-spkg2
#apply_patch sage-starts1
#apply_patch csage1
#apply_patch sage1
#apply_patch docbuild1
#apply_patch sage_artifacts1
#apply_patch ntl1
#apply_patch singular1
#apply_patch sagenb1
#apply_patch hg1
#apply_patch gcc1
#apply_patch makefile1
#apply_patch whitespace1
#apply_patch devel_doctests1
#apply_patch makefile2
#apply_patch sage_data1
#apply_patch sage-envpy1
#apply_patch long_doctests1
#apply_patch setup1
#apply_patch gcc1