Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/build/pkgs/cddlib/patches/refresh_autogenerated.sh
8818 views
1
#!/usr/bin/env bash
2
3
4
cat <<EOF
5
6
To refresh the autogenerated files you need to install the cddlib
7
spkg, rerun autotools, and then copy the newly generated files into
8
the patches/autogenerated directory. This script helps with the last
9
part, namely copying the relevant autogenerated files.
10
11
This script must be run inside the patches/ directory and requires a
12
single argument, the spkg build directory from where the newly
13
generated files are copied.
14
15
In short, you need to do the following. First, install the spkg:
16
17
[user@localhost]$ sage -pkg cddlib-<version>
18
[user@localhost]$ sage -i -s cddlib-<version>.spkg
19
... does not matter if it actually compiles ...
20
21
Then, rerun the autotools:
22
23
[user@localhost]$ cd $SAGE_LOCAL/spkg/build/cddlib-<version>/src
24
[user@localhost]$ autoreconf -fiv
25
26
Finally, copy the newly generated files:
27
28
[user@localhost]$ cd cddlib-<version>/patches/
29
[user@localhost]$ ./refresh_autogenerated.sh $SAGE_LOCAL/spkg/build/cddlib-<version>/src
30
EOF
31
echo
32
33
PATCHDIR=`pwd`
34
BUILDDIR=$1
35
36
37
echo "Copying autogenerated files from $BUILDDIR to $PATCHDIR"
38
[ ! -d "$BUILDDIR" ] && echo "Directory does not exist" && exit 1
39
[ ! -d "$PATCHDIR/autogenerated" ] && echo "You are not in the patches/ directory" && exit 1
40
41
cd $PATCHDIR/autogenerated
42
for i in `find . -type f` ; do cp -Rp $BUILDDIR/$i $i ; done
43
44
45
46