improved update-libtom.pl script
Karel Miko
5 years ago
2 | 2 | use Modern::Perl; |
3 | 3 | use File::Find qw(find); |
4 | 4 | use File::Slurper qw(read_text write_text); |
5 | use File::Glob qw(bsd_glob); | |
5 | 6 | use FindBin; |
6 | 7 | |
7 | 8 | my $ltc_branch = "develop"; |
9 | 10 | my $tmpdir = "/tmp/libtom.git.checkout.$$"; |
10 | 11 | |
11 | 12 | warn "update libtommath from github (branch: $ltm_branch)..\n"; |
13 | system 'rm', '-rf', bsd_glob("$FindBin::Bin/ltm/*"); | |
12 | 14 | system "rm -rf $tmpdir; mkdir $tmpdir"; |
13 | 15 | system "git clone -b $ltm_branch https://github.com/libtom/libtommath.git $tmpdir && cp -R $tmpdir/bn*.c $tmpdir/tom*.h $FindBin::Bin/ltm/ && echo ok"; |
14 | 16 | |
15 | 17 | warn "update libtomcrypt from github (branch: $ltc_branch)..\n"; |
18 | system 'rm', '-rf', bsd_glob("$FindBin::Bin/ltc/*"); | |
16 | 19 | system "rm -rf $tmpdir; mkdir $tmpdir"; |
17 | 20 | system "git clone -b $ltc_branch https://github.com/libtom/libtomcrypt.git $tmpdir && cp -R $tmpdir/src/* $FindBin::Bin/ltc/ && echo ok"; |
18 | 21 | system "rm -rf $tmpdir"; |