Debian Codegraph @

bin/build/ff-md5

raw
1 #!/usr/bin/perl
2
3 ############################################################################
4 # This file is part of FreeFEM. #
5 # #
6 # FreeFEM is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU Lesser General Public License as #
8 # published by the Free Software Foundation, either version 3 of #
9 # the License, or (at your option) any later version. #
10 # #
11 # FreeFEM is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU Lesser General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU Lesser General Public License #
17 # along with FreeFEM. If not, see <http://www.gnu.org/licenses/>. #
18 ############################################################################
19 # SUMMARY : Download third-party packages independently of FF configuration
20 # LICENSE : LGPLv3
21 # ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE
22 # AUTHORS : Antoine Le Hyaric
23 # E-MAIL : ...
24
25 use Digest::MD5 qw(md5_hex); # [[http://perldoc.perl.org/Digest/MD5.html]]
26 ($ff,$mm) =@ARGV;
27 if( ! -e "$ff") {exit 2; }
28 $hh=md5_hex(`cat $ff`);
29
30 # print "ff=$ff, hh= $hh == $mm, \n";
31 if ( "$hh" == "$mm") {exit 0;}
32 else {exit 1;}