python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / misc / taoup / cachefile.patch
blob7c92b2180c67e276dde44e5648a354f53f1eb214
1 --- a/taoup-fortune 2021-09-05 12:16:23.408295791 +0800
2 +++ b/taoup-fortune 2021-09-05 13:02:52.286440200 +0800
3 @@ -5,31 +5,9 @@
4 # - https://github.com/matheuss/parrotsay
5 # - https://github.com/busyloop/lolcat
6 # - https://github.com/sckott/cowsay (enhanced version)
7 -dir=`dirname "${BASH_SOURCE[0]}"`
9 -# USER ALERT!!! @ronjouch complained about execution speed at https://github.com/globalcitizen/taoup/issues/11
10 -# ... therefore we add caching ... therefore first ensure we have an up to date cache via one of ...
11 -# md5sum
12 -if [ `which md5sum 2>/dev/null` ]; then
13 - MD5SUM=`md5sum ${dir}/taoup | cut -d ' ' -f1`
14 -# md5
15 -elif [ `which md5 2>/dev/null` ]; then
16 - MD5SUM=`md5 -q ${dir}/taoup | cut -d ' ' -f1`
17 -# openssl
18 -elif [ `which openssl 2>/dev/null` ]; then
19 - MD5SUM=`cat ${dir}/taoup | openssl md5 | grep -o '[[:xdigit:]][[:xdigit:]]*$' |cut -d '=' -f2- |cut -c 2-`
20 -# ruby
21 -elif [ `which ruby 2>/dev/null` ]; then
22 - MD5SUM=`ruby -rdigest/md5 -e"puts Digest::MD5.file'${dir}/taoup'"`
23 -fi
25 # determine cachefile name
26 -cachefile=${dir}/.taoup-fortune.cache.${MD5SUM}
28 -# create if necessary
29 -if [ ! -r $cachefile ]; then
30 - ${dir}/taoup $@ >${cachefile}
31 -fi
32 +cachefile=@out@/lib/taoup/cache
34 # handle all classes of society
35 if [ `which cowsay 2>/dev/null` ]; then