Ticket #12173: script.sh

File script.sh, 2.5 KB (added by jpflori, 9 years ago)

Update script.

Line 
1#!/bin/bash
2
3# Execute in $SAGE_ROOT/devel/sage
4
5# function names
6list="\/FLINT/\/flint
7FLINT\//flint\/
8sage\.libs\.flint\.long_extras/sage.libs.flint.ulong_extras
9
10ZZX_to_fmpz_poly/fmpz_poly_set_ZZX
11fmpz_poly_to_ZZX/fmpz_poly_get_ZZX
12fmpz_to_mpz/fmpz_get_mpz
13ZZ_to_fmpz/fmpz_set_ZZ
14
15mpz_to_fmpz/fmpz_set_mpz
16
17 z_isprime/ n_is_prime
18 z_gcd/ n_gcd
19 z_factor/ n_factor
20 factor_t / n_factor_t
21
22fmpz_poly_scalar_div_exact_ui/fmpz_poly_scalar_divexact_ui
23fmpz_poly_scalar_div_exact_si/fmpz_poly_scalar_divexact_si
24fmpz_poly_scalar_div_exact_fmpz/fmpz_poly_scalar_divexact_fmpz
25fmpz_poly_from_string/fmpz_poly_set_str
26fmpz_poly_to_string/fmpz_poly_get_str
27fmpz_poly_power_trunc_n/fmpz_poly_pow_trunc
28fmpz_poly_power/fmpz_poly_pow
29fmpz_poly_left_shift/fmpz_poly_shift_left
30fmpz_poly_right_shift/fmpz_poly_shift_right
31fmpz_poly_evaluate/fmpz_poly_evaluate_fmpz
32fmpz_poly_scalar_div_mpz/fmpz_poly_scalar_fdiv_mpz
33fmpz_poly_scalar_div_ui/fmpz_poly_scalar_fdiv_ui
34
35zmod_poly/nmod_poly
36__nmod_poly_normalise/_nmod_poly_normalise
37nmod_poly_init_precomp/nmod_poly_init_preinv
38nmod_poly_init2_precomp/nmod_poly_init2_preinv
39nmod_poly_scalar_mul(/nmod_poly_scalar_mul_nmod(
40nmod_poly_evaluate(/nmod_poly_evaluate_nmod(
41nmod_poly_compose_horner/nmod_poly_compose
42nmod_poly_mul_trunc_n/nmod_poly_mullow
43nmod_poly_mul_trunc_left_n/nmod_poly_mulhigh
44nmod_poly_isirreducible/nmod_poly_is_irreducible
45nmod_poly_factor_square_free/nmod_poly_factor_squarefree
46
47numer.p_inv/numer.mod.ninv
48denom.p_inv/denom.mod.ninv
49
50_fmpq_poly_from_list/fmpq_poly_set_array_mpq
51fmpq_poly_getslice/fmpq_poly_get_slice
52fmpq_poly_left_shift/fmpq_poly_shift_left
53fmpq_poly_right_shift/fmpq_poly_shift_right
54fmpq_poly_power/fmpq_poly_pow
55fmpq_poly_floordiv/fmpq_poly_div
56fmpq_poly_mod/fmpq_poly_rem"
57
58IFS=$'\n'
59for repl in $list;
60do
61    find . \( -name "*.pxi" -o -name "*.pxd" -o -name "*.pyx" -o -name "*.py" \) -exec sed -i "s/$repl/g" {} \;
62done
63
64# move files
65mv sage/libs/flint/zmod_poly_linkage.pxi sage/libs/flint/nmod_poly_linkage.pxi
66mv sage/libs/flint/zmod_poly.pxd sage/libs/flint/nmod_poly.pxd
67#mv sage/rings/polynomial/polynomial_zmod_flint.pxd sage/rings/polynomial/polynomial_nmod_flint.pxd
68#mv sage/rings/polynomial/polynomial_zmod_flint.pyx sage/rings/polynomial/polynomial_nmod_flint.pyx
69
70# delete files integrated upstream
71rm -f sage/libs/flint/fmpq_poly.c sage/libs/flint/fmpq_poly.h sage/libs/flint/long_extras.pxd
72
73# help mercurial by running hg addremove
74echo "You should now move script.sh out of the way and run 'hg addremove'."