[tor-commits] [tor-browser-build/master] Bug 28771: Port get_hg_hash to Path::Tiny and note JSON dependency in README.

boklm at torproject.org boklm at torproject.org
Fri Dec 7 15:20:41 UTC 2018


commit 56ce89fe1a99c304b7292a7087ae8d0ad2412273
Author: David Fifield <david at bamsoftware.com>
Date:   Fri Dec 7 03:40:56 2018 +0000

    Bug 28771: Port get_hg_hash to Path::Tiny and note JSON dependency in README.
---
 README                                     | 3 ++-
 projects/firefox-locale-bundle/get_hg_hash | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 5fb32ba..e1e93c6 100644
--- a/README
+++ b/README
@@ -26,6 +26,7 @@ You also need a few perl modules installed:
 - Template
 - IO::Handle
 - IO::CaptureOutput
+- JSON
 - File::Temp
 - Path::Tiny
 - File::Path
@@ -40,7 +41,7 @@ If you are running Debian or Ubuntu, you can install them with:
 
 # apt-get install libyaml-libyaml-perl libtemplate-perl \
                   libio-handle-util-perl libio-all-perl \
-                  libio-captureoutput-perl libpath-tiny-perl \
+                  libio-captureoutput-perl libjson-perl libpath-tiny-perl \
                   libstring-shellquote-perl libsort-versions-perl \
                   libdigest-sha-perl libdata-uuid-perl libdata-dump-perl \
                   libfile-copy-recursive-perl git libgtk2.0-dev curl runc \
diff --git a/projects/firefox-locale-bundle/get_hg_hash b/projects/firefox-locale-bundle/get_hg_hash
index 9b2b5bd..18b174e 100755
--- a/projects/firefox-locale-bundle/get_hg_hash
+++ b/projects/firefox-locale-bundle/get_hg_hash
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 use strict;
-use File::Slurp;
+use Path::Tiny;
 use JSON;
 
 sub exit_error {
@@ -11,7 +11,7 @@ sub exit_error {
 exit_error("Wrong number of arguments", 1) unless @ARGV == 2;
 
 my ($file, $locale) = @ARGV;
-my $json_text = read_file($file);
+my $json_text = path($file)->slurp_raw;
 exit_error("Error reading $file", 2) unless defined $json_text;
 
 my $data = decode_json($json_text);



More information about the tor-commits mailing list