From ea368919f3b535331f72e8fbcebfb5ec21a13057 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 26 Aug 2016 00:01:34 -0400 Subject: [PATCH] Remove sha1sum dependency for doc generation On MacOS X there is no sha1sum. So to simplify doc generation on those systems use a Python script instead to generate a unique string from the repository path. --- doc/Makefile | 2 +- doc/utils/sha1sum.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 doc/utils/sha1sum.py diff --git a/doc/Makefile b/doc/Makefile index 198fffda22..8ee8379c58 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,5 +1,5 @@ # Makefile for LAMMPS documentation -SHA1 = $(shell echo $USER-$PWD | sha1sum | cut -f1 -d" ") +SHA1 = $(shell echo $USER-$PWD | python utils/sha1sum.py) BUILDDIR = /tmp/lammps-docs-$(SHA1) RSTDIR = $(BUILDDIR)/rst VENV = $(BUILDDIR)/docenv diff --git a/doc/utils/sha1sum.py b/doc/utils/sha1sum.py new file mode 100755 index 0000000000..d4842ecf1a --- /dev/null +++ b/doc/utils/sha1sum.py @@ -0,0 +1,7 @@ +#!/bin/env python +# simple utility which reimplements sha1sum using Python +import hashlib +import sys +s = hashlib.sha1() +s.update(sys.stdin.read().encode()) +print(s.hexdigest())