summaryrefslogtreecommitdiff
path: root/Build-tools/my_md5sum
diff options
context:
space:
mode:
Diffstat (limited to 'Build-tools/my_md5sum')
-rwxr-xr-xBuild-tools/my_md5sum19
1 files changed, 18 insertions, 1 deletions
diff --git a/Build-tools/my_md5sum b/Build-tools/my_md5sum
index 20742ee2ed0..f4ac2f7d674 100755
--- a/Build-tools/my_md5sum
+++ b/Build-tools/my_md5sum
@@ -10,10 +10,22 @@
# Written by Matt Wagner <matt@mysql.com>
#
use strict;
+
+#
+# Use local perl libraries first. 'unshift' adds to the front of @INC
+# The local perl library dir hidden is $HOME/.perllibs on each build host
+#
+BEGIN
+{
+ my $homedir= $ENV{HOME};
+ unshift (@INC, "$homedir/.perllibs");
+}
+
use Digest::MD5;
use Getopt::Long;
-my $VER= "1.1";
+my $VER= "1.3";
+my $EXIT= 0;
#
# Strip the leading path info off the program name ($0). We want 'my_md5sum'
@@ -67,6 +79,9 @@ if ($opt_check)
# Print an error message if they don't match, else print OK
print "$checkfile: FAILED\n" if $digest ne $checksum;
print "$checkfile: OK\n" if $digest eq $checksum;
+
+ # Set the exit() status to non-zero if FAILED
+ $EXIT= 1 if $digest ne $checksum;
}
}
# Else generate the MD5 digest to STDOUT
@@ -80,6 +95,8 @@ else
}
}
+exit($EXIT);
+
#
# This routine generates the MD5 digest of a file