Hex Artifact Content
Not logged in

Artifact 433efaa35a360ddcdfba723979c682975286cd83:


0000: 23 21 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 62  #!/usr/bin/env b
0010: 61 73 68 0a 23 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ash.#===========
0020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0050: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a  ===============.
0060: 23 0a 23 20 54 68 65 20 4d 49 54 20 6c 69 63 65  #.# The MIT lice
0070: 6e 73 65 20 66 72 6f 6d 20 74 68 65 20 0a 23 20  nse from the .# 
0080: 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73  http://www.opens
0090: 6f 75 72 63 65 2e 6f 72 67 2f 6c 69 63 65 6e 73  ource.org/licens
00a0: 65 73 2f 6d 69 74 2d 6c 69 63 65 6e 73 65 2e 70  es/mit-license.p
00b0: 68 70 0a 23 20 0a 23 20 43 6f 70 79 72 69 67 68  hp.# .# Copyrigh
00c0: 74 20 28 63 29 20 32 30 31 36 2c 20 4d 61 72 74  t (c) 2016, Mart
00d0: 69 6e 2e 56 61 68 69 40 73 6f 66 74 66 31 2e 63  in.Vahi@softf1.c
00e0: 6f 6d 20 74 68 61 74 20 68 61 73 20 61 6e 0a 23  om that has an.#
00f0: 20 45 73 74 6f 6e 69 61 6e 20 70 65 72 73 6f 6e   Estonian person
0100: 61 6c 20 69 64 65 6e 74 69 66 69 63 61 74 69 6f  al identificatio
0110: 6e 20 63 6f 64 65 20 6f 66 20 33 38 31 30 38 30  n code of 381080
0120: 35 30 30 32 30 2e 0a 23 0a 23 20 50 65 72 6d 69  50020..#.# Permi
0130: 73 73 69 6f 6e 20 69 73 20 68 65 72 65 62 79 20  ssion is hereby 
0140: 67 72 61 6e 74 65 64 2c 20 66 72 65 65 20 6f 66  granted, free of
0150: 20 63 68 61 72 67 65 2c 20 74 6f 20 0a 23 20 61   charge, to .# a
0160: 6e 79 20 70 65 72 73 6f 6e 20 6f 62 74 61 69 6e  ny person obtain
0170: 69 6e 67 20 61 20 63 6f 70 79 20 6f 66 20 74 68  ing a copy of th
0180: 69 73 20 73 6f 66 74 77 61 72 65 20 61 6e 64 20  is software and 
0190: 0a 23 20 61 73 73 6f 63 69 61 74 65 64 20 64 6f  .# associated do
01a0: 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65  cumentation file
01b0: 73 20 28 74 68 65 20 22 53 6f 66 74 77 61 72 65  s (the "Software
01c0: 22 29 2c 20 0a 23 20 74 6f 20 64 65 61 6c 20 69  "), .# to deal i
01d0: 6e 20 74 68 65 20 53 6f 66 74 77 61 72 65 20 77  n the Software w
01e0: 69 74 68 6f 75 74 20 72 65 73 74 72 69 63 74 69  ithout restricti
01f0: 6f 6e 2c 20 69 6e 63 6c 75 64 69 6e 67 20 0a 23  on, including .#
0200: 20 77 69 74 68 6f 75 74 20 6c 69 6d 69 74 61 74   without limitat
0210: 69 6f 6e 20 74 68 65 20 72 69 67 68 74 73 20 74  ion the rights t
0220: 6f 20 75 73 65 2c 20 63 6f 70 79 2c 20 6d 6f 64  o use, copy, mod
0230: 69 66 79 2c 20 6d 65 72 67 65 2c 20 70 75 62 6c  ify, merge, publ
0240: 69 73 68 2c 20 0a 23 20 64 69 73 74 72 69 62 75  ish, .# distribu
0250: 74 65 2c 20 73 75 62 6c 69 63 65 6e 73 65 2c 20  te, sublicense, 
0260: 61 6e 64 2f 6f 72 20 73 65 6c 6c 20 63 6f 70 69  and/or sell copi
0270: 65 73 20 6f 66 20 74 68 65 20 53 6f 66 74 77 61  es of the Softwa
0280: 72 65 2c 20 61 6e 64 20 0a 23 20 74 6f 20 70 65  re, and .# to pe
0290: 72 6d 69 74 20 70 65 72 73 6f 6e 73 20 74 6f 20  rmit persons to 
02a0: 77 68 6f 6d 20 74 68 65 20 53 6f 66 74 77 61 72  whom the Softwar
02b0: 65 20 69 73 20 66 75 72 6e 69 73 68 65 64 20 74  e is furnished t
02c0: 6f 20 64 6f 20 73 6f 2c 20 0a 23 20 73 75 62 6a  o do so, .# subj
02d0: 65 63 74 20 74 6f 20 74 68 65 20 66 6f 6c 6c 6f  ect to the follo
02e0: 77 69 6e 67 20 63 6f 6e 64 69 74 69 6f 6e 73 3a  wing conditions:
02f0: 0a 23 0a 23 20 54 68 65 20 61 62 6f 76 65 20 63  .#.# The above c
0300: 6f 70 79 72 69 67 68 74 20 6e 6f 74 69 63 65 20  opyright notice 
0310: 61 6e 64 20 74 68 69 73 20 70 65 72 6d 69 73 73  and this permiss
0320: 69 6f 6e 20 6e 6f 74 69 63 65 20 73 68 61 6c 6c  ion notice shall
0330: 20 62 65 20 69 6e 63 6c 75 64 65 64 20 0a 23 20   be included .# 
0340: 69 6e 20 61 6c 6c 20 63 6f 70 69 65 73 20 6f 72  in all copies or
0350: 20 73 75 62 73 74 61 6e 74 69 61 6c 20 70 6f 72   substantial por
0360: 74 69 6f 6e 73 20 6f 66 20 74 68 65 20 53 6f 66  tions of the Sof
0370: 74 77 61 72 65 2e 0a 23 0a 23 20 54 48 45 20 53  tware..#.# THE S
0380: 4f 46 54 57 41 52 45 20 49 53 20 50 52 4f 56 49  OFTWARE IS PROVI
0390: 44 45 44 20 22 41 53 20 49 53 22 2c 20 57 49 54  DED "AS IS", WIT
03a0: 48 4f 55 54 20 57 41 52 52 41 4e 54 59 20 4f 46  HOUT WARRANTY OF
03b0: 20 41 4e 59 20 4b 49 4e 44 2c 20 0a 23 20 45 58   ANY KIND, .# EX
03c0: 50 52 45 53 53 20 4f 52 20 49 4d 50 4c 49 45 44  PRESS OR IMPLIED
03d0: 2c 20 49 4e 43 4c 55 44 49 4e 47 20 42 55 54 20  , INCLUDING BUT 
03e0: 4e 4f 54 20 4c 49 4d 49 54 45 44 20 54 4f 20 54  NOT LIMITED TO T
03f0: 48 45 20 57 41 52 52 41 4e 54 49 45 53 20 4f 46  HE WARRANTIES OF
0400: 20 0a 23 20 4d 45 52 43 48 41 4e 54 41 42 49 4c   .# MERCHANTABIL
0410: 49 54 59 2c 20 46 49 54 4e 45 53 53 20 46 4f 52  ITY, FITNESS FOR
0420: 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55   A PARTICULAR PU
0430: 52 50 4f 53 45 20 41 4e 44 20 4e 4f 4e 49 4e 46  RPOSE AND NONINF
0440: 52 49 4e 47 45 4d 45 4e 54 2e 20 0a 23 20 49 4e  RINGEMENT. .# IN
0450: 20 4e 4f 20 45 56 45 4e 54 20 53 48 41 4c 4c 20   NO EVENT SHALL 
0460: 54 48 45 20 41 55 54 48 4f 52 53 20 4f 52 20 43  THE AUTHORS OR C
0470: 4f 50 59 52 49 47 48 54 20 48 4f 4c 44 45 52 53  OPYRIGHT HOLDERS
0480: 20 42 45 20 4c 49 41 42 4c 45 20 46 4f 52 20 41   BE LIABLE FOR A
0490: 4e 59 20 0a 23 20 43 4c 41 49 4d 2c 20 44 41 4d  NY .# CLAIM, DAM
04a0: 41 47 45 53 20 4f 52 20 4f 54 48 45 52 20 4c 49  AGES OR OTHER LI
04b0: 41 42 49 4c 49 54 59 2c 20 57 48 45 54 48 45 52  ABILITY, WHETHER
04c0: 20 49 4e 20 41 4e 20 41 43 54 49 4f 4e 20 4f 46   IN AN ACTION OF
04d0: 20 43 4f 4e 54 52 41 43 54 2c 20 0a 23 20 54 4f   CONTRACT, .# TO
04e0: 52 54 20 4f 52 20 4f 54 48 45 52 57 49 53 45 2c  RT OR OTHERWISE,
04f0: 20 41 52 49 53 49 4e 47 20 46 52 4f 4d 2c 20 4f   ARISING FROM, O
0500: 55 54 20 4f 46 20 4f 52 20 49 4e 20 43 4f 4e 4e  UT OF OR IN CONN
0510: 45 43 54 49 4f 4e 20 57 49 54 48 20 54 48 45 20  ECTION WITH THE 
0520: 0a 23 20 53 4f 46 54 57 41 52 45 20 4f 52 20 54  .# SOFTWARE OR T
0530: 48 45 20 55 53 45 20 4f 52 20 4f 54 48 45 52 20  HE USE OR OTHER 
0540: 44 45 41 4c 49 4e 47 53 20 49 4e 20 54 48 45 20  DEALINGS IN THE 
0550: 53 4f 46 54 57 41 52 45 2e 0a 23 0a 23 2d 2d 2d  SOFTWARE..#.#---
0560: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0570: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0580: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0590: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
05a0: 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 4f 44 4f 3a 20  -------.# TODO: 
05b0: 0a 23 20 20 20 20 20 44 75 65 20 74 6f 20 74 68  .#     Due to th
05c0: 65 20 64 75 6d 62 20 72 65 2d 69 6e 69 74 69 61  e dumb re-initia
05d0: 6c 69 7a 61 74 69 6f 6e 20 6f 66 20 74 68 65 20  lization of the 
05e0: 77 68 6f 6c 65 20 0a 23 20 20 20 20 20 52 75 62  whole .#     Rub
05f0: 79 20 69 6e 74 65 72 70 72 65 74 65 72 20 66 6f  y interpreter fo
0600: 72 20 65 76 65 72 79 20 73 6d 61 6c 6c 20 73 74  r every small st
0610: 72 69 6e 67 20 6f 70 65 72 61 74 69 6f 6e 20 69  ring operation i
0620: 6e 20 74 68 69 73 20 73 63 72 69 70 74 2c 0a 23  n this script,.#
0630: 20 20 20 20 20 74 68 65 20 63 75 72 72 65 6e 74       the current
0640: 20 76 65 72 73 69 6f 6e 20 6f 66 20 74 68 69 73   version of this
0650: 20 73 63 72 69 70 74 20 69 73 20 74 65 72 72 69   script is terri
0660: 62 6c 79 20 73 6c 6f 77 2e 0a 23 20 20 20 20 20  bly slow..#     
0670: 49 74 20 63 6f 75 6c 64 20 62 65 20 66 61 73 74  It could be fast
0680: 65 72 2c 20 69 66 20 67 61 77 6b 2f 61 77 6b 20  er, if gawk/awk 
0690: 77 65 72 65 20 75 73 65 64 2c 20 62 75 74 20 74  were used, but t
06a0: 68 65 20 0a 23 20 20 20 20 20 67 61 77 6b 2f 61  he .#     gawk/a
06b0: 77 6b 20 68 61 73 20 62 65 65 6e 20 69 6e 74 65  wk has been inte
06c0: 6e 74 69 6f 6e 61 6c 6c 79 20 74 68 72 6f 77 6e  ntionally thrown
06d0: 20 6f 75 74 2c 20 62 65 63 61 75 73 65 20 74 68   out, because th
06e0: 65 20 67 61 77 6b 20 61 6e 64 20 61 77 6b 20 0a  e gawk and awk .
06f0: 23 20 20 20 20 20 62 65 68 61 76 65 20 64 69 66  #     behave dif
0700: 66 65 72 65 6e 74 6c 79 20 66 72 6f 6d 20 65 61  ferently from ea
0710: 63 68 20 6f 74 68 65 72 2e 20 4f 6e 20 42 53 44  ch other. On BSD
0720: 20 74 68 65 72 65 20 74 65 6e 64 73 20 74 6f 20   there tends to 
0730: 62 65 20 6f 6e 6c 79 20 22 61 77 6b 22 2c 0a 23  be only "awk",.#
0740: 20 20 20 20 20 77 68 69 6c 65 20 74 68 65 20 4c       while the L
0750: 69 6e 75 78 20 74 65 6e 64 73 20 74 6f 20 68 61  inux tends to ha
0760: 76 65 20 6f 6e 6c 79 20 74 68 65 20 22 67 61 77  ve only the "gaw
0770: 6b 22 2e 0a 23 20 20 20 20 20 41 74 20 73 6f 6d  k"..#     At som
0780: 65 20 70 6f 69 6e 74 20 6d 6f 73 74 20 6f 66 20  e point most of 
0790: 74 68 69 73 20 73 63 72 69 70 74 20 6d 75 73 74  this script must
07a0: 20 62 65 20 72 65 2d 77 72 69 74 74 65 6e 2c 20   be re-written, 
07b0: 72 65 69 6d 70 6c 65 6d 65 6e 74 65 64 2c 20 0a  reimplemented, .
07c0: 23 20 20 20 20 20 69 6e 20 73 6f 6d 65 74 68 69  #     in somethi
07d0: 6e 67 20 6d 6f 72 65 20 61 64 76 61 6e 63 65 64  ng more advanced
07e0: 20 74 68 61 6e 20 42 61 73 68 2e 20 4d 6f 73 74   than Bash. Most
07f0: 20 6c 69 6b 65 6c 79 20 52 75 62 79 2e 20 0a 23   likely Ruby. .#
0800: 0a 23 20 20 20 20 20 54 68 65 20 6e 65 65 64 20  .#     The need 
0810: 66 6f 72 20 74 68 65 20 72 65 77 72 69 74 65 20  for the rewrite 
0820: 63 6f 6d 65 73 20 6d 61 69 6e 6c 79 20 66 72 6f  comes mainly fro
0830: 6d 20 74 68 65 20 66 61 63 74 20 74 68 61 74 20  m the fact that 
0840: 0a 23 20 20 20 20 20 74 68 65 20 70 61 73 73 69  .#     the passi
0850: 6e 67 20 6f 66 20 73 74 72 69 6e 67 20 76 61 6c  ng of string val
0860: 75 65 73 20 61 73 20 63 6f 6e 73 6f 6c 65 20 70  ues as console p
0870: 61 72 61 6d 65 74 65 72 73 20 0a 23 20 20 20 20  arameters .#    
0880: 20 72 75 6e 73 20 69 6e 74 6f 20 74 68 65 20 63   runs into the c
0890: 6c 61 73 73 69 63 61 6c 20 6d 61 63 72 6f 20 70  lassical macro p
08a0: 72 6f 63 65 73 73 69 6e 67 20 72 65 6c 61 74 65  rocessing relate
08b0: 64 20 70 72 6f 62 6c 65 6d 73 2e 20 0a 23 20 20  d problems. .#  
08c0: 20 20 20 54 68 65 20 73 6c 6f 77 6e 65 73 73 20     The slowness 
08d0: 69 6e 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 70  in the name of p
08e0: 6f 72 74 61 62 69 6c 69 74 79 20 61 6e 64 20 63  ortability and c
08f0: 6f 72 72 65 63 74 6e 65 73 73 20 0a 23 20 20 20  orrectness .#   
0900: 20 20 6f 66 20 74 68 69 73 2c 20 66 69 72 73 74    of this, first
0910: 2c 20 72 65 66 65 72 65 6e 63 65 20 69 6d 70 6c  , reference impl
0920: 65 6d 65 6e 74 61 74 69 6f 6e 2c 20 0a 23 20 20  ementation, .#  
0930: 20 20 20 63 61 6e 20 62 65 20 74 6f 6c 65 72 61     can be tolera
0940: 74 65 64 20 66 6f 72 20 61 20 77 68 69 6c 65 2e  ted for a while.
0950: 20 54 68 65 20 72 65 61 73 6f 6e 2c 20 77 68 79   The reason, why
0960: 20 74 68 69 73 20 73 63 72 69 70 74 20 68 61 73   this script has
0970: 20 62 65 65 6e 0a 23 20 20 20 20 20 77 72 69 74   been.#     writ
0980: 74 65 6e 20 69 6e 20 42 61 73 68 20 61 74 20 66  ten in Bash at f
0990: 69 72 73 74 20 70 6c 61 63 65 20 69 73 20 74 68  irst place is th
09a0: 61 74 20 61 74 20 66 69 72 73 74 20 74 68 65 20  at at first the 
09b0: 67 6f 61 6c 20 77 61 73 20 74 6f 20 0a 23 20 20  goal was to .#  
09c0: 20 20 20 74 72 79 20 74 6f 20 63 72 65 61 74 65     try to create
09d0: 20 73 6f 6d 65 74 68 69 6e 67 20 76 65 72 79 20   something very 
09e0: 22 73 69 6d 70 6c 65 22 2c 20 73 6f 6d 65 74 68  "simple", someth
09f0: 69 6e 67 20 74 68 61 74 0a 23 20 20 20 20 20 64  ing that.#     d
0a00: 65 70 65 6e 64 73 20 6f 6e 6c 79 20 6f 6e 20 70  epends only on p
0a10: 72 6f 67 72 61 6d 73 20 74 68 61 74 20 61 72 65  rograms that are
0a20: 20 76 65 72 79 20 6c 69 6b 65 6c 79 20 61 76 61   very likely ava
0a30: 69 6c 61 62 6c 65 0a 23 20 20 20 20 20 6f 6e 20  ilable.#     on 
0a40: 50 41 54 48 2c 20 62 75 74 20 61 73 20 69 74 20  PATH, but as it 
0a50: 74 75 72 6e 73 20 6f 75 74 2c 20 74 68 65 20 76  turns out, the v
0a60: 61 72 69 6f 75 73 20 74 65 73 74 73 20 61 6e 64  arious tests and
0a70: 20 0a 23 20 20 20 20 20 73 74 72 69 6e 67 20 70   .#     string p
0a80: 72 6f 63 65 73 73 69 6e 67 20 61 6e 64 20 6f 74  rocessing and ot
0a90: 68 65 72 20 6f 70 65 72 61 74 69 6f 6e 73 20 72  her operations r
0aa0: 65 71 75 69 72 65 20 0a 23 20 20 20 20 20 71 75  equire .#     qu
0ab0: 69 74 65 20 61 20 6c 6f 74 20 6f 66 20 6d 6f 72  ite a lot of mor
0ac0: 65 20 61 64 76 61 6e 63 65 64 20 74 6f 6f 6c 73  e advanced tools
0ad0: 20 74 68 61 6e 20 74 68 65 20 42 61 73 68 20 69   than the Bash i
0ae0: 73 2c 20 73 6f 0a 23 20 20 20 20 20 74 68 65 20  s, so.#     the 
0af0: 73 69 6d 70 6c 69 63 69 74 79 20 61 6e 64 20 73  simplicity and s
0b00: 68 6f 72 74 20 73 74 61 72 74 2d 75 70 20 74 69  hort start-up ti
0b10: 6d 65 20 68 61 73 20 62 65 65 6e 20 74 6f 74 61  me has been tota
0b20: 6c 6c 79 0a 23 20 20 20 20 20 6c 6f 73 74 20 61  lly.#     lost a
0b30: 6e 64 20 74 68 65 20 63 75 72 72 65 6e 74 20 73  nd the current s
0b40: 63 72 69 70 74 20 62 65 61 72 73 20 61 20 68 65  cript bears a he
0b50: 61 76 79 20 70 65 6e 61 6c 74 79 20 66 72 6f 6d  avy penalty from
0b60: 20 0a 23 20 20 20 20 20 74 68 65 20 72 65 6c 61   .#     the rela
0b70: 74 69 76 65 6c 79 20 68 75 67 65 20 6e 75 6d 62  tively huge numb
0b80: 65 72 20 6f 66 20 6f 70 65 72 61 74 69 6e 67 20  er of operating 
0b90: 73 79 73 74 65 6d 20 70 72 6f 63 65 73 73 20 73  system process s
0ba0: 74 61 72 74 2d 75 70 73 2c 0a 23 20 20 20 20 20  tart-ups,.#     
0bb0: 69 6e 63 6c 75 64 69 6e 67 20 74 68 65 20 72 65  including the re
0bc0: 6c 61 74 69 76 65 6c 79 20 68 75 67 65 20 6e 75  latively huge nu
0bd0: 6d 62 65 72 20 6f 66 20 69 6e 69 74 69 61 6c 69  mber of initiali
0be0: 7a 61 74 69 6f 6e 73 20 6f 66 0a 23 20 20 20 20  zations of.#    
0bf0: 20 74 68 65 20 52 75 62 79 20 69 6e 74 65 72 70   the Ruby interp
0c00: 72 65 74 65 72 2e 20 20 20 0a 23 0a 23 20 20 20  reter.   .#.#   
0c10: 20 20 54 68 65 20 6c 65 73 73 6f 6e 20 74 6f 20    The lesson to 
0c20: 62 65 20 6c 65 61 72 6e 74 20 66 72 6f 6d 20 74  be learnt from t
0c30: 68 69 73 20 63 61 73 65 20 69 73 20 74 68 61 74  his case is that
0c40: 20 0a 23 20 20 20 20 20 62 65 63 61 75 73 65 20   .#     because 
0c50: 70 72 6f 6a 65 63 74 73 20 67 65 74 20 66 61 72  projects get far
0c60: 20 6d 6f 72 65 20 63 6f 6d 70 6c 65 78 20 74 68   more complex th
0c70: 61 6e 20 0a 23 20 20 20 20 20 69 6e 69 74 69 61  an .#     initia
0c80: 6c 6c 79 20 61 6e 74 69 63 69 70 61 74 65 64 2c  lly anticipated,
0c90: 20 6d 6f 72 65 20 61 64 76 61 6e 63 65 64 20 70   more advanced p
0ca0: 72 6f 67 72 61 6d 6d 69 6e 67 20 6c 61 6e 67 75  rogramming langu
0cb0: 61 67 65 73 20 0a 23 20 20 20 20 20 73 68 6f 75  ages .#     shou
0cc0: 6c 64 20 62 65 20 70 72 65 66 65 72 72 65 64 20  ld be preferred 
0cd0: 74 6f 20 6c 65 73 73 20 61 64 76 61 6e 63 65 64  to less advanced
0ce0: 20 70 72 6f 67 72 61 6d 6d 69 6e 67 20 6c 61 6e   programming lan
0cf0: 67 75 61 67 65 73 20 0a 23 20 20 20 20 20 66 72  guages .#     fr
0d00: 6f 6d 20 74 68 65 20 76 65 72 79 20 73 74 61 72  om the very star
0d10: 74 20 6f 66 20 74 68 65 20 70 72 6f 6a 65 63 74  t of the project
0d20: 2e 20 54 68 65 20 63 75 72 72 65 6e 74 20 63 61  . The current ca
0d30: 73 65 20 68 65 72 65 0a 23 20 20 20 20 20 73 65  se here.#     se
0d40: 65 6d 73 20 74 6f 20 62 65 20 61 20 6d 6f 72 65  ems to be a more
0d50: 20 68 69 67 68 20 6c 65 76 65 6c 20 76 65 72 73   high level vers
0d60: 69 6f 6e 20 6f 66 20 74 68 65 20 6d 69 63 72 6f  ion of the micro
0d70: 63 6f 6e 74 72 6f 6c 6c 65 72 20 70 72 6f 6a 65  controller proje
0d80: 63 74 73 27 0a 23 20 20 20 20 20 61 73 73 65 6d  cts'.#     assem
0d90: 62 6c 65 72 20 76 65 72 73 75 73 20 43 20 64 69  bler versus C di
0da0: 6c 65 6d 6d 61 2e 0a 23 0a 23 0a 23 3d 3d 3d 3d  lemma..#.#.#====
0db0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0dc0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0dd0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0de0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0df0: 3d 3d 3d 3d 3d 3d 0a 53 5f 46 50 5f 44 49 52 3d  ======.S_FP_DIR=
0e00: 22 24 28 20 63 64 20 22 24 28 20 64 69 72 6e 61  "$( cd "$( dirna
0e10: 6d 65 20 22 24 7b 42 41 53 48 5f 53 4f 55 52 43  me "${BASH_SOURC
0e20: 45 5b 30 5d 7d 22 20 29 22 20 26 26 20 70 77 64  E[0]}" )" && pwd
0e30: 20 29 22 0a 53 5f 46 50 5f 4f 52 49 47 3d 22 60   )".S_FP_ORIG="`
0e40: 70 77 64 60 22 0a 53 5f 54 49 4d 45 53 54 41 4d  pwd`".S_TIMESTAM
0e50: 50 3d 22 60 64 61 74 65 20 2b 25 59 60 5f 60 64  P="`date +%Y`_`d
0e60: 61 74 65 20 2b 25 6d 60 5f 60 64 61 74 65 20 2b  ate +%m`_`date +
0e70: 25 64 60 5f 54 5f 60 64 61 74 65 20 2b 25 48 60  %d`_T_`date +%H`
0e80: 68 5f 60 64 61 74 65 20 2b 25 4d 60 6d 69 6e 5f  h_`date +%M`min_
0e90: 60 64 61 74 65 20 2b 25 53 60 73 22 0a 0a 23 2d  `date +%S`s"..#-
0ea0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0eb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0ec0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0ed0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0ee0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 65 6d 69  ---------.# Semi
0ef0: 2d 61 75 74 6f 2d 73 74 61 6d 70 73 3a 0a 0a 23  -auto-stamps:..#
0f00: 20 52 45 4e 45 53 53 41 41 54 4f 52 5f 42 4c 4f   RENESSAATOR_BLO
0f10: 43 4b 5f 53 54 41 52 54 0a 23 20 52 45 4e 45 53  CK_START.# RENES
0f20: 53 41 41 54 4f 52 5f 42 4c 4f 43 4b 5f 49 44 3d  SAATOR_BLOCK_ID=
0f30: 62 6c 6f 63 6b 5f 31 35 64 38 63 33 33 35 2d 62  block_15d8c335-b
0f40: 31 37 37 2d 34 38 64 30 2d 61 33 64 36 2d 31 32  177-48d0-a3d6-12
0f50: 64 32 36 31 63 30 33 31 65 37 0a 23 20 52 45 4e  d261c031e7.# REN
0f60: 45 53 53 41 41 54 4f 52 5f 53 4f 55 52 43 45 5f  ESSAATOR_SOURCE_
0f70: 4c 41 4e 47 55 41 47 45 3d 52 75 62 79 0a 23 20  LANGUAGE=Ruby.# 
0f80: 52 45 4e 45 53 53 41 41 54 4f 52 5f 53 4f 55 52  RENESSAATOR_SOUR
0f90: 43 45 5f 53 54 41 52 54 0a 23 20 23 2d 2d 2d 2d  CE_START.# #----
0fa0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0fb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0fc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0fd0: 2d 2d 2d 2d 2d 2d 0a 23 20 66 75 6e 63 5f 74 68  ------.# func_th
0fe0: 72 6f 77 5f 74 31 3d 6c 61 6d 62 64 61 20 64 6f  row_t1=lambda do
0ff0: 20 7c 73 5f 69 6e 2c 73 5f 67 75 69 64 5f 30 7c   |s_in,s_guid_0|
1000: 0a 23 20 73 5f 67 75 69 64 5f 31 3d 22 30 31 64  .# s_guid_1="01d
1010: 61 38 37 31 38 2d 64 65 39 37 2d 34 34 63 65 2d  a8718-de97-44ce-
1020: 61 31 30 31 2d 32 31 62 31 37 30 65 30 33 31 65  a101-21b170e031e
1030: 37 22 0a 23 20 70 75 74 73 28 22 5c 6e 22 29 0a  7".# puts("\n").
1040: 23 20 70 75 74 73 28 22 65 63 68 6f 20 5c 22 5c  # puts("echo \"\
1050: 22 22 29 0a 23 20 70 75 74 73 28 22 65 63 68 6f  "").# puts("echo
1060: 20 5c 22 43 6f 64 65 20 67 65 6e 65 72 61 74 69   \"Code generati
1070: 6f 6e 20 73 63 72 69 70 74 20 66 61 69 6c 65 64  on script failed
1080: 2e 5c 22 20 5c 6e 22 29 0a 23 20 70 75 74 73 28  .\" \n").# puts(
1090: 22 65 63 68 6f 20 5c 22 47 55 49 44 3d 3d 27 22  "echo \"GUID=='"
10a0: 2b 73 5f 67 75 69 64 5f 31 2b 22 27 5c 22 3b 20  +s_guid_1+"'\"; 
10b0: 20 5c 6e 22 29 0a 23 20 70 75 74 73 28 22 65 63   \n").# puts("ec
10c0: 68 6f 20 5c 22 47 55 49 44 3d 3d 27 22 2b 73 5f  ho \"GUID=='"+s_
10d0: 67 75 69 64 5f 30 2b 22 27 5c 22 3b 20 20 5c 6e  guid_0+"'\";  \n
10e0: 22 29 0a 23 20 70 75 74 73 28 22 65 63 68 6f 20  ").# puts("echo 
10f0: 5c 22 5c 22 22 29 0a 23 20 70 75 74 73 28 22 65  \"\"").# puts("e
1100: 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
1110: 68 20 65 72 72 6f 72 20 5c 6e 22 29 0a 23 20 72  h error \n").# r
1120: 61 69 73 65 28 45 78 63 65 70 74 69 6f 6e 2e 6e  aise(Exception.n
1130: 65 77 28 22 5c 6e 5c 6e 20 73 5f 69 6e 3d 3d 22  ew("\n\n s_in=="
1140: 2b 73 5f 69 6e 2b 22 5c 6e 20 47 55 49 44 3d 3d  +s_in+"\n GUID==
1150: 22 2b 73 5f 67 75 69 64 5f 30 2b 22 5c 6e 5c 6e  "+s_guid_0+"\n\n
1160: 22 29 29 0a 23 20 65 6e 64 20 23 20 66 75 6e 63  ")).# end # func
1170: 5f 74 68 72 6f 77 5f 74 31 0a 23 20 23 2d 2d 2d  _throw_t1.# #---
1180: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 23 20  -----------.# # 
1190: 54 68 65 20 70 72 6f 62 6c 65 6d 20 69 73 20 74  The problem is t
11a0: 68 61 74 20 6e 65 69 74 68 65 72 20 74 68 65 20  hat neither the 
11b0: 22 75 75 69 64 22 2c 20 6e 6f 72 20 74 68 65 20  "uuid", nor the 
11c0: 22 75 75 69 64 67 65 6e 22 0a 23 20 23 20 6d 69  "uuidgen".# # mi
11d0: 67 68 74 20 62 65 20 61 76 61 69 6c 61 62 6c 65  ght be available
11e0: 20 6f 6e 20 74 68 65 20 50 41 54 48 2e 20 54 68   on the PATH. Th
11f0: 65 20 63 72 65 61 74 69 6f 6e 20 6f 66 20 74 68  e creation of th
1200: 65 20 69 6e 69 74 61 6c 20 76 61 6c 75 65 20 6f  e inital value o
1210: 66 20 74 68 65 0a 23 20 23 20 73 5f 30 20 68 61  f the.# # s_0 ha
1220: 73 20 62 65 65 6e 20 74 65 73 74 65 64 20 6f 6e  s been tested on
1230: 20 62 6f 74 68 2c 20 4c 69 6e 75 78 20 61 6e 64   both, Linux and
1240: 20 42 53 44 2c 20 62 75 74 20 6e 6f 74 20 77 69   BSD, but not wi
1250: 74 68 20 61 6c 6c 20 73 68 65 6c 6c 73 2e 0a 23  th all shells..#
1260: 20 73 5f 30 3d 28 60 77 68 69 63 68 20 75 75 69   s_0=(`which uui
1270: 64 67 65 6e 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  dgen 2>/dev/null
1280: 20 31 3e 2f 64 65 76 2f 6e 75 6c 6c 3b 20 65 63   1>/dev/null; ec
1290: 68 6f 20 24 3f 60 29 2e 74 6f 5f 73 0a 23 20 73  ho $?`).to_s.# s
12a0: 5f 30 3d 73 5f 30 2e 67 73 75 62 28 2f 5b 5c 6e  _0=s_0.gsub(/[\n
12b0: 5c 73 5c 72 5d 2f 2c 22 22 29 0a 23 20 73 5f 67  \s\r]/,"").# s_g
12c0: 75 69 64 5f 67 65 6e 65 72 61 74 69 6f 6e 5f 70  uid_generation_p
12d0: 72 6f 67 72 61 6d 5f 6e 61 6d 65 3d 22 23 6e 6f  rogram_name="#no
12e0: 74 5f 79 65 74 5f 73 65 74 22 0a 23 20 23 2d 2d  t_yet_set".# #--
12f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 66  ------------.# f
1300: 75 6e 63 5f 61 73 73 65 72 74 5f 73 5f 30 5f 66  unc_assert_s_0_f
1310: 6f 72 6d 61 74 5f 74 31 3d 6c 61 6d 62 64 61 20  ormat_t1=lambda 
1320: 64 6f 20 7c 73 5f 69 6e 7c 0a 23 20 69 66 20 28  do |s_in|.# if (
1330: 73 5f 69 6e 21 3d 22 30 22 29 26 26 28 73 5f 69  s_in!="0")&&(s_i
1340: 6e 21 3d 22 31 22 29 0a 23 20 73 5f 67 75 69 64  n!="1").# s_guid
1350: 5f 30 3d 22 62 34 39 34 37 63 38 35 2d 33 31 34  _0="b4947c85-314
1360: 38 2d 34 66 30 64 2d 62 31 30 31 2d 32 31 62 31  8-4f0d-b101-21b1
1370: 37 30 65 30 33 31 65 37 22 0a 23 20 66 75 6e 63  70e031e7".# func
1380: 5f 74 68 72 6f 77 5f 74 31 2e 63 61 6c 6c 28 73  _throw_t1.call(s
1390: 5f 69 6e 2c 73 5f 67 75 69 64 5f 30 29 0a 23 20  _in,s_guid_0).# 
13a0: 65 6e 64 20 23 20 69 66 0a 23 20 65 6e 64 20 23  end # if.# end #
13b0: 20 66 75 6e 63 5f 61 73 73 65 72 74 5f 73 5f 30   func_assert_s_0
13c0: 5f 66 6f 72 6d 61 74 5f 74 31 0a 23 20 23 2d 2d  _format_t1.# #--
13d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 66  ------------.# f
13e0: 75 6e 63 5f 61 73 73 65 72 74 5f 73 5f 30 5f 66  unc_assert_s_0_f
13f0: 6f 72 6d 61 74 5f 74 31 2e 63 61 6c 6c 28 73 5f  ormat_t1.call(s_
1400: 30 29 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  0).# #----------
1410: 2d 2d 2d 2d 0a 23 20 69 66 20 73 5f 30 3d 3d 22  ----.# if s_0=="
1420: 30 22 0a 23 20 73 5f 67 75 69 64 5f 67 65 6e 65  0".# s_guid_gene
1430: 72 61 74 69 6f 6e 5f 70 72 6f 67 72 61 6d 5f 6e  ration_program_n
1440: 61 6d 65 3d 22 75 75 69 64 67 65 6e 22 0a 23 20  ame="uuidgen".# 
1450: 23 2d 2d 2d 2d 0a 23 20 65 6c 73 65 0a 23 20 23  #----.# else.# #
1460: 2d 2d 2d 2d 0a 23 20 73 5f 30 3d 28 60 77 68 69  ----.# s_0=(`whi
1470: 63 68 20 75 75 69 64 20 32 3e 2f 64 65 76 2f 6e  ch uuid 2>/dev/n
1480: 75 6c 6c 20 31 3e 2f 64 65 76 2f 6e 75 6c 6c 3b  ull 1>/dev/null;
1490: 20 65 63 68 6f 20 24 3f 60 29 2e 74 6f 5f 73 0a   echo $?`).to_s.
14a0: 23 20 73 5f 30 3d 73 5f 30 2e 67 73 75 62 28 2f  # s_0=s_0.gsub(/
14b0: 5b 5c 6e 5c 73 5c 72 5d 2f 2c 22 22 29 0a 23 20  [\n\s\r]/,"").# 
14c0: 66 75 6e 63 5f 61 73 73 65 72 74 5f 73 5f 30 5f  func_assert_s_0_
14d0: 66 6f 72 6d 61 74 5f 74 31 2e 63 61 6c 6c 28 73  format_t1.call(s
14e0: 5f 30 29 0a 23 20 69 66 20 73 5f 30 3d 3d 22 30  _0).# if s_0=="0
14f0: 22 0a 23 20 73 5f 67 75 69 64 5f 67 65 6e 65 72  ".# s_guid_gener
1500: 61 74 69 6f 6e 5f 70 72 6f 67 72 61 6d 5f 6e 61  ation_program_na
1510: 6d 65 3d 22 75 75 69 64 22 0a 23 20 65 6c 73 65  me="uuid".# else
1520: 0a 23 20 73 5f 67 75 69 64 5f 32 3d 22 32 66 37  .# s_guid_2="2f7
1530: 37 31 30 33 37 2d 39 39 34 39 2d 34 30 35 62 2d  71037-9949-405b-
1540: 39 33 30 31 2d 32 31 62 31 37 30 65 30 33 31 65  9301-21b170e031e
1550: 37 22 0a 23 20 66 75 6e 63 5f 74 68 72 6f 77 5f  7".# func_throw_
1560: 74 31 2e 63 61 6c 6c 28 73 5f 30 2c 73 5f 67 75  t1.call(s_0,s_gu
1570: 69 64 5f 32 29 0a 23 20 65 6e 64 20 23 20 69 66  id_2).# end # if
1580: 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .# #------------
1590: 2d 0a 23 20 65 6e 64 20 23 20 69 66 0a 23 20 23  -.# end # if.# #
15a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
15b0: 20 23 20 41 20 74 65 73 74 20 74 6f 20 66 69 6e   # A test to fin
15c0: 64 20 6f 75 74 2c 20 77 68 65 74 68 65 72 20 74  d out, whether t
15d0: 68 65 20 47 55 49 44 20 67 65 6e 65 72 61 74 69  he GUID generati
15e0: 6f 6e 20 70 72 6f 67 72 61 6d 0a 23 20 23 20 6f  on program.# # o
15f0: 6e 20 74 68 65 20 50 41 54 48 20 65 78 69 74 73  n the PATH exits
1600: 20 77 69 74 68 20 61 6e 20 65 72 72 6f 72 20 63   with an error c
1610: 6f 64 65 20 30 2e 0a 23 20 73 5f 72 75 62 79 3d  ode 0..# s_ruby=
1620: 22 73 5f 30 3d 28 60 22 2b 73 5f 67 75 69 64 5f  "s_0=(`"+s_guid_
1630: 67 65 6e 65 72 61 74 69 6f 6e 5f 70 72 6f 67 72  generation_progr
1640: 61 6d 5f 6e 61 6d 65 2b 22 20 32 3e 2f 64 65 76  am_name+" 2>/dev
1650: 2f 6e 75 6c 6c 20 31 3e 2f 64 65 76 2f 6e 75 6c  /null 1>/dev/nul
1660: 6c 3b 20 65 63 68 6f 20 24 3f 60 29 2e 74 6f 5f  l; echo $?`).to_
1670: 73 22 0a 23 20 65 76 61 6c 28 73 5f 72 75 62 79  s".# eval(s_ruby
1680: 29 0a 23 20 73 5f 30 3d 73 5f 30 2e 67 73 75 62  ).# s_0=s_0.gsub
1690: 28 2f 5b 5c 6e 5c 73 5c 72 5d 2f 2c 22 22 29 0a  (/[\n\s\r]/,"").
16a0: 23 20 66 75 6e 63 5f 61 73 73 65 72 74 5f 73 5f  # func_assert_s_
16b0: 30 5f 66 6f 72 6d 61 74 5f 74 31 2e 63 61 6c 6c  0_format_t1.call
16c0: 28 73 5f 30 29 0a 23 20 69 66 20 73 5f 30 21 3d  (s_0).# if s_0!=
16d0: 22 30 22 0a 23 20 73 5f 67 75 69 64 5f 33 3d 22  "0".# s_guid_3="
16e0: 33 35 35 38 37 39 34 34 2d 31 63 37 66 2d 34 65  35587944-1c7f-4e
16f0: 39 66 2d 62 35 30 31 2d 32 31 62 31 37 30 65 30  9f-b501-21b170e0
1700: 33 31 65 37 22 0a 23 20 66 75 6e 63 5f 74 68 72  31e7".# func_thr
1710: 6f 77 5f 74 31 2e 63 61 6c 6c 28 73 5f 30 2c 73  ow_t1.call(s_0,s
1720: 5f 67 75 69 64 5f 33 29 0a 23 20 65 6e 64 20 23  _guid_3).# end #
1730: 20 69 66 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d   if.# #---------
1740: 2d 2d 2d 2d 2d 0a 23 20 73 5f 72 75 62 79 3d 22  -----.# s_ruby="
1750: 73 5f 30 3d 28 60 22 2b 73 5f 67 75 69 64 5f 67  s_0=(`"+s_guid_g
1760: 65 6e 65 72 61 74 69 6f 6e 5f 70 72 6f 67 72 61  eneration_progra
1770: 6d 5f 6e 61 6d 65 2b 22 20 32 3e 2f 64 65 76 2f  m_name+" 2>/dev/
1780: 6e 75 6c 6c 60 29 2e 74 6f 5f 73 22 0a 23 20 65  null`).to_s".# e
1790: 76 61 6c 28 73 5f 72 75 62 79 29 0a 23 20 73 5f  val(s_ruby).# s_
17a0: 30 3d 73 5f 30 2e 67 73 75 62 28 2f 5b 5c 6e 5c  0=s_0.gsub(/[\n\
17b0: 73 5c 72 5d 2f 2c 22 22 29 0a 23 20 73 5f 73 63  s\r]/,"").# s_sc
17c0: 72 69 70 74 5f 76 65 72 73 69 6f 6e 3d 73 5f 30  ript_version=s_0
17d0: 0a 23 20 23 2d 2d 2d 2d 0a 23 20 69 66 20 73 5f  .# #----.# if s_
17e0: 73 63 72 69 70 74 5f 76 65 72 73 69 6f 6e 2e 6c  script_version.l
17f0: 65 6e 67 74 68 21 3d 33 36 0a 23 20 73 5f 67 75  ength!=36.# s_gu
1800: 69 64 5f 34 3d 22 30 31 38 39 35 39 34 31 2d 66  id_4="01895941-f
1810: 62 37 38 2d 34 39 36 30 2d 38 34 30 31 2d 32 31  b78-4960-8401-21
1820: 62 31 37 30 65 30 33 31 65 37 22 0a 23 20 66 75  b170e031e7".# fu
1830: 6e 63 5f 74 68 72 6f 77 5f 74 31 2e 63 61 6c 6c  nc_throw_t1.call
1840: 28 73 5f 73 63 72 69 70 74 5f 76 65 72 73 69 6f  (s_script_versio
1850: 6e 2c 73 5f 67 75 69 64 5f 34 29 0a 23 20 65 6e  n,s_guid_4).# en
1860: 64 20 23 20 69 66 0a 23 20 23 2d 2d 2d 2d 2d 2d  d # if.# #------
1870: 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 73 3d 22 5c 6e  --------.# s="\n
1880: 22 0a 23 20 73 3c 3c 22 23 20 54 68 65 20 53 5f  ".# s<<"# The S_
1890: 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 20 69  SCRIPT_VERSION i
18a0: 73 20 69 6e 20 32 20 70 61 72 74 73 20 74 6f 20  s in 2 parts to 
18b0: 61 6c 6c 6f 77 20 5c 6e 22 0a 23 20 73 3c 3c 22  allow \n".# s<<"
18c0: 23 20 74 68 65 20 65 72 72 6f 72 20 6d 65 73 73  # the error mess
18d0: 61 67 65 20 47 55 49 44 73 20 74 6f 20 62 65 20  age GUIDs to be 
18e0: 75 70 64 61 74 65 64 20 77 69 74 68 6f 75 74 20  updated without 
18f0: 5c 6e 22 0a 23 20 73 3c 3c 22 23 20 75 6e 73 79  \n".# s<<"# unsy
1900: 6e 63 69 6e 67 20 74 68 65 20 53 5f 53 43 52 49  ncing the S_SCRI
1910: 50 54 5f 56 45 52 53 49 4f 4e 20 66 72 6f 6d 20  PT_VERSION from 
1920: 74 68 65 20 5c 6e 22 0a 23 20 73 3c 3c 22 23 20  the \n".# s<<"# 
1930: 53 5f 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e  S_SCRIPT_VERSION
1940: 5f 47 45 4e 45 52 41 54 49 4f 4e 5f 44 41 54 45  _GENERATION_DATE
1950: 2e 5c 6e 22 0a 23 20 69 5f 30 3d 31 32 0a 23 20  .\n".# i_0=12.# 
1960: 73 3c 3c 22 53 5f 53 43 52 49 50 54 5f 56 45 52  s<<"S_SCRIPT_VER
1970: 53 49 4f 4e 5f 53 55 42 50 41 52 54 5f 31 3d 5c  SION_SUBPART_1=\
1980: 22 22 2b 73 5f 73 63 72 69 70 74 5f 76 65 72 73  ""+s_script_vers
1990: 69 6f 6e 5b 30 2e 2e 69 5f 30 5d 2b 22 5c 22 5c  ion[0..i_0]+"\"\
19a0: 6e 22 0a 23 20 73 3c 3c 22 53 5f 53 43 52 49 50  n".# s<<"S_SCRIP
19b0: 54 5f 56 45 52 53 49 4f 4e 5f 53 55 42 50 41 52  T_VERSION_SUBPAR
19c0: 54 5f 32 3d 5c 22 22 2b 73 5f 73 63 72 69 70 74  T_2=\""+s_script
19d0: 5f 76 65 72 73 69 6f 6e 5b 28 69 5f 30 2b 31 29  _version[(i_0+1)
19e0: 2e 2e 28 2d 31 29 5d 2b 22 5c 22 5c 6e 22 0a 23  ..(-1)]+"\"\n".#
19f0: 20 73 3c 3c 22 53 5f 53 43 52 49 50 54 5f 56 45   s<<"S_SCRIPT_VE
1a00: 52 53 49 4f 4e 3d 5c 22 24 53 5f 53 43 52 49 50  RSION=\"$S_SCRIP
1a10: 54 5f 56 45 52 53 49 4f 4e 5f 53 55 42 50 41 52  T_VERSION_SUBPAR
1a20: 54 5f 31 24 53 5f 53 43 52 49 50 54 5f 56 45 52  T_1$S_SCRIPT_VER
1a30: 53 49 4f 4e 5f 53 55 42 50 41 52 54 5f 32 5c 22  SION_SUBPART_2\"
1a40: 22 0a 23 20 70 75 74 73 28 73 29 0a 23 20 23 2d  ".# puts(s).# #-
1a50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 6f 62 5f 64  ---------.# ob_d
1a90: 61 74 65 3d 54 69 6d 65 2e 6e 65 77 0a 23 20 73  ate=Time.new.# s
1aa0: 3d 22 22 0a 23 20 73 3c 3c 22 5c 6e 53 5f 53 43  ="".# s<<"\nS_SC
1ab0: 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f 47 45 4e  RIPT_VERSION_GEN
1ac0: 45 52 41 54 49 4f 4e 5f 44 41 54 45 3d 5c 22 22  ERATION_DATE=\""
1ad0: 0a 23 20 73 3c 3c 28 6f 62 5f 64 61 74 65 2e 79  .# s<<(ob_date.y
1ae0: 65 61 72 2e 74 6f 5f 73 2b 22 79 5f 22 29 0a 23  ear.to_s+"y_").#
1af0: 20 73 3c 3c 28 6f 62 5f 64 61 74 65 2e 6d 6f 6e   s<<(ob_date.mon
1b00: 74 68 2e 74 6f 5f 73 2b 22 6d 6f 6e 74 68 5f 22  th.to_s+"month_"
1b10: 29 0a 23 20 73 3c 3c 28 6f 62 5f 64 61 74 65 2e  ).# s<<(ob_date.
1b20: 64 61 79 2e 74 6f 5f 73 2b 22 64 61 79 5f 22 29  day.to_s+"day_")
1b30: 0a 23 20 73 3c 3c 28 6f 62 5f 64 61 74 65 2e 68  .# s<<(ob_date.h
1b40: 6f 75 72 2e 74 6f 5f 73 2b 22 68 5f 22 29 0a 23  our.to_s+"h_").#
1b50: 20 73 3c 3c 28 6f 62 5f 64 61 74 65 2e 6d 69 6e   s<<(ob_date.min
1b60: 2e 74 6f 5f 73 2b 22 6d 69 6e 5f 22 29 0a 23 20  .to_s+"min_").# 
1b70: 73 3c 3c 28 6f 62 5f 64 61 74 65 2e 73 65 63 2e  s<<(ob_date.sec.
1b80: 74 6f 5f 73 2b 22 73 65 63 5f 22 29 0a 23 20 73  to_s+"sec_").# s
1b90: 3c 3c 28 6f 62 5f 64 61 74 65 2e 75 73 65 63 2e  <<(ob_date.usec.
1ba0: 74 6f 5f 73 2b 22 75 73 65 63 22 29 0a 23 20 73  to_s+"usec").# s
1bb0: 3c 3c 22 5c 22 5c 6e 22 0a 23 20 70 75 74 73 28  <<"\"\n".# puts(
1bc0: 73 29 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  s).# #----------
1bd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1be0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c00: 0a 23 20 52 45 4e 45 53 53 41 41 54 4f 52 5f 53  .# RENESSAATOR_S
1c10: 4f 55 52 43 45 5f 45 4e 44 0a 23 20 0a 23 20 52  OURCE_END.# .# R
1c20: 45 4e 45 53 53 41 41 54 4f 52 5f 41 55 54 4f 47  ENESSAATOR_AUTOG
1c30: 45 4e 45 52 41 54 45 44 5f 54 45 58 54 5f 53 54  ENERATED_TEXT_ST
1c40: 41 52 54 0a 0a 23 20 54 68 65 20 53 5f 53 43 52  ART..# The S_SCR
1c50: 49 50 54 5f 56 45 52 53 49 4f 4e 20 69 73 20 69  IPT_VERSION is i
1c60: 6e 20 32 20 70 61 72 74 73 20 74 6f 20 61 6c 6c  n 2 parts to all
1c70: 6f 77 20 0a 23 20 74 68 65 20 65 72 72 6f 72 20  ow .# the error 
1c80: 6d 65 73 73 61 67 65 20 47 55 49 44 73 20 74 6f  message GUIDs to
1c90: 20 62 65 20 75 70 64 61 74 65 64 20 77 69 74 68   be updated with
1ca0: 6f 75 74 20 0a 23 20 75 6e 73 79 6e 63 69 6e 67  out .# unsyncing
1cb0: 20 74 68 65 20 53 5f 53 43 52 49 50 54 5f 56 45   the S_SCRIPT_VE
1cc0: 52 53 49 4f 4e 20 66 72 6f 6d 20 74 68 65 20 0a  RSION from the .
1cd0: 23 20 53 5f 53 43 52 49 50 54 5f 56 45 52 53 49  # S_SCRIPT_VERSI
1ce0: 4f 4e 5f 47 45 4e 45 52 41 54 49 4f 4e 5f 44 41  ON_GENERATION_DA
1cf0: 54 45 2e 0a 53 5f 53 43 52 49 50 54 5f 56 45 52  TE..S_SCRIPT_VER
1d00: 53 49 4f 4e 5f 53 55 42 50 41 52 54 5f 31 3d 22  SION_SUBPART_1="
1d10: 32 33 37 35 64 62 35 36 2d 65 65 32 61 22 0a 53  2375db56-ee2a".S
1d20: 5f 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f  _SCRIPT_VERSION_
1d30: 53 55 42 50 41 52 54 5f 32 3d 22 2d 34 61 34 38  SUBPART_2="-4a48
1d40: 2d 61 64 39 31 2d 32 35 33 31 31 65 36 37 30 35  -ad91-25311e6705
1d50: 36 30 22 0a 53 5f 53 43 52 49 50 54 5f 56 45 52  60".S_SCRIPT_VER
1d60: 53 49 4f 4e 3d 22 24 53 5f 53 43 52 49 50 54 5f  SION="$S_SCRIPT_
1d70: 56 45 52 53 49 4f 4e 5f 53 55 42 50 41 52 54 5f  VERSION_SUBPART_
1d80: 31 24 53 5f 53 43 52 49 50 54 5f 56 45 52 53 49  1$S_SCRIPT_VERSI
1d90: 4f 4e 5f 53 55 42 50 41 52 54 5f 32 22 0a 0a 53  ON_SUBPART_2"..S
1da0: 5f 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f  _SCRIPT_VERSION_
1db0: 47 45 4e 45 52 41 54 49 4f 4e 5f 44 41 54 45 3d  GENERATION_DATE=
1dc0: 22 32 30 31 37 79 5f 33 6d 6f 6e 74 68 5f 31 34  "2017y_3month_14
1dd0: 64 61 79 5f 37 68 5f 32 37 6d 69 6e 5f 31 33 73  day_7h_27min_13s
1de0: 65 63 5f 36 37 32 38 36 39 75 73 65 63 22 0a 0a  ec_672869usec"..
1df0: 23 20 52 45 4e 45 53 53 41 41 54 4f 52 5f 41 55  # RENESSAATOR_AU
1e00: 54 4f 47 45 4e 45 52 41 54 45 44 5f 54 45 58 54  TOGENERATED_TEXT
1e10: 5f 45 4e 44 0a 23 20 52 45 4e 45 53 53 41 41 54  _END.# RENESSAAT
1e20: 4f 52 5f 42 4c 4f 43 4b 5f 45 4e 44 0a 0a 23 2d  OR_BLOCK_END..#-
1e30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63 5f  ---------..func_
1e80: 6d 6d 6d 76 5f 65 78 69 74 5f 69 66 5f 6e 6f 74  mmmv_exit_if_not
1e90: 5f 6f 6e 5f 70 61 74 68 5f 74 32 28 29 20 7b 20  _on_path_t2() { 
1ea0: 23 20 53 5f 43 4f 4d 4d 41 4e 44 5f 4e 41 4d 45  # S_COMMAND_NAME
1eb0: 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 43 4f 4d  .    local S_COM
1ec0: 4d 41 4e 44 5f 4e 41 4d 45 3d 24 31 0a 20 20 20  MAND_NAME=$1.   
1ed0: 20 6c 6f 63 61 6c 20 53 5f 4c 4f 43 41 4c 5f 56   local S_LOCAL_V
1ee0: 41 52 49 41 42 4c 45 3d 22 60 77 68 69 63 68 20  ARIABLE="`which 
1ef0: 24 53 5f 43 4f 4d 4d 41 4e 44 5f 4e 41 4d 45 20  $S_COMMAND_NAME 
1f00: 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 20 20  2>/dev/null`".  
1f10: 20 20 69 66 20 5b 20 22 24 53 5f 4c 4f 43 41 4c    if [ "$S_LOCAL
1f20: 5f 56 41 52 49 41 42 4c 45 22 20 3d 3d 20 22 22  _VARIABLE" == ""
1f30: 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1f40: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
1f50: 20 65 63 68 6f 20 22 43 6f 6d 6d 61 6e 64 20 5c   echo "Command \
1f60: 22 24 53 5f 43 4f 4d 4d 41 4e 44 5f 4e 41 4d 45  "$S_COMMAND_NAME
1f70: 5c 22 20 63 6f 75 6c 64 20 6e 6f 74 20 62 65 20  \" could not be 
1f80: 66 6f 75 6e 64 20 66 72 6f 6d 20 74 68 65 20 50  found from the P
1f90: 41 54 48 2e 20 22 0a 20 20 20 20 20 20 20 20 65  ATH. ".        e
1fa0: 63 68 6f 20 22 54 68 65 20 65 78 65 63 75 74 69  cho "The executi
1fb0: 6f 6e 20 6f 66 20 74 68 65 20 42 61 73 68 20 73  on of the Bash s
1fc0: 63 72 69 70 74 20 69 73 20 61 62 6f 72 74 65 64  cript is aborted
1fd0: 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
1fe0: 22 47 55 49 44 3d 3d 27 31 64 31 61 35 33 37 65  "GUID=='1d1a537e
1ff0: 2d 36 64 32 66 2d 34 31 37 30 2d 62 31 31 31 2d  -6d2f-4170-b111-
2000: 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20  21b170e031e7'". 
2010: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
2020: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
2030: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
2040: 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
2050: 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
2060: 72 6f 72 0a 20 20 20 20 66 69 0a 7d 20 23 20 66  ror.    fi.} # f
2070: 75 6e 63 5f 6d 6d 6d 76 5f 65 78 69 74 5f 69 66  unc_mmmv_exit_if
2080: 5f 6e 6f 74 5f 6f 6e 5f 70 61 74 68 5f 74 32 0a  _not_on_path_t2.
2090: 0a 0a 23 20 41 20 6c 69 73 74 20 6f 66 20 74 68  ..# A list of th
20a0: 65 20 63 6f 6e 73 6f 6c 65 20 74 6f 6f 6c 73 20  e console tools 
20b0: 74 68 61 74 20 74 68 65 20 72 65 73 74 20 6f 66  that the rest of
20c0: 20 74 68 65 20 0a 23 20 76 65 72 69 66 69 63 61   the .# verifica
20d0: 74 69 6f 6e 20 66 75 6e 63 74 69 6f 6e 73 20 69  tion functions i
20e0: 6e 20 74 68 69 73 20 42 61 73 68 20 73 63 72 69  n this Bash scri
20f0: 70 74 20 64 65 70 65 6e 64 20 6f 6e 2e 0a 23 20  pt depend on..# 
2100: 54 68 65 20 70 72 65 73 65 6e 63 65 20 6f 66 20  The presence of 
2110: 74 68 65 20 72 65 73 74 20 6f 66 20 74 68 65 20  the rest of the 
2120: 63 6f 6e 73 6f 6c 65 20 61 70 70 6c 69 63 61 74  console applicat
2130: 69 6f 6e 73 0a 23 20 61 72 65 20 73 74 75 64 69  ions.# are studi
2140: 65 64 20 62 79 20 74 68 65 20 6f 74 68 65 72 20  ed by the other 
2150: 76 65 72 69 66 69 63 61 74 69 6f 6e 20 66 75 6e  verification fun
2160: 63 74 69 6f 6e 73 2e 20 0a 0a 20 20 20 20 66 75  ctions. ..    fu
2170: 6e 63 5f 6d 6d 6d 76 5f 65 78 69 74 5f 69 66 5f  nc_mmmv_exit_if_
2180: 6e 6f 74 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22  not_on_path_t2 "
2190: 67 72 65 70 22 0a 20 20 20 20 66 75 6e 63 5f 6d  grep".    func_m
21a0: 6d 6d 76 5f 65 78 69 74 5f 69 66 5f 6e 6f 74 5f  mmv_exit_if_not_
21b0: 6f 6e 5f 70 61 74 68 5f 74 32 20 22 72 75 62 79  on_path_t2 "ruby
21c0: 22 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f  ".    func_mmmv_
21d0: 65 78 69 74 5f 69 66 5f 6e 6f 74 5f 6f 6e 5f 70  exit_if_not_on_p
21e0: 61 74 68 5f 74 32 20 22 75 6e 61 6d 65 22 0a 20  ath_t2 "uname". 
21f0: 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 65 78 69     func_mmmv_exi
2200: 74 5f 69 66 5f 6e 6f 74 5f 6f 6e 5f 70 61 74 68  t_if_not_on_path
2210: 5f 74 32 20 22 77 68 69 63 68 22 0a 0a 23 2d 2d  _t2 "which"..#--
2220: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2230: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2240: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2250: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2260: 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 23 20 53 42 5f 55  --------..# SB_U
2270: 53 45 5f 47 41 57 4b 5f 49 4e 5f 53 54 45 41 44  SE_GAWK_IN_STEAD
2280: 5f 4f 46 5f 41 57 4b 3d 22 6e 6f 74 5f 73 65 74  _OF_AWK="not_set
2290: 5f 79 65 74 22 0a 23 20 66 75 6e 63 5f 6d 6d 6d  _yet".# func_mmm
22a0: 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 69 6e  v_silktorrent_in
22b0: 69 74 5f 61 77 6b 5f 76 65 72 73 75 73 5f 67 61  it_awk_versus_ga
22c0: 77 6b 28 29 20 7b 20 0a 23 20 20 20 20 20 6c 6f  wk() { .#     lo
22d0: 63 61 6c 20 53 42 5f 41 57 4b 5f 41 4e 44 5f 47  cal SB_AWK_AND_G
22e0: 41 57 4b 5f 41 52 45 5f 42 4f 54 48 5f 55 4e 55  AWK_ARE_BOTH_UNU
22f0: 53 41 42 4c 45 3d 22 66 22 0a 23 20 20 20 20 20  SABLE="f".#     
2300: 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 20 20 20  #--------.#     
2310: 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 30 3d 22 60  local S_TMP_0="`
2320: 77 68 69 63 68 20 67 61 77 6b 20 32 3e 2f 64 65  which gawk 2>/de
2330: 76 2f 6e 75 6c 6c 60 22 0a 23 20 20 20 20 20 69  v/null`".#     i
2340: 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22 20 3d  f [ "$S_TMP_0" =
2350: 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 23 20 20  = "" ]; then.#  
2360: 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22         S_TMP_0="
2370: 60 77 68 69 63 68 20 61 77 6b 20 32 3e 2f 64 65  `which awk 2>/de
2380: 76 2f 6e 75 6c 6c 60 22 0a 23 20 20 20 20 20 20  v/null`".#      
2390: 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f     if [ "$S_TMP_
23a0: 30 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e  0" == "" ]; then
23b0: 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20 53  .#             S
23c0: 42 5f 41 57 4b 5f 41 4e 44 5f 47 41 57 4b 5f 41  B_AWK_AND_GAWK_A
23d0: 52 45 5f 42 4f 54 48 5f 55 4e 55 53 41 42 4c 45  RE_BOTH_UNUSABLE
23e0: 3d 22 74 22 0a 23 20 20 20 20 20 20 20 20 20 65  ="t".#         e
23f0: 6c 73 65 0a 23 20 20 20 20 20 20 20 20 20 20 20  lse.#           
2400: 20 20 53 42 5f 55 53 45 5f 47 41 57 4b 5f 49 4e    SB_USE_GAWK_IN
2410: 5f 53 54 45 41 44 5f 4f 46 5f 41 57 4b 3d 22 66  _STEAD_OF_AWK="f
2420: 22 0a 23 20 20 20 20 20 20 20 20 20 66 69 0a 23  ".#         fi.#
2430: 20 20 20 20 20 65 6c 73 65 0a 23 20 20 20 20 20       else.#     
2440: 20 20 20 20 53 42 5f 55 53 45 5f 47 41 57 4b 5f      SB_USE_GAWK_
2450: 49 4e 5f 53 54 45 41 44 5f 4f 46 5f 41 57 4b 3d  IN_STEAD_OF_AWK=
2460: 22 74 22 0a 23 20 20 20 20 20 66 69 0a 23 20 20  "t".#     fi.#  
2470: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20     #--------.#  
2480: 20 20 20 69 66 20 5b 20 22 24 53 42 5f 41 57 4b     if [ "$SB_AWK
2490: 5f 41 4e 44 5f 47 41 57 4b 5f 41 52 45 5f 42 4f  _AND_GAWK_ARE_BO
24a0: 54 48 5f 55 4e 55 53 41 42 4c 45 22 20 3d 3d 20  TH_UNUSABLE" == 
24b0: 22 74 22 20 5d 3b 20 74 68 65 6e 0a 23 20 20 20  "t" ]; then.#   
24c0: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 23 20        echo "".# 
24d0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 4e 65          echo "Ne
24e0: 69 74 68 65 72 20 5c 22 61 77 6b 5c 22 2c 20 6e  ither \"awk\", n
24f0: 6f 72 20 5c 22 67 61 77 6b 5c 22 20 69 73 20 75  or \"gawk\" is u
2500: 73 61 62 6c 65 2c 22 0a 23 20 20 20 20 20 20 20  sable,".#       
2510: 20 20 65 63 68 6f 20 22 62 75 74 20 61 74 20 6c    echo "but at l
2520: 65 61 73 74 20 6f 6e 65 20 6f 66 20 74 68 65 6d  east one of them
2530: 20 69 73 20 72 65 71 75 69 72 65 64 20 74 6f 20   is required to 
2540: 62 65 20 75 73 61 62 6c 65 2e 22 0a 23 20 20 20  be usable.".#   
2550: 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
2560: 65 78 65 63 75 74 69 6f 6e 20 6f 66 20 74 68 65  execution of the
2570: 20 42 61 73 68 20 73 63 72 69 70 74 20 69 73 20   Bash script is 
2580: 61 62 6f 72 74 65 64 2e 22 0a 23 20 20 20 20 20  aborted.".#     
2590: 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
25a0: 27 33 63 64 64 37 38 33 32 2d 31 65 39 63 2d 34  '3cdd7832-1e9c-4
25b0: 36 64 65 2d 39 33 30 31 2d 32 31 62 31 37 30 65  6de-9301-21b170e
25c0: 30 33 31 65 37 27 22 0a 23 20 20 20 20 20 20 20  031e7'".#       
25d0: 20 20 65 63 68 6f 20 22 22 0a 23 20 20 20 20 20    echo "".#     
25e0: 20 20 20 20 23 2d 2d 2d 2d 0a 23 20 20 20 20 20      #----.#     
25f0: 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
2600: 47 0a 23 20 20 20 20 20 20 20 20 20 65 78 69 74  G.#         exit
2610: 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
2620: 72 72 6f 72 0a 23 20 20 20 20 20 66 69 0a 23 20  rror.#     fi.# 
2630: 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69  } # func_mmmv_si
2640: 6c 6b 74 6f 72 72 65 6e 74 5f 69 6e 69 74 5f 61  lktorrent_init_a
2650: 77 6b 5f 76 65 72 73 75 73 5f 67 61 77 6b 0a 23  wk_versus_gawk.#
2660: 20 0a 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69   .# func_mmmv_si
2670: 6c 6b 74 6f 72 72 65 6e 74 5f 69 6e 69 74 5f 61  lktorrent_init_a
2680: 77 6b 5f 76 65 72 73 75 73 5f 67 61 77 6b 0a 23  wk_versus_gawk.#
2690: 20 0a 23 20 69 66 20 5b 20 22 24 53 42 5f 55 53   .# if [ "$SB_US
26a0: 45 5f 47 41 57 4b 5f 49 4e 5f 53 54 45 41 44 5f  E_GAWK_IN_STEAD_
26b0: 4f 46 5f 41 57 4b 22 20 21 3d 20 22 74 22 20 5d  OF_AWK" != "t" ]
26c0: 3b 20 74 68 65 6e 0a 23 20 20 20 20 20 69 66 20  ; then.#     if 
26d0: 5b 20 22 24 53 42 5f 55 53 45 5f 47 41 57 4b 5f  [ "$SB_USE_GAWK_
26e0: 49 4e 5f 53 54 45 41 44 5f 4f 46 5f 41 57 4b 22  IN_STEAD_OF_AWK"
26f0: 20 21 3d 20 22 66 22 20 5d 3b 20 74 68 65 6e 0a   != "f" ]; then.
2700: 23 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  #         echo "
2710: 22 0a 23 20 20 20 20 20 20 20 20 20 65 63 68 6f  ".#         echo
2720: 20 22 54 68 69 73 20 73 63 72 69 70 74 20 69 73   "This script is
2730: 20 66 6c 61 77 65 64 2e 22 0a 23 20 20 20 20 20   flawed.".#     
2740: 20 20 20 20 65 63 68 6f 20 22 22 0a 23 20 20 20      echo "".#   
2750: 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20        echo "    
2760: 53 42 5f 55 53 45 5f 47 41 57 4b 5f 49 4e 5f 53  SB_USE_GAWK_IN_S
2770: 54 45 41 44 5f 4f 46 5f 41 57 4b 3d 24 53 42 5f  TEAD_OF_AWK=$SB_
2780: 55 53 45 5f 47 41 57 4b 5f 49 4e 5f 53 54 45 41  USE_GAWK_IN_STEA
2790: 44 5f 4f 46 5f 41 57 4b 22 0a 23 20 20 20 20 20  D_OF_AWK".#     
27a0: 20 20 20 20 65 63 68 6f 20 22 22 0a 23 20 20 20      echo "".#   
27b0: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
27c0: 3d 3d 27 64 63 64 34 61 34 34 65 2d 37 34 36 34  =='dcd4a44e-7464
27d0: 2d 34 64 31 39 2d 61 33 30 31 2d 32 31 62 31 37  -4d19-a301-21b17
27e0: 30 65 30 33 31 65 37 27 22 0a 23 20 20 20 20 20  0e031e7'".#     
27f0: 20 20 20 20 65 63 68 6f 20 22 22 0a 23 20 20 20      echo "".#   
2800: 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 23 20 20 20        #----.#   
2810: 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f        cd $S_FP_O
2820: 52 49 47 0a 23 20 20 20 20 20 20 20 20 20 65 78  RIG.#         ex
2830: 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
2840: 20 65 72 72 6f 72 0a 23 20 20 20 20 20 66 69 0a   error.#     fi.
2850: 23 20 66 69 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  # fi..#---------
2860: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2870: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2880: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2890: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
28a0: 2d 0a 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 4f  -..S_FUNC_MMMV_O
28b0: 50 45 52 41 54 49 4e 47 5f 53 59 53 54 45 4d 5f  PERATING_SYSTEM_
28c0: 54 59 50 45 5f 54 31 5f 52 45 53 55 4c 54 3d 22  TYPE_T1_RESULT="
28d0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 6f 70 65 72  ".func_mmmv_oper
28e0: 61 74 69 6e 67 5f 73 79 73 74 65 6d 5f 74 79 70  ating_system_typ
28f0: 65 5f 74 31 28 29 20 7b 0a 20 20 20 20 69 66 20  e_t1() {.    if 
2900: 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  [ "$S_FUNC_MMMV_
2910: 4f 50 45 52 41 54 49 4e 47 5f 53 59 53 54 45 4d  OPERATING_SYSTEM
2920: 5f 54 59 50 45 5f 54 31 5f 52 45 53 55 4c 54 22  _TYPE_T1_RESULT"
2930: 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20   == "" ]; then. 
2940: 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22         S_TMP_0="
2950: 60 75 6e 61 6d 65 20 2d 61 20 7c 20 67 72 65 70  `uname -a | grep
2960: 20 2d 45 20 5b 4c 6c 5d 69 6e 75 78 60 22 0a 20   -E [Ll]inux`". 
2970: 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f         if [ "$S_
2980: 54 4d 50 5f 30 22 20 21 3d 20 22 22 20 5d 3b 20  TMP_0" != "" ]; 
2990: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
29a0: 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 4f 50 45   S_FUNC_MMMV_OPE
29b0: 52 41 54 49 4e 47 5f 53 59 53 54 45 4d 5f 54 59  RATING_SYSTEM_TY
29c0: 50 45 5f 54 31 5f 52 45 53 55 4c 54 3d 22 4c 69  PE_T1_RESULT="Li
29d0: 6e 75 78 22 0a 20 20 20 20 20 20 20 20 65 6c 73  nux".        els
29e0: 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 5f  e.            S_
29f0: 54 4d 50 5f 30 3d 22 60 75 6e 61 6d 65 20 2d 61  TMP_0="`uname -a
2a00: 20 7c 20 67 72 65 70 20 42 53 44 20 60 22 0a 20   | grep BSD `". 
2a10: 20 20 20 20 20 20 20 20 20 20 20 69 66 20 5b 20             if [ 
2a20: 22 24 53 5f 54 4d 50 5f 30 22 20 21 3d 20 22 22  "$S_TMP_0" != ""
2a30: 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
2a40: 20 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f           S_FUNC_
2a50: 4d 4d 4d 56 5f 4f 50 45 52 41 54 49 4e 47 5f 53  MMMV_OPERATING_S
2a60: 59 53 54 45 4d 5f 54 59 50 45 5f 54 31 5f 52 45  YSTEM_TYPE_T1_RE
2a70: 53 55 4c 54 3d 22 42 53 44 22 0a 20 20 20 20 20  SULT="BSD".     
2a80: 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 20         else.    
2a90: 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 46 55              S_FU
2aa0: 4e 43 5f 4d 4d 4d 56 5f 4f 50 45 52 41 54 49 4e  NC_MMMV_OPERATIN
2ab0: 47 5f 53 59 53 54 45 4d 5f 54 59 50 45 5f 54 31  G_SYSTEM_TYPE_T1
2ac0: 5f 52 45 53 55 4c 54 3d 22 75 6e 64 65 74 65 72  _RESULT="undeter
2ad0: 6d 69 6e 65 64 22 0a 20 20 20 20 20 20 20 20 20  mined".         
2ae0: 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 66 69     fi.        fi
2af0: 0a 20 20 20 20 66 69 0a 7d 20 23 20 66 75 6e 63  .    fi.} # func
2b00: 5f 6d 6d 6d 76 5f 6f 70 65 72 61 74 69 6e 67 5f  _mmmv_operating_
2b10: 73 79 73 74 65 6d 5f 74 79 70 65 5f 74 31 0a 0a  system_type_t1..
2b20: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
2b30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e  -----------..fun
2b70: 63 5f 6d 6d 6d 76 5f 6f 70 65 72 61 74 69 6e 67  c_mmmv_operating
2b80: 5f 73 79 73 74 65 6d 5f 74 79 70 65 5f 74 31 0a  _system_type_t1.
2b90: 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d  if [ "$S_FUNC_MM
2ba0: 4d 56 5f 4f 50 45 52 41 54 49 4e 47 5f 53 59 53  MV_OPERATING_SYS
2bb0: 54 45 4d 5f 54 59 50 45 5f 54 31 5f 52 45 53 55  TEM_TYPE_T1_RESU
2bc0: 4c 54 22 20 21 3d 20 22 4c 69 6e 75 78 22 20 5d  LT" != "Linux" ]
2bd0: 3b 20 74 68 65 6e 0a 20 20 20 20 69 66 20 5b 20  ; then.    if [ 
2be0: 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 4f 50  "$S_FUNC_MMMV_OP
2bf0: 45 52 41 54 49 4e 47 5f 53 59 53 54 45 4d 5f 54  ERATING_SYSTEM_T
2c00: 59 50 45 5f 54 31 5f 52 45 53 55 4c 54 22 20 21  YPE_T1_RESULT" !
2c10: 3d 20 22 42 53 44 22 20 5d 3b 20 74 68 65 6e 0a  = "BSD" ]; then.
2c20: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
2c30: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
2c40: 54 68 65 20 63 6c 61 73 73 69 63 61 6c 20 63 6f  The classical co
2c50: 6d 6d 61 6e 64 20 6c 69 6e 65 20 75 74 69 6c 69  mmand line utili
2c60: 74 69 65 73 20 61 74 20 22 0a 20 20 20 20 20 20  ties at ".      
2c70: 20 20 65 63 68 6f 20 22 20 20 64 69 66 66 65 72    echo "  differ
2c80: 65 6e 74 20 6f 70 65 72 61 74 69 6e 67 20 73 79  ent operating sy
2c90: 73 74 65 6d 73 2c 20 66 6f 72 20 65 78 61 6d 70  stems, for examp
2ca0: 6c 65 2c 20 4c 69 6e 75 78 20 61 6e 64 20 42 53  le, Linux and BS
2cb0: 44 2c 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  D,".        echo
2cc0: 20 22 20 20 64 69 66 66 65 72 2e 20 54 68 69 73   "  differ. This
2cd0: 20 73 63 72 69 70 74 20 69 73 20 64 65 73 69 67   script is desig
2ce0: 6e 65 64 20 74 6f 20 72 75 6e 20 6f 6e 6c 79 20  ned to run only 
2cf0: 6f 6e 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  on ".        ech
2d00: 6f 20 22 20 20 4c 69 6e 75 78 20 61 6e 64 20 73  o "  Linux and s
2d10: 6f 6d 65 20 42 53 44 20 76 61 72 69 61 6e 74 73  ome BSD variants
2d20: 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
2d30: 22 20 20 49 66 20 59 6f 75 20 61 72 65 20 77 69  "  If You are wi
2d40: 6c 6c 69 6e 67 20 74 6f 20 72 69 73 6b 20 74 68  lling to risk th
2d50: 61 74 20 73 6f 6d 65 20 6f 66 20 59 6f 75 72 20  at some of Your 
2d60: 64 61 74 61 20 22 0a 20 20 20 20 20 20 20 20 65  data ".        e
2d70: 63 68 6f 20 22 20 20 69 73 20 64 65 6c 65 74 65  cho "  is delete
2d80: 64 20 61 6e 64 2f 6f 72 20 59 6f 75 72 20 6f 70  d and/or Your op
2d90: 65 72 61 74 69 6e 67 20 73 79 73 74 65 6d 20 69  erating system i
2da0: 6e 73 74 61 6e 63 65 22 0a 20 20 20 20 20 20 20  nstance".       
2db0: 20 65 63 68 6f 20 22 20 20 62 65 63 6f 6d 65 73   echo "  becomes
2dc0: 20 70 65 72 6d 61 6e 65 6e 74 6c 79 20 66 6c 61   permanently fla
2dd0: 77 65 64 2c 20 74 6f 20 74 68 65 20 70 6f 69 6e  wed, to the poin
2de0: 74 20 74 68 61 74 20 22 0a 20 20 20 20 20 20 20  t that ".       
2df0: 20 65 63 68 6f 20 22 20 20 69 74 20 77 69 6c 6c   echo "  it will
2e00: 20 6e 6f 74 20 65 76 65 6e 20 62 6f 6f 74 2c 20   not even boot, 
2e10: 74 68 65 6e 20 59 6f 75 20 6d 61 79 20 65 64 69  then You may edi
2e20: 74 20 74 68 65 20 42 61 73 68 20 73 63 72 69 70  t the Bash scrip
2e30: 74 20 74 68 61 74 20 22 0a 20 20 20 20 20 20 20  t that ".       
2e40: 20 65 63 68 6f 20 22 20 20 64 69 73 70 6c 61 79   echo "  display
2e50: 73 20 74 68 69 73 20 65 72 72 6f 72 20 6d 65 73  s this error mes
2e60: 73 61 67 65 20 62 79 20 6d 6f 64 69 66 79 69 6e  sage by modifyin
2e70: 67 20 74 68 65 20 74 65 73 74 20 74 68 61 74 20  g the test that 
2e80: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
2e90: 20 20 63 68 65 63 6b 73 20 66 6f 72 20 74 68 65    checks for the
2ea0: 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 65   operating syste
2eb0: 6d 20 74 79 70 65 2e 22 0a 20 20 20 20 20 20 20  m type.".       
2ec0: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
2ed0: 20 65 63 68 6f 20 22 20 20 49 66 20 59 6f 75 20   echo "  If You 
2ee0: 64 6f 20 64 65 63 69 64 65 20 74 6f 20 65 64 69  do decide to edi
2ef0: 74 20 74 68 69 73 20 42 61 73 68 20 73 63 72 69  t this Bash scri
2f00: 70 74 2c 20 74 68 65 6e 20 22 0a 20 20 20 20 20  pt, then ".     
2f10: 20 20 20 65 63 68 6f 20 22 20 20 61 20 72 65 63     echo "  a rec
2f20: 6f 6d 6d 65 6e 64 61 74 69 6f 6e 20 69 73 20 74  ommendation is t
2f30: 6f 20 74 65 73 74 20 59 6f 75 72 20 6d 6f 64 69  o test Your modi
2f40: 66 69 63 61 74 69 6f 6e 73 20 22 0a 20 20 20 20  fications ".    
2f50: 20 20 20 20 65 63 68 6f 20 22 20 20 77 69 74 68      echo "  with
2f60: 69 6e 20 61 20 76 69 72 74 75 61 6c 20 6d 61 63  in a virtual mac
2f70: 68 69 6e 65 20 6f 72 2c 20 69 66 20 76 69 72 74  hine or, if virt
2f80: 75 61 6c 20 6d 61 63 68 69 6e 65 73 20 61 72 65  ual machines are
2f90: 20 6e 6f 74 22 0a 20 20 20 20 20 20 20 20 65 63   not".        ec
2fa0: 68 6f 20 22 20 20 61 6e 20 6f 70 74 69 6f 6e 2c  ho "  an option,
2fb0: 20 61 73 20 73 6f 6d 65 20 6e 65 77 20 6f 70 65   as some new ope
2fc0: 72 61 74 69 6e 67 20 73 79 73 74 65 6d 20 75 73  rating system us
2fd0: 65 72 20 74 68 61 74 20 64 6f 65 73 20 6e 6f 74  er that does not
2fe0: 20 68 61 76 65 20 22 0a 20 20 20 20 20 20 20 20   have ".        
2ff0: 65 63 68 6f 20 22 20 20 61 6e 79 20 61 63 63 65  echo "  any acce
3000: 73 73 20 74 6f 20 74 68 65 20 76 69 74 61 6c 20  ss to the vital 
3010: 64 61 74 61 2f 66 69 6c 65 73 2e 22 0a 20 20 20  data/files.".   
3020: 20 20 20 20 20 65 63 68 6f 20 22 20 20 47 55 49       echo "  GUI
3030: 44 3d 3d 27 32 64 38 34 61 30 30 34 2d 37 35 35  D=='2d84a004-755
3040: 33 2d 34 66 64 65 2d 62 31 30 31 2d 32 31 62 31  3-4fde-b101-21b1
3050: 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
3060: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
3070: 20 20 20 65 63 68 6f 20 22 20 20 41 62 6f 72 74     echo "  Abort
3080: 69 6e 67 20 73 63 72 69 70 74 20 77 69 74 68 6f  ing script witho
3090: 75 74 20 64 6f 69 6e 67 20 61 6e 79 74 68 69 6e  ut doing anythin
30a0: 67 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  g.".        echo
30b0: 20 22 22 0a 20 20 20 20 20 20 20 20 65 78 69 74   "".        exit
30c0: 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
30d0: 72 72 6f 72 0a 20 20 20 20 66 69 0a 66 69 0a 0a  rror.    fi.fi..
30e0: 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
30f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3100: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3110: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3120: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 0a 53  ------------...S
3130: 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48  B_EXISTS_ON_PATH
3140: 5f 54 31 5f 52 45 53 55 4c 54 3d 22 66 22 0a 66  _T1_RESULT="f".f
3150: 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e  unc_sb_exists_on
3160: 5f 70 61 74 68 5f 74 31 20 28 29 20 7b 0a 20 20  _path_t1 () {.  
3170: 20 20 6c 6f 63 61 6c 20 53 5f 4e 41 4d 45 5f 4f    local S_NAME_O
3180: 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45  F_THE_EXECUTABLE
3190: 5f 31 3d 22 24 31 22 20 23 20 66 69 72 73 74 20  _1="$1" # first 
31a0: 66 75 6e 63 74 69 6f 6e 20 61 72 67 75 6d 65 6e  function argumen
31b0: 74 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  t.    #--------.
31c0: 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f      local S_TMP_
31d0: 30 3d 22 22 20 23 20 64 65 63 6c 61 72 61 74 69  0="" # declarati
31e0: 6f 6e 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54  on.    local S_T
31f0: 4d 50 5f 31 3d 22 22 20 23 20 64 65 63 6c 61 72  MP_1="" # declar
3200: 61 74 69 6f 6e 0a 20 20 20 20 6c 6f 63 61 6c 20  ation.    local 
3210: 53 5f 54 4d 50 5f 32 3d 22 22 20 23 20 64 65 63  S_TMP_2="" # dec
3220: 6c 61 72 61 74 69 6f 6e 0a 20 20 20 20 23 2d 2d  laration.    #--
3230: 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 46 75 6e  ------.    # Fun
3240: 63 74 69 6f 6e 20 63 61 6c 6c 73 20 6c 69 6b 65  ction calls like
3250: 0a 20 20 20 20 23 0a 20 20 20 20 23 20 20 20 20  .    #.    #    
3260: 20 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f   func_sb_exists_
3270: 6f 6e 5f 70 61 74 68 5f 74 31 20 22 22 0a 20 20  on_path_t1 "".  
3280: 20 20 23 20 20 20 20 20 66 75 6e 63 5f 73 62 5f    #     func_sb_
3290: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
32a0: 31 20 22 20 22 0a 20 20 20 20 23 20 20 20 20 20  1 " ".    #     
32b0: 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f  func_sb_exists_o
32c0: 6e 5f 70 61 74 68 5f 74 31 20 22 6c 73 20 70 73  n_path_t1 "ls ps
32d0: 22 20 23 20 63 6f 6e 74 61 69 6e 73 20 61 20 73  " # contains a s
32e0: 70 61 63 65 0a 20 20 20 20 23 0a 20 20 20 20 23  pace.    #.    #
32f0: 20 61 72 65 20 6e 6f 74 20 61 6c 6c 6f 77 65 64   are not allowed
3300: 2e 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 4e  ..    if [ "$S_N
3310: 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55  AME_OF_THE_EXECU
3320: 54 41 42 4c 45 5f 31 22 20 3d 3d 20 22 22 20 5d  TABLE_1" == "" ]
3330: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
3340: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
3350: 65 63 68 6f 20 22 54 68 65 20 42 61 73 68 20 66  echo "The Bash f
3360: 75 6e 63 74 69 6f 6e 20 22 0a 20 20 20 20 20 20  unction ".      
3370: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
3380: 20 20 65 63 68 6f 20 22 20 20 20 20 66 75 6e 63    echo "    func
3390: 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61  _sb_exists_on_pa
33a0: 74 68 5f 74 31 20 22 0a 20 20 20 20 20 20 20 20  th_t1 ".        
33b0: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
33c0: 65 63 68 6f 20 22 69 73 20 6e 6f 74 20 64 65 73  echo "is not des
33d0: 69 67 6e 65 64 20 74 6f 20 68 61 6e 64 6c 65 20  igned to handle 
33e0: 61 6e 20 61 72 67 75 6d 65 6e 74 20 74 68 61 74  an argument that
33f0: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
3400: 22 65 71 75 61 6c 73 20 77 69 74 68 20 61 6e 20  "equals with an 
3410: 65 6d 70 74 79 20 73 74 72 69 6e 67 2e 22 0a 20  empty string.". 
3420: 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
3430: 44 3d 3d 27 32 37 36 65 36 33 66 34 2d 35 63 64  D=='276e63f4-5cd
3440: 36 2d 34 30 32 34 2d 38 31 30 31 2d 32 31 62 31  6-4024-8101-21b1
3450: 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
3460: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
3470: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
3480: 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
3490: 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
34a0: 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
34b0: 20 20 20 20 66 69 0a 20 20 20 20 53 5f 54 4d 50      fi.    S_TMP
34c0: 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70  _0="`ruby -e \"p
34d0: 72 69 6e 74 28 27 24 53 5f 4e 41 4d 45 5f 4f 46  rint('$S_NAME_OF
34e0: 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f  _THE_EXECUTABLE_
34f0: 31 27 2e 74 6f 5f 73 2e 67 73 75 62 28 2f 5b 5c  1'.to_s.gsub(/[\
3500: 73 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a  s]+/,''));\" `".
3510: 20 20 20 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d      if [ "$S_NAM
3520: 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41  E_OF_THE_EXECUTA
3530: 42 4c 45 5f 31 22 20 21 3d 20 22 24 53 5f 54 4d  BLE_1" != "$S_TM
3540: 50 5f 30 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20  P_0" ] ; then.  
3550: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
3560: 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
3570: 42 61 73 68 20 66 75 6e 63 74 69 6f 6e 20 22 0a  Bash function ".
3580: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
3590: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
35a0: 20 20 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73    func_sb_exists
35b0: 5f 6f 6e 5f 70 61 74 68 5f 74 31 20 22 0a 20 20  _on_path_t1 ".  
35c0: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
35d0: 20 20 20 20 20 20 65 63 68 6f 20 22 69 73 20 6e        echo "is n
35e0: 6f 74 20 64 65 73 69 67 6e 65 64 20 74 6f 20 68  ot designed to h
35f0: 61 6e 64 6c 65 20 61 6e 20 61 72 67 75 6d 65 6e  andle an argumen
3600: 74 20 76 61 6c 75 65 20 74 68 61 74 20 63 6f 6e  t value that con
3610: 74 61 69 6e 73 20 22 0a 20 20 20 20 20 20 20 20  tains ".        
3620: 65 63 68 6f 20 22 73 70 61 63 65 73 20 6f 72 20  echo "spaces or 
3630: 74 61 62 75 6c 61 74 69 6f 6e 20 63 68 61 72 61  tabulation chara
3640: 63 74 65 72 73 2e 22 0a 20 20 20 20 20 20 20 20  cters.".        
3650: 65 63 68 6f 20 22 54 68 65 20 72 65 63 65 69 76  echo "The receiv
3660: 65 64 20 76 61 6c 75 65 20 69 6e 20 70 61 72 65  ed value in pare
3670: 6e 74 68 65 73 69 73 3a 28 24 53 5f 4e 41 4d 45  nthesis:($S_NAME
3680: 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42  _OF_THE_EXECUTAB
3690: 4c 45 5f 31 29 2e 22 0a 20 20 20 20 20 20 20 20  LE_1).".        
36a0: 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 34 62 62  echo "GUID=='4bb
36b0: 66 30 38 30 34 2d 31 36 35 65 2d 34 38 34 66 2d  f0804-165e-484f-
36c0: 38 34 66 30 2d 32 31 62 31 37 30 65 30 33 31 65  84f0-21b170e031e
36d0: 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
36e0: 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
36f0: 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
3700: 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
3710: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
3720: 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
3730: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
3740: 20 20 53 5f 54 4d 50 5f 30 3d 22 5c 60 77 68 69    S_TMP_0="\`whi
3750: 63 68 20 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48  ch $S_NAME_OF_TH
3760: 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 31 20 32  E_EXECUTABLE_1 2
3770: 3e 2f 64 65 76 2f 6e 75 6c 6c 5c 60 22 0a 20 20  >/dev/null\`".  
3780: 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 32 3d    local S_TMP_2=
3790: 22 53 5f 54 4d 50 5f 31 3d 24 53 5f 54 4d 50 5f  "S_TMP_1=$S_TMP_
37a0: 30 22 0a 20 20 20 20 65 76 61 6c 20 24 7b 53 5f  0".    eval ${S_
37b0: 54 4d 50 5f 32 7d 0a 20 20 20 20 23 2d 2d 2d 2d  TMP_2}.    #----
37c0: 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d  .    if [ "$S_TM
37d0: 50 5f 31 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74  P_1" == "" ] ; t
37e0: 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 45  hen.        SB_E
37f0: 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31  XISTS_ON_PATH_T1
3800: 5f 52 45 53 55 4c 54 3d 22 66 22 0a 20 20 20 20  _RESULT="f".    
3810: 65 6c 73 65 0a 20 20 20 20 20 20 20 20 53 42 5f  else.        SB_
3820: 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54  EXISTS_ON_PATH_T
3830: 31 5f 52 45 53 55 4c 54 3d 22 74 22 0a 20 20 20  1_RESULT="t".   
3840: 20 66 69 0a 7d 20 23 20 66 75 6e 63 5f 73 62 5f   fi.} # func_sb_
3850: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
3860: 31 20 0a 0a 0a 0a 66 75 6e 63 5f 61 73 73 65 72  1 ....func_asser
3870: 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68  t_exists_on_path
3880: 5f 74 32 20 28 29 20 7b 0a 20 20 20 20 6c 6f 63  _t2 () {.    loc
3890: 61 6c 20 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45  al S_NAME_OF_THE
38a0: 5f 45 58 45 43 55 54 41 42 4c 45 5f 31 3d 22 24  _EXECUTABLE_1="$
38b0: 31 22 20 23 20 66 69 72 73 74 20 66 75 6e 63 74  1" # first funct
38c0: 69 6f 6e 20 61 72 67 75 6d 65 6e 74 0a 20 20 20  ion argument.   
38d0: 20 6c 6f 63 61 6c 20 53 5f 4e 41 4d 45 5f 4f 46   local S_NAME_OF
38e0: 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f  _THE_EXECUTABLE_
38f0: 32 3d 22 24 32 22 20 23 20 6f 70 74 69 6f 6e 61  2="$2" # optiona
3900: 6c 20 61 72 67 75 6d 65 6e 74 0a 20 20 20 20 6c  l argument.    l
3910: 6f 63 61 6c 20 53 5f 4e 41 4d 45 5f 4f 46 5f 54  ocal S_NAME_OF_T
3920: 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 33 3d  HE_EXECUTABLE_3=
3930: 22 24 33 22 20 23 20 6f 70 74 69 6f 6e 61 6c 20  "$3" # optional 
3940: 61 72 67 75 6d 65 6e 74 0a 20 20 20 20 6c 6f 63  argument.    loc
3950: 61 6c 20 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45  al S_NAME_OF_THE
3960: 5f 45 58 45 43 55 54 41 42 4c 45 5f 34 3d 22 24  _EXECUTABLE_4="$
3970: 34 22 20 23 20 6f 70 74 69 6f 6e 61 6c 20 61 72  4" # optional ar
3980: 67 75 6d 65 6e 74 0a 20 20 20 20 23 2d 2d 2d 2d  gument.    #----
3990: 2d 2d 2d 2d 0a 20 20 20 20 23 20 46 75 6e 63 74  ----.    # Funct
39a0: 69 6f 6e 20 63 61 6c 6c 73 20 6c 69 6b 65 0a 20  ion calls like. 
39b0: 20 20 20 23 0a 20 20 20 20 23 20 20 20 20 20 66     #.    #     f
39c0: 75 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74  unc_assert_exist
39d0: 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 20 22 22  s_on_path_t2  ""
39e0: 20 20 20 20 22 22 20 20 22 6c 73 22 0a 20 20 20      ""  "ls".   
39f0: 20 23 20 20 20 20 20 66 75 6e 63 5f 61 73 73 65   #     func_asse
3a00: 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74  rt_exists_on_pat
3a10: 68 5f 74 32 20 20 22 6c 73 22 20 20 22 22 20 20  h_t2  "ls"  ""  
3a20: 22 70 73 22 0a 20 20 20 20 23 0a 20 20 20 20 23  "ps".    #.    #
3a30: 20 61 72 65 20 6e 6f 74 20 61 6c 6c 6f 77 65 64   are not allowed
3a40: 20 62 79 20 74 68 65 20 73 70 65 63 20 6f 66 20   by the spec of 
3a50: 74 68 69 73 20 66 75 6e 63 74 69 6f 6e 2c 20 62  this function, b
3a60: 75 74 20 69 74 27 73 20 4f 4b 20 74 6f 20 63 61  ut it's OK to ca
3a70: 6c 6c 0a 20 20 20 20 23 0a 20 20 20 20 23 20 20  ll.    #.    #  
3a80: 20 20 20 66 75 6e 63 5f 61 73 73 65 72 74 5f 65     func_assert_e
3a90: 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32  xists_on_path_t2
3aa0: 20 20 22 6c 73 22 20 22 22 20 0a 20 20 20 20 23    "ls" "" .    #
3ab0: 20 20 20 20 20 66 75 6e 63 5f 61 73 73 65 72 74       func_assert
3ac0: 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f  _exists_on_path_
3ad0: 74 32 20 20 22 6c 73 22 20 22 70 73 22 20 22 22  t2  "ls" "ps" ""
3ae0: 0a 20 20 20 20 23 20 20 20 20 20 66 75 6e 63 5f  .    #     func_
3af0: 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e  assert_exists_on
3b00: 5f 70 61 74 68 5f 74 32 20 20 22 6c 73 22 20 22  _path_t2  "ls" "
3b10: 22 20 20 20 22 22 20 22 22 0a 20 20 20 20 23 0a  "   "" "".    #.
3b20: 20 20 20 20 23 0a 20 20 20 20 6c 6f 63 61 6c 20      #.    local 
3b30: 53 42 5f 54 48 52 4f 57 3d 22 66 22 0a 20 20 20  SB_THROW="f".   
3b40: 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f   if [ "$S_NAME_O
3b50: 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45  F_THE_EXECUTABLE
3b60: 5f 31 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68  _1" == "" ] ; th
3b70: 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 54 48  en.        SB_TH
3b80: 52 4f 57 3d 22 74 22 0a 20 20 20 20 65 6c 73 65  ROW="t".    else
3b90: 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
3ba0: 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58  S_NAME_OF_THE_EX
3bb0: 45 43 55 54 41 42 4c 45 5f 32 22 20 3d 3d 20 22  ECUTABLE_2" == "
3bc0: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
3bd0: 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f         if [ "$S_
3be0: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
3bf0: 55 54 41 42 4c 45 5f 33 22 20 21 3d 20 22 22 20  UTABLE_3" != "" 
3c00: 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  ] ; then.       
3c10: 20 20 20 20 20 20 20 20 20 53 42 5f 54 48 52 4f           SB_THRO
3c20: 57 3d 22 74 22 0a 20 20 20 20 20 20 20 20 20 20  W="t".          
3c30: 20 20 66 69 0a 20 20 20 20 20 20 20 20 20 20 20    fi.           
3c40: 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f   if [ "$S_NAME_O
3c50: 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45  F_THE_EXECUTABLE
3c60: 5f 34 22 20 21 3d 20 22 22 20 5d 20 3b 20 74 68  _4" != "" ] ; th
3c70: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  en.             
3c80: 20 20 20 53 42 5f 54 48 52 4f 57 3d 22 74 22 0a     SB_THROW="t".
3c90: 20 20 20 20 20 20 20 20 20 20 20 20 66 69 0a 20              fi. 
3ca0: 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 20         else.    
3cb0: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
3cc0: 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45  _NAME_OF_THE_EXE
3cd0: 43 55 54 41 42 4c 45 5f 33 22 20 3d 3d 20 22 22  CUTABLE_3" == ""
3ce0: 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20   ] ; then.      
3cf0: 20 20 20 20 20 20 20 20 20 20 69 66 20 5b 20 22            if [ "
3d00: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
3d10: 58 45 43 55 54 41 42 4c 45 5f 34 22 20 21 3d 20  XECUTABLE_4" != 
3d20: 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  "" ] ; then.    
3d30: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
3d40: 53 42 5f 54 48 52 4f 57 3d 22 74 22 0a 20 20 20  SB_THROW="t".   
3d50: 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 0a               fi.
3d60: 20 20 20 20 20 20 20 20 20 20 20 20 66 69 0a 20              fi. 
3d70: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 66 69         fi.    fi
3d80: 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69  .    #----.    i
3d90: 66 20 5b 20 22 24 53 42 5f 54 48 52 4f 57 22 20  f [ "$SB_THROW" 
3da0: 3d 3d 20 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a  == "t" ] ; then.
3db0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
3dc0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
3dd0: 65 20 42 61 73 68 20 66 75 6e 63 74 69 6f 6e 20  e Bash function 
3de0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
3df0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
3e00: 20 20 20 20 66 75 6e 63 5f 61 73 73 65 72 74 5f      func_assert_
3e10: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
3e20: 32 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  2 ".        echo
3e30: 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
3e40: 20 22 69 73 20 6e 6f 74 20 64 65 73 69 67 6e 65   "is not designe
3e50: 64 20 74 6f 20 68 61 6e 64 6c 65 20 73 65 72 69  d to handle seri
3e60: 65 73 20 6f 66 20 61 72 67 75 6d 65 6e 74 73 2c  es of arguments,
3e70: 20 77 68 65 72 65 20 22 0a 20 20 20 20 20 20 20   where ".       
3e80: 20 65 63 68 6f 20 22 65 6d 70 74 79 20 73 74 72   echo "empty str
3e90: 69 6e 67 73 20 70 72 65 63 65 64 65 20 6e 6f 6e  ings precede non
3ea0: 2d 65 6d 70 74 79 20 73 74 72 69 6e 67 73 2e 22  -empty strings."
3eb0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47  .        echo "G
3ec0: 55 49 44 3d 3d 27 64 66 65 61 62 62 34 37 2d 32  UID=='dfeabb47-2
3ed0: 61 64 63 2d 34 31 65 38 2d 62 32 66 30 2d 32 31  adc-41e8-b2f0-21
3ee0: 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  b170e031e7'".   
3ef0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
3f00: 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
3f10: 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
3f20: 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20  .        exit 1 
3f30: 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
3f40: 72 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20  r.    fi.    if 
3f50: 5b 20 22 24 35 22 20 21 3d 20 22 22 20 5d 20 3b  [ "$5" != "" ] ;
3f60: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
3f70: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
3f80: 68 6f 20 22 54 68 69 73 20 42 61 73 68 20 66 75  ho "This Bash fu
3f90: 6e 63 74 69 6f 6e 20 69 73 20 64 65 73 69 67 6e  nction is design
3fa0: 65 64 20 74 6f 20 77 6f 72 6b 20 77 69 74 68 20  ed to work with 
3fb0: 61 74 20 6d 6f 73 74 20 34 20 69 6e 70 75 74 20  at most 4 input 
3fc0: 61 72 67 75 6d 65 6e 74 73 22 0a 20 20 20 20 20  arguments".     
3fd0: 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
3fe0: 31 37 65 32 63 32 63 39 2d 65 32 34 62 2d 34 30  17e2c2c9-e24b-40
3ff0: 34 64 2d 62 31 66 30 2d 32 31 62 31 37 30 65 30  4d-b1f0-21b170e0
4000: 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
4010: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
4020: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
4030: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
4040: 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
4050: 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
4060: 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
4070: 0a 20 20 20 20 23 20 46 75 6e 63 74 69 6f 6e 20  .    # Function 
4080: 63 61 6c 6c 73 20 6c 69 6b 65 0a 20 20 20 20 23  calls like.    #
4090: 0a 20 20 20 20 23 20 20 20 20 20 66 75 6e 63 5f  .    #     func_
40a0: 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e  assert_exists_on
40b0: 5f 70 61 74 68 5f 74 32 20 22 20 22 0a 20 20 20  _path_t2 " ".   
40c0: 20 23 20 20 20 20 20 66 75 6e 63 5f 61 73 73 65   #     func_asse
40d0: 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74  rt_exists_on_pat
40e0: 68 5f 74 32 20 22 6c 73 20 70 73 22 20 23 20 63  h_t2 "ls ps" # c
40f0: 6f 6e 74 61 69 6e 73 20 61 20 73 70 61 63 65 0a  ontains a space.
4100: 20 20 20 20 23 0a 20 20 20 20 23 20 61 72 65 20      #.    # are 
4110: 6e 6f 74 20 61 6c 6c 6f 77 65 64 2e 0a 20 20 20  not allowed..   
4120: 20 53 42 5f 54 48 52 4f 57 3d 22 66 22 20 0a 20   SB_THROW="f" . 
4130: 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 30     local S_TMP_0
4140: 3d 22 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f  ="".    local S_
4150: 54 4d 50 5f 31 3d 22 22 0a 20 20 20 20 6c 6f 63  TMP_1="".    loc
4160: 61 6c 20 53 5f 54 4d 50 5f 32 3d 22 22 0a 20 20  al S_TMP_2="".  
4170: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b    #----.    if [
4180: 20 22 24 53 42 5f 54 48 52 4f 57 22 20 3d 3d 20   "$SB_THROW" == 
4190: 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20  "f" ] ; then.   
41a0: 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72       S_TMP_0="`r
41b0: 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27  uby -e \"print('
41c0: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
41d0: 58 45 43 55 54 41 42 4c 45 5f 31 27 2e 74 6f 5f  XECUTABLE_1'.to_
41e0: 73 2e 67 73 75 62 28 2f 5b 5c 73 5d 2b 2f 2c 27  s.gsub(/[\s]+/,'
41f0: 27 29 29 3b 5c 22 20 60 22 0a 20 20 20 20 20 20  '));\" `".      
4200: 20 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f    if [ "$S_NAME_
4210: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
4220: 45 5f 31 22 20 21 3d 20 22 24 53 5f 54 4d 50 5f  E_1" != "$S_TMP_
4230: 30 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  0" ] ; then.    
4240: 20 20 20 20 20 20 20 20 53 42 5f 54 48 52 4f 57          SB_THROW
4250: 3d 22 74 22 20 0a 20 20 20 20 20 20 20 20 20 20  ="t" .          
4260: 20 20 53 5f 54 4d 50 5f 31 3d 22 24 53 5f 4e 41    S_TMP_1="$S_NA
4270: 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54  ME_OF_THE_EXECUT
4280: 41 42 4c 45 5f 31 22 0a 20 20 20 20 20 20 20 20  ABLE_1".        
4290: 20 20 20 20 53 5f 54 4d 50 5f 32 3d 22 47 55 49      S_TMP_2="GUI
42a0: 44 3d 3d 27 34 38 34 64 32 35 35 39 2d 65 36 61  D=='484d2559-e6a
42b0: 64 2d 34 65 64 34 2d 39 32 66 30 2d 32 31 62 31  d-4ed4-92f0-21b1
42c0: 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
42d0: 20 20 20 66 69 0a 20 20 20 20 66 69 0a 20 20 20     fi.    fi.   
42e0: 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20   #----.    if [ 
42f0: 22 24 53 42 5f 54 48 52 4f 57 22 20 3d 3d 20 22  "$SB_THROW" == "
4300: 66 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  f" ] ; then.    
4310: 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75      S_TMP_0="`ru
4320: 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27 24  by -e \"print('$
4330: 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58  S_NAME_OF_THE_EX
4340: 45 43 55 54 41 42 4c 45 5f 32 27 2e 74 6f 5f 73  ECUTABLE_2'.to_s
4350: 2e 67 73 75 62 28 2f 5b 5c 73 5d 2b 2f 2c 27 27  .gsub(/[\s]+/,''
4360: 29 29 3b 5c 22 20 60 22 0a 20 20 20 20 20 20 20  ));\" `".       
4370: 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f   if [ "$S_NAME_O
4380: 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45  F_THE_EXECUTABLE
4390: 5f 32 22 20 21 3d 20 22 24 53 5f 54 4d 50 5f 30  _2" != "$S_TMP_0
43a0: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
43b0: 20 20 20 20 20 20 20 53 42 5f 54 48 52 4f 57 3d         SB_THROW=
43c0: 22 74 22 20 0a 20 20 20 20 20 20 20 20 20 20 20  "t" .           
43d0: 20 53 5f 54 4d 50 5f 31 3d 22 24 53 5f 4e 41 4d   S_TMP_1="$S_NAM
43e0: 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41  E_OF_THE_EXECUTA
43f0: 42 4c 45 5f 32 22 0a 20 20 20 20 20 20 20 20 20  BLE_2".         
4400: 20 20 20 53 5f 54 4d 50 5f 32 3d 22 47 55 49 44     S_TMP_2="GUID
4410: 3d 3d 27 61 34 38 37 61 39 39 33 2d 39 32 36 30  =='a487a993-9260
4420: 2d 34 65 38 38 2d 62 35 66 30 2d 32 31 62 31 37  -4e88-b5f0-21b17
4430: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
4440: 20 20 66 69 0a 20 20 20 20 66 69 0a 20 20 20 20    fi.    fi.    
4450: 23 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22  #----.    if [ "
4460: 24 53 42 5f 54 48 52 4f 57 22 20 3d 3d 20 22 66  $SB_THROW" == "f
4470: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
4480: 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75 62     S_TMP_0="`rub
4490: 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27 24 53  y -e \"print('$S
44a0: 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45  _NAME_OF_THE_EXE
44b0: 43 55 54 41 42 4c 45 5f 33 27 2e 74 6f 5f 73 2e  CUTABLE_3'.to_s.
44c0: 67 73 75 62 28 2f 5b 5c 73 5d 2b 2f 2c 27 27 29  gsub(/[\s]+/,'')
44d0: 29 3b 5c 22 20 60 22 0a 20 20 20 20 20 20 20 20  );\" `".        
44e0: 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46  if [ "$S_NAME_OF
44f0: 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f  _THE_EXECUTABLE_
4500: 33 22 20 21 3d 20 22 24 53 5f 54 4d 50 5f 30 22  3" != "$S_TMP_0"
4510: 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20   ] ; then.      
4520: 20 20 20 20 20 20 53 42 5f 54 48 52 4f 57 3d 22        SB_THROW="
4530: 74 22 20 0a 20 20 20 20 20 20 20 20 20 20 20 20  t" .            
4540: 53 5f 54 4d 50 5f 31 3d 22 24 53 5f 4e 41 4d 45  S_TMP_1="$S_NAME
4550: 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42  _OF_THE_EXECUTAB
4560: 4c 45 5f 33 22 0a 20 20 20 20 20 20 20 20 20 20  LE_3".          
4570: 20 20 53 5f 54 4d 50 5f 32 3d 22 47 55 49 44 3d    S_TMP_2="GUID=
4580: 3d 27 30 39 64 31 32 35 33 66 2d 61 63 39 34 2d  ='09d1253f-ac94-
4590: 34 61 32 33 2d 39 31 65 30 2d 32 31 62 31 37 30  4a23-91e0-21b170
45a0: 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
45b0: 20 66 69 0a 20 20 20 20 66 69 0a 20 20 20 20 23   fi.    fi.    #
45c0: 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24  ----.    if [ "$
45d0: 53 42 5f 54 48 52 4f 57 22 20 3d 3d 20 22 66 22  SB_THROW" == "f"
45e0: 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20   ] ; then.      
45f0: 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75 62 79    S_TMP_0="`ruby
4600: 20 2d 65 20 5c 22 70 72 69 6e 74 28 27 24 53 5f   -e \"print('$S_
4610: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
4620: 55 54 41 42 4c 45 5f 34 27 2e 74 6f 5f 73 2e 67  UTABLE_4'.to_s.g
4630: 73 75 62 28 2f 5b 5c 73 5d 2b 2f 2c 27 27 29 29  sub(/[\s]+/,''))
4640: 3b 5c 22 20 60 22 0a 20 20 20 20 20 20 20 20 69  ;\" `".        i
4650: 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f  f [ "$S_NAME_OF_
4660: 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 34  THE_EXECUTABLE_4
4670: 22 20 21 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20  " != "$S_TMP_0" 
4680: 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  ] ; then.       
4690: 20 20 20 20 20 53 42 5f 54 48 52 4f 57 3d 22 74       SB_THROW="t
46a0: 22 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 53  " .            S
46b0: 5f 54 4d 50 5f 31 3d 22 24 53 5f 4e 41 4d 45 5f  _TMP_1="$S_NAME_
46c0: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
46d0: 45 5f 34 22 0a 20 20 20 20 20 20 20 20 20 20 20  E_4".           
46e0: 20 53 5f 54 4d 50 5f 32 3d 22 47 55 49 44 3d 3d   S_TMP_2="GUID==
46f0: 27 66 66 62 66 35 30 35 33 2d 65 37 63 64 2d 34  'ffbf5053-e7cd-4
4700: 30 35 36 2d 38 34 65 30 2d 32 31 62 31 37 30 65  056-84e0-21b170e
4710: 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
4720: 66 69 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  fi.    fi.    #-
4730: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
4740: 20 22 24 53 42 5f 54 48 52 4f 57 22 20 3d 3d 20   "$SB_THROW" == 
4750: 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20  "t" ] ; then.   
4760: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
4770: 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 42       echo "The B
4780: 61 73 68 20 66 75 6e 63 74 69 6f 6e 20 22 0a 20  ash function ". 
4790: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
47a0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20         echo "   
47b0: 20 66 75 6e 63 5f 61 73 73 65 72 74 5f 65 78 69   func_assert_exi
47c0: 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22  sts_on_path_t2 "
47d0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
47e0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69  .        echo "i
47f0: 73 20 6e 6f 74 20 64 65 73 69 67 6e 65 64 20 74  s not designed t
4800: 6f 20 68 61 6e 64 6c 65 20 61 6e 20 61 72 67 75  o handle an argu
4810: 6d 65 6e 74 20 76 61 6c 75 65 20 74 68 61 74 20  ment value that 
4820: 63 6f 6e 74 61 69 6e 73 20 22 0a 20 20 20 20 20  contains ".     
4830: 20 20 20 65 63 68 6f 20 22 73 70 61 63 65 73 20     echo "spaces 
4840: 6f 72 20 74 61 62 75 6c 61 74 69 6f 6e 20 63 68  or tabulation ch
4850: 61 72 61 63 74 65 72 73 2e 22 0a 20 20 20 20 20  aracters.".     
4860: 20 20 20 65 63 68 6f 20 22 54 68 65 20 75 6e 61     echo "The una
4870: 63 63 65 70 74 65 64 20 76 61 6c 75 65 20 69 6e  ccepted value in
4880: 20 70 61 72 65 6e 74 68 65 73 69 73 3a 28 24 53   parenthesis:($S
4890: 5f 54 4d 50 5f 31 29 2e 22 0a 20 20 20 20 20 20  _TMP_1).".      
48a0: 20 20 65 63 68 6f 20 22 42 72 61 6e 63 68 20 24    echo "Branch $
48b0: 53 5f 54 4d 50 5f 32 2e 22 0a 20 20 20 20 20 20  S_TMP_2.".      
48c0: 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 34    echo "GUID=='4
48d0: 35 37 39 65 32 34 64 2d 39 31 64 34 2d 34 61 30  579e24d-91d4-4a0
48e0: 31 2d 39 32 65 30 2d 32 31 62 31 37 30 65 30 33  1-92e0-21b170e03
48f0: 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63  1e7'".        ec
4900: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d  ho "".        #-
4910: 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
4920: 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
4930: 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
4940: 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66  with error.    f
4950: 69 0a 20 20 20 20 53 42 5f 54 48 52 4f 57 3d 22  i.    SB_THROW="
4960: 66 22 20 23 20 4a 75 73 74 20 61 20 72 65 73 65  f" # Just a rese
4970: 74 2c 20 73 68 6f 75 6c 64 20 49 20 66 6f 72 67  t, should I forg
4980: 65 74 20 74 6f 20 72 65 73 65 74 20 69 74 20 6c  et to reset it l
4990: 61 74 65 72 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d  ater..    #-----
49a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53  ----------.    S
49b0: 5f 54 4d 50 5f 30 3d 22 5c 60 77 68 69 63 68 20  _TMP_0="\`which 
49c0: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
49d0: 58 45 43 55 54 41 42 4c 45 5f 31 20 32 3e 2f 64  XECUTABLE_1 2>/d
49e0: 65 76 2f 6e 75 6c 6c 5c 60 22 0a 20 20 20 20 6c  ev/null\`".    l
49f0: 6f 63 61 6c 20 53 5f 54 4d 50 5f 31 3d 22 22 0a  ocal S_TMP_1="".
4a00: 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f      local S_TMP_
4a10: 32 3d 22 53 5f 54 4d 50 5f 31 3d 24 53 5f 54 4d  2="S_TMP_1=$S_TM
4a20: 50 5f 30 22 0a 20 20 20 20 65 76 61 6c 20 24 7b  P_0".    eval ${
4a30: 53 5f 54 4d 50 5f 32 7d 0a 20 20 20 20 23 2d 2d  S_TMP_2}.    #--
4a40: 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  --.    if [ "$S_
4a50: 54 4d 50 5f 31 22 20 3d 3d 20 22 22 20 5d 20 3b  TMP_1" == "" ] ;
4a60: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 69 66   then.        if
4a70: 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54   [ "$S_NAME_OF_T
4a80: 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 32 22  HE_EXECUTABLE_2"
4a90: 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a   == "" ] ; then.
4aa0: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
4ab0: 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45  _NAME_OF_THE_EXE
4ac0: 43 55 54 41 42 4c 45 5f 33 22 20 3d 3d 20 22 22  CUTABLE_3" == ""
4ad0: 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20   ] ; then.      
4ae0: 20 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f    if [ "$S_NAME_
4af0: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
4b00: 45 5f 34 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74  E_4" == "" ] ; t
4b10: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
4b20: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
4b30: 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20 62      echo "This b
4b40: 61 73 68 20 73 63 72 69 70 74 20 72 65 71 75 69  ash script requi
4b50: 72 65 73 20 74 68 65 20 5c 22 24 53 5f 4e 41 4d  res the \"$S_NAM
4b60: 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41  E_OF_THE_EXECUTA
4b70: 42 4c 45 5f 31 5c 22 20 74 6f 20 62 65 20 6f 6e  BLE_1\" to be on
4b80: 20 74 68 65 20 50 41 54 48 2e 22 0a 20 20 20 20   the PATH.".    
4b90: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
4ba0: 49 44 3d 3d 27 32 31 37 35 31 36 31 65 2d 32 33  ID=='2175161e-23
4bb0: 64 39 2d 34 37 35 65 2d 61 34 65 30 2d 32 31 62  d9-475e-a4e0-21b
4bc0: 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  170e031e7'".    
4bd0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
4be0: 20 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d              #---
4bf0: 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 64  -.            cd
4c00: 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20   $S_FP_ORIG.    
4c10: 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
4c20: 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
4c30: 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20  .        fi.    
4c40: 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 66      fi.        f
4c50: 69 0a 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20  i.    else.     
4c60: 20 20 20 72 65 74 75 72 6e 20 23 20 61 74 20 6c     return # at l
4c70: 65 61 73 74 20 6f 6e 65 20 6f 66 20 74 68 65 20  east one of the 
4c80: 70 72 6f 67 72 61 6d 73 20 77 61 73 20 61 76 61  programs was ava
4c90: 69 6c 61 62 6c 65 20 61 74 20 74 68 65 20 50 41  ilable at the PA
4ca0: 54 48 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  TH.    fi.    #-
4cb0: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d  -------.    S_TM
4cc0: 50 5f 30 3d 22 5c 60 77 68 69 63 68 20 24 53 5f  P_0="\`which $S_
4cd0: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
4ce0: 55 54 41 42 4c 45 5f 32 20 32 3e 2f 64 65 76 2f  UTABLE_2 2>/dev/
4cf0: 6e 75 6c 6c 5c 60 22 0a 20 20 20 20 53 5f 54 4d  null\`".    S_TM
4d00: 50 5f 31 3d 22 22 0a 20 20 20 20 53 5f 54 4d 50  P_1="".    S_TMP
4d10: 5f 32 3d 22 53 5f 54 4d 50 5f 31 3d 24 53 5f 54  _2="S_TMP_1=$S_T
4d20: 4d 50 5f 30 22 0a 20 20 20 20 65 76 61 6c 20 24  MP_0".    eval $
4d30: 7b 53 5f 54 4d 50 5f 32 7d 0a 20 20 20 20 23 2d  {S_TMP_2}.    #-
4d40: 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ---.    if [ "$S
4d50: 5f 54 4d 50 5f 31 22 20 3d 3d 20 22 22 20 5d 20  _TMP_1" == "" ] 
4d60: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 69  ; then.        i
4d70: 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f  f [ "$S_NAME_OF_
4d80: 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 33  THE_EXECUTABLE_3
4d90: 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e  " == "" ] ; then
4da0: 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
4db0: 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58  S_NAME_OF_THE_EX
4dc0: 45 43 55 54 41 42 4c 45 5f 34 22 20 3d 3d 20 22  ECUTABLE_4" == "
4dd0: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
4de0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
4df0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
4e00: 22 54 68 69 73 20 62 61 73 68 20 73 63 72 69 70  "This bash scrip
4e10: 74 20 72 65 71 75 69 72 65 73 20 74 68 61 74 20  t requires that 
4e20: 65 69 74 68 65 72 20 5c 22 24 53 5f 4e 41 4d 45  either \"$S_NAME
4e30: 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42  _OF_THE_EXECUTAB
4e40: 4c 45 5f 31 5c 22 20 6f 72 20 22 0a 20 20 20 20  LE_1\" or ".    
4e50: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 5c          echo " \
4e60: 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f  "$S_NAME_OF_THE_
4e70: 45 58 45 43 55 54 41 42 4c 45 5f 32 5c 22 20 69  EXECUTABLE_2\" i
4e80: 73 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74  s available on t
4e90: 68 65 20 50 41 54 48 2e 22 0a 20 20 20 20 20 20  he PATH.".      
4ea0: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
4eb0: 3d 3d 27 66 64 39 32 38 34 35 64 2d 37 34 34 31  =='fd92845d-7441
4ec0: 2d 34 36 61 62 2d 62 31 65 30 2d 32 31 62 31 37  -46ab-b1e0-21b17
4ed0: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
4ee0: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
4ef0: 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a            #----.
4f00: 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24              cd $
4f10: 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
4f20: 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
4f30: 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
4f40: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
4f50: 20 20 66 69 0a 20 20 20 20 65 6c 73 65 0a 20 20    fi.    else.  
4f60: 20 20 20 20 20 20 72 65 74 75 72 6e 20 23 20 61        return # a
4f70: 74 20 6c 65 61 73 74 20 6f 6e 65 20 6f 66 20 74  t least one of t
4f80: 68 65 20 70 72 6f 67 72 61 6d 73 20 77 61 73 20  he programs was 
4f90: 61 76 61 69 6c 61 62 6c 65 20 61 74 20 74 68 65  available at the
4fa0: 20 50 41 54 48 0a 20 20 20 20 66 69 0a 20 20 20   PATH.    fi.   
4fb0: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53   #--------.    S
4fc0: 5f 54 4d 50 5f 30 3d 22 5c 60 77 68 69 63 68 20  _TMP_0="\`which 
4fd0: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
4fe0: 58 45 43 55 54 41 42 4c 45 5f 33 20 32 3e 2f 64  XECUTABLE_3 2>/d
4ff0: 65 76 2f 6e 75 6c 6c 5c 60 22 0a 20 20 20 20 53  ev/null\`".    S
5000: 5f 54 4d 50 5f 31 3d 22 22 0a 20 20 20 20 53 5f  _TMP_1="".    S_
5010: 54 4d 50 5f 32 3d 22 53 5f 54 4d 50 5f 31 3d 24  TMP_2="S_TMP_1=$
5020: 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 65 76 61  S_TMP_0".    eva
5030: 6c 20 24 7b 53 5f 54 4d 50 5f 32 7d 0a 20 20 20  l ${S_TMP_2}.   
5040: 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20   #----.    if [ 
5050: 22 24 53 5f 54 4d 50 5f 31 22 20 3d 3d 20 22 22  "$S_TMP_1" == ""
5060: 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20   ] ; then.      
5070: 20 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f    if [ "$S_NAME_
5080: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
5090: 45 5f 34 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74  E_4" == "" ] ; t
50a0: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
50b0: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
50c0: 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20 62      echo "This b
50d0: 61 73 68 20 73 63 72 69 70 74 20 72 65 71 75 69  ash script requi
50e0: 72 65 73 20 74 68 61 74 20 65 69 74 68 65 72 20  res that either 
50f0: 5c 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45  \"$S_NAME_OF_THE
5100: 5f 45 58 45 43 55 54 41 42 4c 45 5f 31 5c 22 20  _EXECUTABLE_1\" 
5110: 6f 72 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  or ".           
5120: 20 65 63 68 6f 20 22 20 5c 22 24 53 5f 4e 41 4d   echo " \"$S_NAM
5130: 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41  E_OF_THE_EXECUTA
5140: 42 4c 45 5f 32 5c 22 20 6f 72 20 5c 22 24 53 5f  BLE_2\" or \"$S_
5150: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
5160: 55 54 41 42 4c 45 5f 33 5c 22 20 22 0a 20 20 20  UTABLE_3\" ".   
5170: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69           echo "i
5180: 73 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74  s available on t
5190: 68 65 20 50 41 54 48 2e 22 0a 20 20 20 20 20 20  he PATH.".      
51a0: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
51b0: 3d 3d 27 39 34 65 31 36 64 32 32 2d 62 33 33 66  =='94e16d22-b33f
51c0: 2d 34 33 30 65 2d 61 36 65 30 2d 32 31 62 31 37  -430e-a6e0-21b17
51d0: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
51e0: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
51f0: 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a            #----.
5200: 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24              cd $
5210: 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
5220: 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
5230: 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
5240: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 65 6c         fi.    el
5250: 73 65 0a 20 20 20 20 20 20 20 20 72 65 74 75 72  se.        retur
5260: 6e 20 23 20 61 74 20 6c 65 61 73 74 20 6f 6e 65  n # at least one
5270: 20 6f 66 20 74 68 65 20 70 72 6f 67 72 61 6d 73   of the programs
5280: 20 77 61 73 20 61 76 61 69 6c 61 62 6c 65 20 61   was available a
5290: 74 20 74 68 65 20 50 41 54 48 0a 20 20 20 20 66  t the PATH.    f
52a0: 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  i.    #--------.
52b0: 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 5c 60 77      S_TMP_0="\`w
52c0: 68 69 63 68 20 24 53 5f 4e 41 4d 45 5f 4f 46 5f  hich $S_NAME_OF_
52d0: 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 34  THE_EXECUTABLE_4
52e0: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 5c 60 22 0a   2>/dev/null\`".
52f0: 20 20 20 20 53 5f 54 4d 50 5f 31 3d 22 22 0a 20      S_TMP_1="". 
5300: 20 20 20 53 5f 54 4d 50 5f 32 3d 22 53 5f 54 4d     S_TMP_2="S_TM
5310: 50 5f 31 3d 24 53 5f 54 4d 50 5f 30 22 0a 20 20  P_1=$S_TMP_0".  
5320: 20 20 65 76 61 6c 20 24 7b 53 5f 54 4d 50 5f 32    eval ${S_TMP_2
5330: 7d 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20  }.    #----.    
5340: 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20  if [ "$S_TMP_1" 
5350: 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20  == "" ] ; then. 
5360: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
5370: 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 69         echo "Thi
5380: 73 20 62 61 73 68 20 73 63 72 69 70 74 20 72 65  s bash script re
5390: 71 75 69 72 65 73 20 74 68 61 74 20 65 69 74 68  quires that eith
53a0: 65 72 20 5c 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f  er \"$S_NAME_OF_
53b0: 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 31  THE_EXECUTABLE_1
53c0: 5c 22 20 6f 72 20 22 0a 20 20 20 20 20 20 20 20  \" or ".        
53d0: 65 63 68 6f 20 22 20 5c 22 24 53 5f 4e 41 4d 45  echo " \"$S_NAME
53e0: 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42  _OF_THE_EXECUTAB
53f0: 4c 45 5f 32 5c 22 20 6f 72 20 5c 22 24 53 5f 4e  LE_2\" or \"$S_N
5400: 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55  AME_OF_THE_EXECU
5410: 54 41 42 4c 45 5f 33 5c 22 20 6f 72 20 22 0a 20  TABLE_3\" or ". 
5420: 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 5c 22         echo " \"
5430: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
5440: 58 45 43 55 54 41 42 4c 45 5f 34 5c 22 20 69 73  XECUTABLE_4\" is
5450: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68   available on th
5460: 65 20 50 41 54 48 2e 22 0a 20 20 20 20 20 20 20  e PATH.".       
5470: 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 33 33   echo "GUID=='33
5480: 64 37 37 63 36 33 2d 66 38 34 31 2d 34 39 66 66  d77c63-f841-49ff
5490: 2d 61 64 64 30 2d 32 31 62 31 37 30 65 30 33 31  -add0-21b170e031
54a0: 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68  e7'".        ech
54b0: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d  o "".        #--
54c0: 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53  --.        cd $S
54d0: 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
54e0: 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
54f0: 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 65 6c  ith error.    el
5500: 73 65 0a 20 20 20 20 20 20 20 20 72 65 74 75 72  se.        retur
5510: 6e 20 23 20 61 74 20 6c 65 61 73 74 20 6f 6e 65  n # at least one
5520: 20 6f 66 20 74 68 65 20 70 72 6f 67 72 61 6d 73   of the programs
5530: 20 77 61 73 20 61 76 61 69 6c 61 62 6c 65 20 61   was available a
5540: 74 20 74 68 65 20 50 41 54 48 0a 20 20 20 20 66  t the PATH.    f
5550: 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  i.    #--------.
5560: 7d 20 23 20 66 75 6e 63 5f 61 73 73 65 72 74 5f  } # func_assert_
5570: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
5580: 32 0a 0a 66 75 6e 63 5f 61 73 73 65 72 74 5f 65  2..func_assert_e
5590: 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32  xists_on_path_t2
55a0: 20 22 62 61 73 68 22 20 20 20 20 20 23 20 74 68   "bash"     # th
55b0: 69 73 20 69 73 20 61 20 62 61 73 68 20 73 63 72  is is a bash scr
55c0: 69 70 74 20 69 74 73 65 6c 66 2c 20 62 75 74 0a  ipt itself, but.
55d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
55e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
55f0: 20 20 20 20 20 20 20 20 20 23 20 69 74 20 6d 69           # it mi
5600: 67 68 74 20 68 61 76 65 20 62 65 65 6e 20 65 78  ght have been ex
5610: 65 63 75 74 65 64 20 62 79 20 0a 20 20 20 20 20  ecuted by .     
5620: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
5630: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
5640: 20 20 20 20 23 20 73 70 65 63 69 66 79 69 6e 67      # specifying
5650: 20 74 68 65 20 66 75 6c 6c 20 70 61 74 68 20 74   the full path t
5660: 6f 20 74 68 65 20 62 61 73 68 20 63 6f 6d 6d 61  o the bash comma
5670: 6e 64 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20  nd,.            
5680: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
5690: 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 77               # w
56a0: 69 74 68 6f 75 74 20 68 61 76 69 6e 67 20 74 68  ithout having th
56b0: 65 20 62 61 73 68 20 61 76 61 69 6c 61 62 6c 65  e bash available
56c0: 20 6f 6e 20 74 68 65 20 50 41 54 48 2e 0a 0a 66   on the PATH...f
56d0: 75 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74  unc_assert_exist
56e0: 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22 62 61  s_on_path_t2 "ba
56f0: 73 65 6e 61 6d 65 22 20 23 20 66 6f 72 20 65 78  sename" # for ex
5700: 74 72 61 63 74 69 6e 67 20 66 69 6c 65 20 6e 61  tracting file na
5710: 6d 65 73 20 66 72 6f 6d 20 66 75 6c 6c 20 70 61  mes from full pa
5720: 74 68 73 0a 66 75 6e 63 5f 61 73 73 65 72 74 5f  ths.func_assert_
5730: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
5740: 32 20 22 63 61 74 22 20 20 20 20 23 20 6f 70 70  2 "cat"    # opp
5750: 6f 73 69 74 65 20 74 6f 20 73 70 6c 69 74 0a 66  osite to split.f
5760: 75 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74  unc_assert_exist
5770: 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22 73 68  s_on_path_t2 "sh
5780: 61 32 35 36 73 75 6d 22 20 22 73 68 61 32 35 36  a256sum" "sha256
5790: 22 20 22 72 68 61 73 68 22 0a 66 75 6e 63 5f 61  " "rhash".func_a
57a0: 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f  ssert_exists_on_
57b0: 70 61 74 68 5f 74 32 20 22 74 69 67 65 72 64 65  path_t2 "tigerde
57c0: 65 70 22 20 22 72 68 61 73 68 22 0a 66 75 6e 63  ep" "rhash".func
57d0: 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f  _assert_exists_o
57e0: 6e 5f 70 61 74 68 5f 74 32 20 22 77 68 69 72 6c  n_path_t2 "whirl
57f0: 70 6f 6f 6c 64 65 65 70 22 20 22 72 68 61 73 68  pooldeep" "rhash
5800: 22 0a 66 75 6e 63 5f 61 73 73 65 72 74 5f 65 78  ".func_assert_ex
5810: 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20  ists_on_path_t2 
5820: 22 74 61 72 22 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  "tar".#--------.
5830: 66 75 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73  func_assert_exis
5840: 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22 66  ts_on_path_t2 "f
5850: 69 6c 65 22 20 20 20 23 20 66 6f 72 20 63 68 65  ile"   # for che
5860: 63 6b 69 6e 67 20 74 68 65 20 4d 49 4d 45 20 74  cking the MIME t
5870: 79 70 65 20 6f 66 20 74 68 65 20 70 6f 74 65 6e  ype of the poten
5880: 74 69 61 6c 20 74 61 72 20 66 69 6c 65 0a 66 75  tial tar file.fu
5890: 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73  nc_assert_exists
58a0: 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22 66 69 6c  _on_path_t2 "fil
58b0: 65 73 69 7a 65 22 20 22 72 75 62 79 22 0a 23 2d  esize" "ruby".#-
58c0: 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 68 65 20 66 6f  -------.# The fo
58d0: 6c 6c 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e 64 73  llowing commands
58e0: 20 68 61 76 65 20 62 65 65 6e 20 61 6c 72 65 61   have been alrea
58f0: 64 79 20 63 68 65 63 6b 65 64 20 61 74 20 74 68  dy checked at th
5900: 65 20 73 74 61 72 74 20 6f 66 20 74 68 69 73 20  e start of this 
5910: 63 72 69 70 74 2e 0a 23 20 20 20 20 20 66 75 6e  cript..#     fun
5920: 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f  c_assert_exists_
5930: 6f 6e 5f 70 61 74 68 5f 74 32 20 22 67 61 77 6b  on_path_t2 "gawk
5940: 22 20 0a 23 20 20 20 20 20 66 75 6e 63 5f 61 73  " .#     func_as
5950: 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70  sert_exists_on_p
5960: 61 74 68 5f 74 32 20 22 67 72 65 70 22 0a 23 20  ath_t2 "grep".# 
5970: 20 20 20 20 66 75 6e 63 5f 61 73 73 65 72 74 5f      func_assert_
5980: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
5990: 32 20 22 75 6e 61 6d 65 22 20 20 23 20 74 6f 20  2 "uname"  # to 
59a0: 63 68 65 63 6b 20 74 68 65 20 4f 53 20 74 79 70  check the OS typ
59b0: 65 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 66 75 6e  e.#--------.#fun
59c0: 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f  c_assert_exists_
59d0: 6f 6e 5f 70 61 74 68 5f 74 32 20 22 72 65 61 64  on_path_t2 "read
59e0: 6c 69 6e 6b 22 0a 66 75 6e 63 5f 61 73 73 65 72  link".func_asser
59f0: 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68  t_exists_on_path
5a00: 5f 74 32 20 22 72 75 62 79 22 20 20 23 20 61 6e  _t2 "ruby"  # an
5a10: 79 74 68 69 6e 67 20 6f 76 65 72 2f 65 71 75 61  ything over/equa
5a20: 6c 20 76 2e 32 2e 31 20 77 69 6c 6c 20 70 72 6f  l v.2.1 will pro
5a30: 62 61 62 6c 79 20 64 6f 0a 23 66 75 6e 63 5f 61  bably do.#func_a
5a40: 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f  ssert_exists_on_
5a50: 70 61 74 68 5f 74 32 20 22 73 70 6c 69 74 22 20  path_t2 "split" 
5a60: 23 20 66 6f 72 20 63 75 74 74 69 6e 67 20 66 69  # for cutting fi
5a70: 6c 65 73 0a 23 66 75 6e 63 5f 61 73 73 65 72 74  les.#func_assert
5a80: 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f  _exists_on_path_
5a90: 74 32 20 22 74 65 73 74 22 0a 66 75 6e 63 5f 61  t2 "test".func_a
5aa0: 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f  ssert_exists_on_
5ab0: 70 61 74 68 5f 74 32 20 22 75 75 69 64 67 65 6e  path_t2 "uuidgen
5ac0: 22 20 22 75 75 69 64 22 20 23 20 47 55 49 44 20  " "uuid" # GUID 
5ad0: 67 65 6e 65 72 61 74 69 6f 6e 20 6f 6e 20 4c 69  generation on Li
5ae0: 6e 75 78 20 61 6e 64 20 42 53 44 0a 23 66 75 6e  nux and BSD.#fun
5af0: 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f  c_assert_exists_
5b00: 6f 6e 5f 70 61 74 68 5f 74 32 20 22 78 61 72 67  on_path_t2 "xarg
5b10: 73 22 20 20 23 20 6e 6f 74 20 69 6e 20 75 73 65  s"  # not in use
5b20: 20 79 65 74 20 0a 66 75 6e 63 5f 61 73 73 65 72   yet .func_asser
5b30: 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68  t_exists_on_path
5b40: 5f 74 32 20 22 77 63 22 20 23 20 66 6f 72 20 63  _t2 "wc" # for c
5b50: 68 65 63 6b 69 6e 67 20 68 61 73 68 20 6c 65 6e  hecking hash len
5b60: 67 74 68 73 20 20 20 0a 0a 23 2d 2d 2d 2d 2d 2d  gths   ..#------
5b70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5b80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5b90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5ba0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5bb0: 2d 2d 2d 2d 0a 0a 23 20 49 66 20 74 68 65 20 53  ----..# If the S
5bc0: 5f 43 41 4e 44 49 44 41 54 45 20 69 73 20 61 20  _CANDIDATE is a 
5bd0: 70 6f 73 69 74 69 76 65 20 77 68 6f 6c 65 20 6e  positive whole n
5be0: 75 6d 62 65 72 2c 20 69 6e 63 6c 75 64 69 6e 67  umber, including
5bf0: 20 30 20 61 6e 64 20 30 30 30 30 34 32 2c 20 0a   0 and 000042, .
5c00: 23 20 74 68 65 6e 20 69 74 20 72 65 74 75 72 6e  # then it return
5c10: 73 20 74 68 65 20 70 6f 73 69 74 69 76 65 20 77  s the positive w
5c20: 68 6f 6c 65 20 6e 75 6d 62 65 72 20 69 6e 20 61  hole number in a
5c30: 20 66 6f 72 6d 2c 20 77 68 65 72 65 20 0a 23 20   form, where .# 
5c40: 74 68 65 20 6c 65 61 64 69 6e 67 20 7a 65 72 6f  the leading zero
5c50: 73 20 68 61 76 65 20 62 65 65 6e 20 72 65 6d 6f  s have been remo
5c60: 76 65 64 2e 20 4f 74 68 65 72 77 69 73 65 20 69  ved. Otherwise i
5c70: 74 20 72 65 74 75 72 6e 73 0a 23 20 61 6e 20 65  t returns.# an e
5c80: 6d 70 74 79 20 73 74 72 69 6e 67 2e 20 0a 23 0a  mpty string. .#.
5c90: 23 20 20 20 20 20 22 30 30 30 30 30 22 20 2d 3e  #     "00000" ->
5ca0: 20 20 20 22 30 22 0a 23 20 20 20 20 22 2b 30 30     "0".#    "+00
5cb0: 30 30 30 22 20 2d 3e 20 20 20 22 30 22 0a 23 20  000" ->   "0".# 
5cc0: 20 20 20 22 2d 30 30 30 30 30 22 20 2d 3e 20 20     "-00000" ->  
5cd0: 20 20 22 22 0a 23 20 20 20 20 20 22 30 30 30 34    "".#     "0004
5ce0: 32 22 20 2d 3e 20 20 22 34 32 22 0a 23 20 20 20  2" ->  "42".#   
5cf0: 20 22 2b 30 30 30 34 32 22 20 2d 3e 20 20 22 34   "+00042" ->  "4
5d00: 32 22 0a 23 20 20 20 20 20 22 30 30 34 32 30 22  2".#     "00420"
5d10: 20 2d 3e 20 22 34 32 30 22 0a 23 20 20 20 20 20   -> "420".#     
5d20: 20 20 22 34 32 30 22 20 2d 3e 20 22 34 32 30 22    "420" -> "420"
5d30: 0a 23 20 20 20 20 20 20 20 22 2b 34 32 22 20 2d  .#       "+42" -
5d40: 3e 20 20 22 34 32 22 0a 23 20 20 20 20 20 20 20  >  "42".#       
5d50: 22 2d 34 32 22 20 2d 3e 20 20 20 20 22 22 0a 23  "-42" ->    "".#
5d60: 20 20 20 20 20 20 20 20 20 20 22 22 20 2d 3e 20            "" -> 
5d70: 20 20 20 22 22 0a 23 20 20 20 20 20 20 20 20 20     "".#         
5d80: 22 20 22 20 2d 3e 20 20 20 20 22 22 0a 23 20 20  " " ->    "".#  
5d90: 20 20 20 20 20 22 34 2e 32 22 20 2d 3e 20 20 20       "4.2" ->   
5da0: 20 22 22 0a 23 20 20 20 20 20 22 61 20 20 62 63   "".#     "a  bc
5db0: 22 20 2d 3e 20 20 20 20 22 22 0a 23 0a 23 20 41  " ->    "".#.# A
5dc0: 20 6d 6f 72 65 20 64 65 74 61 69 6c 65 64 20 6c   more detailed l
5dd0: 69 73 74 20 6f 66 20 74 68 65 20 63 6f 6e 76 65  ist of the conve
5de0: 72 73 69 6f 6e 20 63 61 73 65 73 20 61 72 65 20  rsion cases are 
5df0: 64 65 73 63 72 69 62 65 64 20 61 74 20 74 68 65  described at the
5e00: 0a 23 20 0a 23 20 20 20 20 20 66 75 6e 63 5f 6d  .# .#     func_m
5e10: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
5e20: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
5e30: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
5e40: 5f 74 65 73 74 65 72 5f 74 32 28 29 0a 23 0a 53  _tester_t2().#.S
5e50: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 58 5f 50 4f 53  _FUNC_MMMV_X_POS
5e60: 49 54 49 56 45 5f 57 48 4f 4c 45 5f 4e 55 4d 42  ITIVE_WHOLE_NUMB
5e70: 45 52 5f 4f 52 5f 41 4e 5f 45 4d 50 54 59 53 54  ER_OR_AN_EMPTYST
5e80: 52 49 4e 47 5f 54 31 5f 4f 55 54 3d 22 22 0a 66  RING_T1_OUT="".f
5e90: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
5ea0: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
5eb0: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
5ec0: 6e 67 5f 74 31 28 29 20 7b 20 23 20 53 5f 43 41  ng_t1() { # S_CA
5ed0: 4e 44 49 44 41 54 45 0a 20 20 20 20 6c 6f 63 61  NDIDATE.    loca
5ee0: 6c 20 53 5f 43 41 4e 44 49 44 41 54 45 3d 22 24  l S_CANDIDATE="$
5ef0: 31 22 20 23 20 54 4f 44 4f 3a 20 66 69 78 20 69  1" # TODO: fix i
5f00: 74 20 74 6f 20 68 61 6e 64 6c 65 20 61 20 63 61  t to handle a ca
5f10: 73 65 2c 20 77 68 65 72 65 20 74 68 65 20 0a 20  se, where the . 
5f20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
5f30: 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20            #     
5f40: 20 20 53 5f 43 41 4e 44 49 44 41 54 45 20 63 6f    S_CANDIDATE co
5f50: 6e 74 61 69 6e 73 20 73 70 61 63 65 73 2e 0a 20  ntains spaces.. 
5f60: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
5f70: 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 30 3d 22   local S_TMP_0="
5f80: 22 20 23 20 64 65 63 6c 61 72 61 74 69 6f 6e 0a  " # declaration.
5f90: 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f      local S_TMP_
5fa0: 31 3d 22 22 20 23 20 64 65 63 6c 61 72 61 74 69  1="" # declarati
5fb0: 6f 6e 0a 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d  on.    S_FUNC_MM
5fc0: 4d 56 5f 58 5f 50 4f 53 49 54 49 56 45 5f 57 48  MV_X_POSITIVE_WH
5fd0: 4f 4c 45 5f 4e 55 4d 42 45 52 5f 4f 52 5f 41 4e  OLE_NUMBER_OR_AN
5fe0: 5f 45 4d 50 54 59 53 54 52 49 4e 47 5f 54 31 5f  _EMPTYSTRING_T1_
5ff0: 4f 55 54 3d 22 22 0a 20 20 20 20 6c 6f 63 61 6c  OUT="".    local
6000: 20 53 42 5f 46 41 49 4c 45 44 3d 27 66 27 0a 20   SB_FAILED='f'. 
6010: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
6020: 20 69 66 20 5b 20 22 24 53 5f 43 41 4e 44 49 44   if [ "$S_CANDID
6030: 41 54 45 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68  ATE" == "" ]; th
6040: 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 46 41  en.        SB_FA
6050: 49 4c 45 44 3d 22 74 22 0a 20 20 20 20 66 69 0a  ILED="t".    fi.
6060: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
6070: 20 20 69 66 20 5b 20 22 24 53 42 5f 46 41 49 4c    if [ "$SB_FAIL
6080: 45 44 22 20 3d 3d 20 22 66 22 20 5d 3b 20 74 68  ED" == "f" ]; th
6090: 65 6e 0a 20 20 20 20 20 20 20 20 23 20 54 68 69  en.        # Thi
60a0: 73 20 69 73 20 61 20 62 75 67 66 69 78 2f 77 6f  s is a bugfix/wo
60b0: 72 6b 61 72 6f 6e 64 20 74 68 61 74 20 64 6f 65  rkarond that doe
60c0: 73 20 6e 6f 74 20 68 61 76 65 20 61 6c 6d 6f 73  s not have almos
60d0: 74 20 61 6e 79 74 68 69 6e 67 20 0a 20 20 20 20  t anything .    
60e0: 20 20 20 20 23 20 74 6f 20 64 6f 20 77 69 74 68      # to do with
60f0: 20 74 68 65 20 61 6c 67 6f 72 69 74 68 6d 20 69   the algorithm i
6100: 74 73 65 6c 66 2c 20 62 75 74 20 69 74 20 65 78  tself, but it ex
6110: 69 73 74 73 20 6f 6e 6c 79 20 74 6f 20 63 6f 70  ists only to cop
6120: 65 20 77 69 74 68 20 0a 20 20 20 20 20 20 20 20  e with .        
6130: 23 20 77 69 74 68 20 74 68 65 20 52 75 62 79 20  # with the Ruby 
6140: 6d 61 63 72 6f 20 6c 69 6e 65 2e 0a 20 20 20 20  macro line..    
6150: 20 20 20 20 23 20 62 6c 61 62 6c 61 3d 22 60 72      # blabla="`r
6160: 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27  uby -e \"print('
6170: 24 53 5f 43 41 4e 44 49 44 41 54 45 27 2e 74 6f  $S_CANDIDATE'.to
6180: 5f 73 2e 20 62 6c 61 62 6c 61 0a 20 20 20 20 20  _s. blabla.     
6190: 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 65 63 68     S_TMP_0="`ech
61a0: 6f 20 5c 22 24 53 5f 43 41 4e 44 49 44 41 54 45  o \"$S_CANDIDATE
61b0: 5c 22 20 7c 20 72 75 62 79 20 2d 65 20 5c 22 78  \" | ruby -e \"x
61c0: 3d 72 65 61 64 6c 69 6e 65 3b 20 70 72 69 6e 74  =readline; print
61d0: 28 78 2e 74 6f 5f 73 2e 67 73 75 62 28 2f 5b 5c  (x.to_s.gsub(/[\
61e0: 5c 5c 22 5c 27 5c 5c 73 5d 2b 2f 2c 27 27 29 29  \\"\'\\s]+/,''))
61f0: 3b 5c 22 20 60 22 0a 20 20 20 20 20 20 20 20 69  ;\" `".        i
6200: 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22 20 21  f [ "$S_TMP_0" !
6210: 3d 20 22 24 53 5f 43 41 4e 44 49 44 41 54 45 22  = "$S_CANDIDATE"
6220: 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
6230: 20 20 20 20 20 53 42 5f 46 41 49 4c 45 44 3d 22       SB_FAILED="
6240: 74 22 0a 20 20 20 20 20 20 20 20 66 69 20 0a 20  t".        fi . 
6250: 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
6260: 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ---.    if [ "$S
6270: 42 5f 46 41 49 4c 45 44 22 20 3d 3d 20 22 66 22  B_FAILED" == "f"
6280: 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
6290: 20 23 20 54 4f 44 4f 3a 20 54 68 65 20 6e 65 78   # TODO: The nex
62a0: 74 20 6c 69 6e 65 20 69 73 20 74 68 65 20 66 75  t line is the fu
62b0: 6e 6e 79 20 6f 6e 65 20 74 68 61 74 20 64 6f 65  nny one that doe
62c0: 73 20 6e 6f 74 20 6d 61 6b 65 20 73 65 6e 73 65  s not make sense
62d0: 2c 20 62 75 74 20 69 74 20 64 6f 63 75 6d 65 6e  , but it documen
62e0: 74 73 20 74 68 65 20 73 69 74 75 61 74 69 6f 6e  ts the situation
62f0: 2e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f  ..        S_TMP_
6300: 30 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70 72  0="`ruby -e \"pr
6310: 69 6e 74 28 27 24 53 5f 43 41 4e 44 49 44 41 54  int('$S_CANDIDAT
6320: 45 27 2e 74 6f 5f 73 2e 67 73 75 62 28 2f 5b 5c  E'.to_s.gsub(/[\
6330: 73 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a  s]+/,''));\" `".
6340: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
6350: 5f 54 4d 50 5f 30 22 20 21 3d 20 22 24 53 5f 43  _TMP_0" != "$S_C
6360: 41 4e 44 49 44 41 54 45 22 20 5d 3b 20 74 68 65  ANDIDATE" ]; the
6370: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 42  n.            SB
6380: 5f 46 41 49 4c 45 44 3d 22 74 22 0a 20 20 20 20  _FAILED="t".    
6390: 20 20 20 20 66 69 20 0a 20 20 20 20 66 69 0a 20      fi .    fi. 
63a0: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
63b0: 20 69 66 20 5b 20 22 24 53 42 5f 46 41 49 4c 45   if [ "$SB_FAILE
63c0: 44 22 20 3d 3d 20 22 66 22 20 5d 3b 20 74 68 65  D" == "f" ]; the
63d0: 6e 0a 20 20 20 20 20 20 20 20 23 20 43 6f 76 65  n.        # Cove
63e0: 72 73 20 63 61 73 65 73 20 6c 69 6b 65 20 22 2b  rs cases like "+
63f0: 22 2c 22 2b 2b 34 32 22 2c 22 2b 2b 2b 2b 2b 2b  ","++42","++++++
6400: 34 32 22 2c 22 2d 34 32 22 2c 22 34 61 62 32 22  42","-42","4ab2"
6410: 2c 22 34 2c 32 22 2c 22 34 2e 32 22 2c 22 34 32  ,"4,2","4.2","42
6420: 2e 22 2c 22 34 32 2d 22 2c 22 34 32 2b 22 2c 22  .","42-","42+","
6430: 34 2b 32 22 0a 20 20 20 20 20 20 20 20 53 5f 54  4+2".        S_T
6440: 4d 50 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c  MP_0="`ruby -e \
6450: 22 70 72 69 6e 74 28 27 24 53 5f 43 41 4e 44 49  "print('$S_CANDI
6460: 44 41 54 45 27 2e 74 6f 5f 73 2e 67 73 75 62 28  DATE'.to_s.gsub(
6470: 2f 5e 5b 2b 5d 2f 2c 27 27 29 29 3b 5c 22 20 60  /^[+]/,''));\" `
6480: 22 0a 20 20 20 20 20 20 20 20 23 20 41 74 20 74  ".        # At t
6490: 68 65 20 70 72 65 76 69 6f 75 73 20 6c 69 6e 65  he previous line
64a0: 3a 20 22 2b 22 20 2d 3e 20 22 22 0a 20 20 20 20  : "+" -> "".    
64b0: 20 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50      if [ "$S_TMP
64c0: 5f 30 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65  _0" == "" ]; the
64d0: 6e 20 20 0a 20 20 20 20 20 20 20 20 20 20 20 20  n  .            
64e0: 23 20 22 24 53 5f 43 41 4e 44 49 44 41 54 45 22  # "$S_CANDIDATE"
64f0: 20 3d 3d 20 22 2b 22 0a 20 20 20 20 20 20 20 20   == "+".        
6500: 20 20 20 20 53 42 5f 46 41 49 4c 45 44 3d 22 74      SB_FAILED="t
6510: 22 0a 20 20 20 20 20 20 20 20 65 6c 73 65 0a 20  ".        else. 
6520: 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50             S_TMP
6530: 5f 31 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70  _1="`ruby -e \"p
6540: 72 69 6e 74 28 27 24 53 5f 54 4d 50 5f 30 27 2e  rint('$S_TMP_0'.
6550: 74 6f 5f 73 2e 67 73 75 62 28 2f 5b 5c 64 5d 2b  to_s.gsub(/[\d]+
6560: 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a 20 20 20  /,''));\" `".   
6570: 20 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24           if [ "$
6580: 53 5f 54 4d 50 5f 31 22 20 21 3d 20 22 22 20 5d  S_TMP_1" != "" ]
6590: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20  ; then.         
65a0: 20 20 20 20 20 20 20 53 42 5f 46 41 49 4c 45 44         SB_FAILED
65b0: 3d 22 74 22 0a 20 20 20 20 20 20 20 20 20 20 20  ="t".           
65c0: 20 66 69 20 0a 20 20 20 20 20 20 20 20 66 69 20   fi .        fi 
65d0: 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
65e0: 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22  -----.    if [ "
65f0: 24 53 42 5f 46 41 49 4c 45 44 22 20 3d 3d 20 22  $SB_FAILED" == "
6600: 66 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  f" ]; then.     
6610: 20 20 20 23 20 41 74 20 74 68 69 73 20 6c 69 6e     # At this lin
6620: 65 20 74 68 65 20 53 5f 43 41 4e 44 49 44 41 54  e the S_CANDIDAT
6630: 45 20 69 73 20 76 61 6c 69 64 2c 20 62 75 74 20  E is valid, but 
6640: 69 74 20 6d 61 79 20 20 68 61 76 65 20 0a 20 20  it may  have .  
6650: 20 20 20 20 20 20 23 20 74 68 65 20 66 6f 6c 6c        # the foll
6660: 6f 77 69 6e 67 20 66 6f 72 6d 73 3a 20 0a 20 20  owing forms: .  
6670: 20 20 20 20 20 20 23 0a 20 20 20 20 20 20 20 20        #.        
6680: 23 20 20 20 20 20 22 30 22 2c 22 2b 30 22 2c 22  #     "0","+0","
6690: 2b 30 30 30 30 22 2c 22 2b 30 30 34 32 22 2c 22  +0000","+0042","
66a0: 2b 34 32 30 22 2c 22 30 30 30 30 22 2c 22 34 32  +420","0000","42
66b0: 22 2c 22 30 30 34 32 22 0a 20 20 20 20 20 20 20  ","0042".       
66c0: 20 23 0a 20 20 20 20 20 20 20 20 23 20 41 74 20   #.        # At 
66d0: 74 68 69 73 20 6c 69 6e 65 20 74 68 65 20 53 5f  this line the S_
66e0: 54 4d 50 5f 30 20 0a 20 20 20 20 20 20 20 20 23  TMP_0 .        #
66f0: 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 22  .        #     "
6700: 24 53 5f 43 41 4e 44 49 44 41 54 45 22 20 2d 3e  $S_CANDIDATE" ->
6710: 20 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20   "$S_TMP_0".    
6720: 20 20 20 20 23 0a 20 20 20 20 20 20 20 20 23 20      #.        # 
6730: 20 20 20 20 20 20 20 20 20 20 22 2b 30 30 30 34            "+0004
6740: 32 22 20 2d 3e 20 22 30 30 30 34 32 22 0a 20 20  2" -> "00042".  
6750: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 20 20        #         
6760: 20 20 20 20 20 20 22 2b 30 22 20 2d 3e 20 20 20        "+0" ->   
6770: 20 20 22 30 22 0a 20 20 20 20 20 20 20 20 23 0a    "0".        #.
6780: 20 20 20 20 20 20 20 20 23 20 61 74 20 6f 6e 65          # at one
6790: 20 6f 66 20 74 68 65 20 70 72 65 76 69 6f 75 73   of the previous
67a0: 20 69 66 2d 62 6c 6f 63 6b 73 2e 0a 20 20 20 20   if-blocks..    
67b0: 20 20 20 20 53 5f 54 4d 50 5f 31 3d 22 60 72 75      S_TMP_1="`ru
67c0: 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27 24  by -e \"print('$
67d0: 53 5f 54 4d 50 5f 30 27 2e 74 6f 5f 73 2e 67 73  S_TMP_0'.to_s.gs
67e0: 75 62 28 2f 5e 5b 30 5d 2b 2f 2c 27 27 29 29 3b  ub(/^[0]+/,''));
67f0: 5c 22 20 60 22 0a 20 20 20 20 20 20 20 20 69 66  \" `".        if
6800: 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20 3d 3d   [ "$S_TMP_1" ==
6810: 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20   "" ]; then.    
6820: 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d          S_FUNC_M
6830: 4d 4d 56 5f 58 5f 50 4f 53 49 54 49 56 45 5f 57  MMV_X_POSITIVE_W
6840: 48 4f 4c 45 5f 4e 55 4d 42 45 52 5f 4f 52 5f 41  HOLE_NUMBER_OR_A
6850: 4e 5f 45 4d 50 54 59 53 54 52 49 4e 47 5f 54 31  N_EMPTYSTRING_T1
6860: 5f 4f 55 54 3d 22 30 22 0a 20 20 20 20 20 20 20  _OUT="0".       
6870: 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20   else.          
6880: 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 58 5f    S_FUNC_MMMV_X_
6890: 50 4f 53 49 54 49 56 45 5f 57 48 4f 4c 45 5f 4e  POSITIVE_WHOLE_N
68a0: 55 4d 42 45 52 5f 4f 52 5f 41 4e 5f 45 4d 50 54  UMBER_OR_AN_EMPT
68b0: 59 53 54 52 49 4e 47 5f 54 31 5f 4f 55 54 3d 22  YSTRING_T1_OUT="
68c0: 24 53 5f 54 4d 50 5f 31 22 0a 20 20 20 20 20 20  $S_TMP_1".      
68d0: 20 20 66 69 20 0a 20 20 20 20 66 69 0a 7d 20 23    fi .    fi.} #
68e0: 20 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73   func_mmmv_x_pos
68f0: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
6900: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
6910: 72 69 6e 67 5f 74 31 0a 0a 0a 66 75 6e 63 5f 6d  ring_t1...func_m
6920: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
6930: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
6940: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
6950: 5f 74 65 73 74 65 72 5f 74 31 28 29 20 7b 20 23  _tester_t1() { #
6960: 20 53 5f 49 4e 20 53 5f 45 58 50 45 43 54 45 44   S_IN S_EXPECTED
6970: 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 49 4e 3d  .    local S_IN=
6980: 22 24 31 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53  "$1".    local S
6990: 5f 45 58 50 45 43 54 45 44 3d 22 24 32 22 0a 20  _EXPECTED="$2". 
69a0: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
69b0: 20 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73   func_mmmv_x_pos
69c0: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
69d0: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
69e0: 72 69 6e 67 5f 74 31 20 22 24 53 5f 49 4e 22 0a  ring_t1 "$S_IN".
69f0: 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46 55 4e 43      local S_FUNC
6a00: 3d 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 58  ="$S_FUNC_MMMV_X
6a10: 5f 50 4f 53 49 54 49 56 45 5f 57 48 4f 4c 45 5f  _POSITIVE_WHOLE_
6a20: 4e 55 4d 42 45 52 5f 4f 52 5f 41 4e 5f 45 4d 50  NUMBER_OR_AN_EMP
6a30: 54 59 53 54 52 49 4e 47 5f 54 31 5f 4f 55 54 22  TYSTRING_T1_OUT"
6a40: 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55  .    if [ "$S_FU
6a50: 4e 43 22 20 21 3d 20 22 24 53 5f 45 58 50 45 43  NC" != "$S_EXPEC
6a60: 54 45 44 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  TED" ]; then.   
6a70: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
6a80: 20 20 20 20 20 65 63 68 6f 20 22 41 20 74 65 73       echo "A tes
6a90: 74 20 6f 66 20 74 68 65 20 66 75 6e 63 5f 6d 6d  t of the func_mm
6aa0: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
6ab0: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
6ac0: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 20  _emptystring_t1 
6ad0: 66 61 69 6c 65 64 2e 22 0a 20 20 20 20 20 20 20  failed.".       
6ae0: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
6af0: 20 65 63 68 6f 20 22 20 20 20 20 53 5f 49 4e 3d   echo "    S_IN=
6b00: 24 53 5f 49 4e 22 0a 20 20 20 20 20 20 20 20 65  $S_IN".        e
6b10: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
6b20: 63 68 6f 20 22 20 20 20 20 53 5f 46 55 4e 43 3d  cho "    S_FUNC=
6b30: 24 53 5f 46 55 4e 43 22 0a 20 20 20 20 20 20 20  $S_FUNC".       
6b40: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
6b50: 20 65 63 68 6f 20 22 20 20 20 20 53 5f 45 58 50   echo "    S_EXP
6b60: 45 43 54 45 44 3d 24 53 5f 45 58 50 45 43 54 45  ECTED=$S_EXPECTE
6b70: 44 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  D".        echo 
6b80: 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  "".        #----
6b90: 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
6ba0: 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
6bb0: 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
6bc0: 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 7d  h error.    fi.}
6bd0: 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70   # func_mmmv_x_p
6be0: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
6bf0: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
6c00: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
6c10: 5f 74 31 0a 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  _t1...func_mmmv_
6c20: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
6c30: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
6c40: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
6c50: 74 65 72 5f 74 32 28 29 20 7b 20 0a 23 2d 2d 2d  ter_t2() { .#---
6c60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6c70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6c80: 2d 2d 2d 2d 2d 0a 23 20 52 45 4e 45 53 53 41 41  -----.# RENESSAA
6c90: 54 4f 52 5f 42 4c 4f 43 4b 5f 53 54 41 52 54 0a  TOR_BLOCK_START.
6ca0: 23 20 52 45 4e 45 53 53 41 41 54 4f 52 5f 42 4c  # RENESSAATOR_BL
6cb0: 4f 43 4b 5f 49 44 3d 62 6c 6f 63 6b 5f 30 34 35  OCK_ID=block_045
6cc0: 32 37 35 37 61 2d 32 62 36 66 2d 34 32 37 35 2d  2757a-2b6f-4275-
6cd0: 62 63 35 32 2d 36 33 32 30 33 30 35 30 32 31 65  bc52-6320305021e
6ce0: 37 5f 63 69 74 79 0a 23 20 52 45 4e 45 53 53 41  7_city.# RENESSA
6cf0: 41 54 4f 52 5f 53 4f 55 52 43 45 5f 4c 41 4e 47  ATOR_SOURCE_LANG
6d00: 55 41 47 45 3d 52 75 62 79 0a 23 20 52 45 4e 45  UAGE=Ruby.# RENE
6d10: 53 53 41 41 54 4f 52 5f 53 4f 55 52 43 45 5f 53  SSAATOR_SOURCE_S
6d20: 54 41 52 54 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d  TART.# #--------
6d30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6d40: 2d 2d 2d 0a 23 20 61 72 3d 41 72 72 61 79 2e 6e  ---.# ar=Array.n
6d50: 65 77 20 20 23 20 65 6c 65 6d 65 6e 74 73 20 61  ew  # elements a
6d60: 72 65 20 61 72 72 61 79 73 3a 20 5b 73 5f 69 6e  re arrays: [s_in
6d70: 2c 20 73 5f 65 78 70 65 63 74 65 64 5d 0a 23 20  , s_expected].# 
6d80: 61 72 3c 3c 5b 22 30 30 30 30 30 22 2c 22 30 22  ar<<["00000","0"
6d90: 5d 0a 23 20 61 72 3c 3c 5b 22 2b 30 30 30 30 2e  ].# ar<<["+0000.
6da0: 30 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b  0",""].# ar<<["+
6db0: 30 30 30 30 30 22 2c 22 30 22 5d 0a 23 20 61 72  00000","0"].# ar
6dc0: 3c 3c 5b 22 2b 30 22 2c 22 30 22 5d 0a 23 20 61  <<["+0","0"].# a
6dd0: 72 3c 3c 5b 22 30 22 2c 22 30 22 5d 0a 23 20 61  r<<["0","0"].# a
6de0: 72 3c 3c 5b 22 30 2b 22 2c 22 22 5d 0a 23 20 61  r<<["0+",""].# a
6df0: 72 3c 3c 5b 22 2b 30 30 30 30 2c 30 22 2c 22 22  r<<["+0000,0",""
6e00: 5d 0a 23 20 61 72 3c 3c 5b 22 2d 30 30 30 30 30  ].# ar<<["-00000
6e10: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 30  ",""].# ar<<["-0
6e20: 30 30 30 2c 30 22 2c 22 22 5d 0a 23 20 61 72 3c  000,0",""].# ar<
6e30: 3c 5b 22 2d 30 30 30 30 2e 30 22 2c 22 22 5d 0a  <["-0000.0",""].
6e40: 23 20 61 72 3c 3c 5b 22 2d 30 30 30 30 30 2d 22  # ar<<["-00000-"
6e50: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 30 30  ,""].# ar<<["000
6e60: 30 30 2d 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  00-",""].# ar<<[
6e70: 22 30 30 30 30 30 20 22 2c 22 22 5d 0a 23 20 61  "00000 ",""].# a
6e80: 72 3c 3c 5b 22 20 30 30 30 30 30 22 2c 22 22 5d  r<<[" 00000",""]
6e90: 0a 23 20 61 72 3c 3c 5b 22 2d 2d 30 30 30 30 30  .# ar<<["--00000
6ea0: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 2b  ",""].# ar<<["++
6eb0: 30 30 30 30 30 22 2c 22 22 5d 0a 23 20 61 72 3c  00000",""].# ar<
6ec0: 3c 5b 22 30 30 30 2d 30 30 22 2c 22 22 5d 0a 23  <["000-00",""].#
6ed0: 20 61 72 3c 3c 5b 22 2d 30 22 2c 22 22 5d 0a 23   ar<<["-0",""].#
6ee0: 20 61 72 3c 3c 5b 22 30 2d 22 2c 22 22 5d 0a 23   ar<<["0-",""].#
6ef0: 20 61 72 3c 3c 5b 22 30 30 30 30 2d 22 2c 22 22   ar<<["0000-",""
6f00: 5d 0a 23 20 61 72 3c 3c 5b 22 2b 30 30 30 30 2d  ].# ar<<["+0000-
6f10: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 30  ",""].# ar<<["-0
6f20: 30 30 30 2d 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  000-",""].# ar<<
6f30: 5b 22 2d 30 30 30 30 2b 22 2c 22 22 5d 0a 23 20  ["-0000+",""].# 
6f40: 61 72 3c 3c 5b 22 30 30 30 30 2b 22 2c 22 22 5d  ar<<["0000+",""]
6f50: 0a 23 20 61 72 3c 3c 5b 22 30 30 30 2b 30 30 22  .# ar<<["000+00"
6f60: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 30 30  ,""].# ar<<["000
6f70: 34 32 22 2c 22 34 32 22 5d 0a 23 20 61 72 3c 3c  42","42"].# ar<<
6f80: 5b 22 2b 30 30 30 34 32 22 2c 22 34 32 22 5d 0a  ["+00042","42"].
6f90: 23 20 61 72 3c 3c 5b 22 30 30 34 32 30 22 2c 22  # ar<<["00420","
6fa0: 34 32 30 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 30  420"].# ar<<["+0
6fb0: 30 34 32 30 22 2c 22 34 32 30 22 5d 0a 23 20 61  0420","420"].# a
6fc0: 72 3c 3c 5b 22 30 30 34 32 30 2b 22 2c 22 22 5d  r<<["00420+",""]
6fd0: 0a 23 20 61 72 3c 3c 5b 22 30 30 34 2b 32 30 22  .# ar<<["004+20"
6fe0: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 32 30  ,""].# ar<<["420
6ff0: 22 2c 22 34 32 30 22 5d 0a 23 20 61 72 3c 3c 5b  ","420"].# ar<<[
7000: 22 2b 34 32 30 22 2c 22 34 32 30 22 5d 0a 23 20  "+420","420"].# 
7010: 61 72 3c 3c 5b 22 34 32 30 2b 22 2c 22 22 5d 0a  ar<<["420+",""].
7020: 23 20 61 72 3c 3c 5b 22 31 22 2c 22 31 22 5d 0a  # ar<<["1","1"].
7030: 23 20 61 72 3c 3c 5b 22 2d 31 22 2c 22 22 5d 0a  # ar<<["-1",""].
7040: 23 20 61 72 3c 3c 5b 22 31 2d 22 2c 22 22 5d 0a  # ar<<["1-",""].
7050: 23 20 61 72 3c 3c 5b 22 2b 31 22 2c 22 31 22 5d  # ar<<["+1","1"]
7060: 0a 23 20 61 72 3c 3c 5b 22 39 22 2c 22 39 22 5d  .# ar<<["9","9"]
7070: 0a 23 20 61 72 3c 3c 5b 22 2b 39 22 2c 22 39 22  .# ar<<["+9","9"
7080: 5d 0a 23 20 61 72 3c 3c 5b 22 39 30 30 30 22 2c  ].# ar<<["9000",
7090: 22 39 30 30 30 22 5d 0a 23 20 61 72 3c 3c 5b 22  "9000"].# ar<<["
70a0: 30 39 30 30 30 22 2c 22 39 30 30 30 22 5d 0a 23  09000","9000"].#
70b0: 20 61 72 3c 3c 5b 22 2b 30 39 30 30 30 22 2c 22   ar<<["+09000","
70c0: 39 30 30 30 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b  9000"].# ar<<["+
70d0: 2b 30 39 30 30 30 22 2c 22 22 5d 0a 23 20 61 72  +09000",""].# ar
70e0: 3c 3c 5b 22 30 39 30 30 30 2b 22 2c 22 22 5d 0a  <<["09000+",""].
70f0: 23 20 61 72 3c 3c 5b 22 30 39 30 30 30 2d 22 2c  # ar<<["09000-",
7100: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 39 30 30  ""].# ar<<["0900
7110: 30 2d 2d 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  0--",""].# ar<<[
7120: 22 2d 39 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  "-9",""].# ar<<[
7130: 22 2b 2b 39 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  "++9",""].# ar<<
7140: 5b 22 39 2b 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  ["9+",""].# ar<<
7150: 5b 22 39 2b 2b 22 2c 22 22 5d 0a 23 20 61 72 3c  ["9++",""].# ar<
7160: 3c 5b 22 39 2b 2d 22 2c 22 22 5d 0a 23 20 61 72  <["9+-",""].# ar
7170: 3c 3c 5b 22 2b 2d 39 22 2c 22 22 5d 0a 23 20 61  <<["+-9",""].# a
7180: 72 3c 3c 5b 22 34 32 22 2c 22 34 32 22 5d 0a 23  r<<["42","42"].#
7190: 20 61 72 3c 3c 5b 22 2b 34 32 22 2c 22 34 32 22   ar<<["+42","42"
71a0: 5d 0a 23 20 61 72 3c 3c 5b 22 2b 2b 34 32 22 2c  ].# ar<<["++42",
71b0: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 34 32 20  ""].# ar<<["+42 
71c0: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 34  ",""].# ar<<["+4
71d0: 20 32 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22   2",""].# ar<<["
71e0: 20 2b 34 20 32 22 2c 22 22 5d 0a 23 20 61 72 3c   +4 2",""].# ar<
71f0: 3c 5b 22 20 2b 34 32 22 2c 22 22 5d 0a 23 20 61  <[" +42",""].# a
7200: 72 3c 3c 5b 22 2d 34 32 22 2c 22 22 5d 0a 23 20  r<<["-42",""].# 
7210: 61 72 3c 3c 5b 22 20 2d 34 32 22 2c 22 22 5d 0a  ar<<[" -42",""].
7220: 23 20 61 72 3c 3c 5b 22 20 2d 34 32 20 22 2c 22  # ar<<[" -42 ","
7230: 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 2d 34 32 22  "].# ar<<["--42"
7240: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 2d 2d  ,""].# ar<<["---
7250: 2d 34 32 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  -42",""].# ar<<[
7260: 22 2b 34 32 2d 2d 2d 22 2c 22 22 5d 0a 23 20 61  "+42---",""].# a
7270: 72 3c 3c 5b 22 2d 34 2d 32 22 2c 22 22 5d 0a 23  r<<["-4-2",""].#
7280: 20 61 72 3c 3c 5b 22 2d 34 2d 32 2d 22 2c 22 22   ar<<["-4-2-",""
7290: 5d 0a 23 20 61 72 3c 3c 5b 22 34 2d 32 2d 22 2c  ].# ar<<["4-2-",
72a0: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 32 2d 22  ""].# ar<<["42-"
72b0: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 32 2d  ,""].# ar<<["42-
72c0: 2d 2d 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  --",""].# ar<<["
72d0: 2b 34 2b 32 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  +4+2",""].# ar<<
72e0: 5b 22 34 2b 32 22 2c 22 22 5d 0a 23 20 61 72 3c  ["4+2",""].# ar<
72f0: 3c 5b 22 34 32 2b 22 2c 22 22 5d 0a 23 20 61 72  <["42+",""].# ar
7300: 3c 3c 5b 22 34 32 2b 2b 2b 22 2c 22 22 5d 0a 23  <<["42+++",""].#
7310: 20 61 72 3c 3c 5b 22 2b 34 32 2b 22 2c 22 22 5d   ar<<["+42+",""]
7320: 0a 23 20 61 72 3c 3c 5b 22 34 2e 32 22 2c 22 22  .# ar<<["4.2",""
7330: 5d 0a 23 20 61 72 3c 3c 5b 22 34 2c 32 22 2c 22  ].# ar<<["4,2","
7340: 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 20 32 22 2c  "].# ar<<["4 2",
7350: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 20 2b 32  ""].# ar<<["4 +2
7360: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 20  ",""].# ar<<["4 
7370: 32 2b 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  2+",""].# ar<<["
7380: 34 32 20 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  42 ",""].# ar<<[
7390: 22 34 32 2e 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  "42.",""].# ar<<
73a0: 5b 22 34 32 2c 22 2c 22 22 5d 0a 23 20 61 72 3c  ["42,",""].# ar<
73b0: 3c 5b 22 61 20 20 62 63 22 2c 22 22 5d 0a 23 20  <["a  bc",""].# 
73c0: 61 72 3c 3c 5b 22 22 2c 22 22 5d 0a 23 20 61 72  ar<<["",""].# ar
73d0: 3c 3c 5b 22 2b 22 2c 22 22 5d 0a 23 20 61 72 3c  <<["+",""].# ar<
73e0: 3c 5b 22 2b 2b 22 2c 22 22 5d 0a 23 20 61 72 3c  <["++",""].# ar<
73f0: 3c 5b 22 2b 2b 2b 22 2c 22 22 5d 0a 23 20 61 72  <["+++",""].# ar
7400: 3c 3c 5b 22 2d 22 2c 22 22 5d 0a 23 20 61 72 3c  <<["-",""].# ar<
7410: 3c 5b 22 2d 2d 22 2c 22 22 5d 0a 23 20 61 72 3c  <["--",""].# ar<
7420: 3c 5b 22 2d 2d 2d 22 2c 22 22 5d 0a 23 20 61 72  <["---",""].# ar
7430: 3c 3c 5b 22 2d 2b 22 2c 22 22 5d 0a 23 20 61 72  <<["-+",""].# ar
7440: 3c 3c 5b 22 2b 2d 22 2c 22 22 5d 0a 23 20 61 72  <<["+-",""].# ar
7450: 3c 3c 5b 22 2b 2d 2d 2d 22 2c 22 22 5d 0a 23 20  <<["+---",""].# 
7460: 61 72 3c 3c 5b 22 5c 5c 5c 22 22 2c 22 22 5d 0a  ar<<["\\\"",""].
7470: 23 20 61 72 3c 3c 5b 22 27 22 2c 22 22 5d 0a 23  # ar<<["'",""].#
7480: 20 61 72 3c 3c 5b 22 27 34 32 22 2c 22 22 5d 0a   ar<<["'42",""].
7490: 23 20 61 72 3c 3c 5b 22 34 32 27 22 2c 22 22 5d  # ar<<["42'",""]
74a0: 0a 23 20 61 72 3c 3c 5b 22 20 22 2c 22 22 5d 0a  .# ar<<[" ",""].
74b0: 23 20 61 72 3c 3c 5b 22 20 20 20 22 2c 22 22 5d  # ar<<["   ",""]
74c0: 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .# #------------
74d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
74e0: 23 20 68 74 3d 48 61 73 68 2e 6e 65 77 0a 23 20  # ht=Hash.new.# 
74f0: 61 72 2e 65 61 63 68 20 64 6f 20 7c 61 72 5f 30  ar.each do |ar_0
7500: 7c 0a 23 20 78 5f 30 3d 61 72 5f 30 5b 30 5d 0a  |.# x_0=ar_0[0].
7510: 23 20 69 66 20 68 74 2e 68 61 73 5f 6b 65 79 3f  # if ht.has_key?
7520: 20 78 5f 30 0a 23 20 72 61 69 73 65 20 45 78 63   x_0.# raise Exc
7530: 65 70 74 69 6f 6e 2e 6e 65 77 28 22 5c 6e 44 75  eption.new("\nDu
7540: 70 6c 69 63 61 74 65 3a 5b 22 2b 78 5f 30 2e 74  plicate:["+x_0.t
7550: 6f 5f 73 2b 22 5d 5c 6e 22 29 0a 23 20 65 6c 73  o_s+"]\n").# els
7560: 65 0a 23 20 68 74 5b 78 5f 30 5d 3d 34 32 0a 23  e.# ht[x_0]=42.#
7570: 20 65 6e 64 20 23 20 69 66 0a 23 20 65 6e 64 20   end # if.# end 
7580: 23 20 6c 6f 6f 70 0a 23 20 23 2d 2d 2d 2d 2d 2d  # loop.# #------
7590: 2d 2d 0a 23 20 73 5f 74 65 73 74 5f 66 75 6e 63  --.# s_test_func
75a0: 5f 6e 61 6d 65 3d 22 66 75 6e 63 5f 6d 6d 6d 76  _name="func_mmmv
75b0: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
75c0: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
75d0: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
75e0: 73 74 65 72 5f 74 31 22 0a 23 20 73 5f 6c 63 5f  ster_t1".# s_lc_
75f0: 30 3d 73 5f 74 65 73 74 5f 66 75 6e 63 5f 6e 61  0=s_test_func_na
7600: 6d 65 2b 22 20 20 5c 22 22 0a 23 20 73 5f 6c 63  me+"  \"".# s_lc
7610: 5f 31 3d 22 5c 22 20 20 5c 22 22 0a 23 20 73 5f  _1="\"  \"".# s_
7620: 6c 63 5f 32 3d 22 5c 22 22 0a 23 20 66 75 6e 63  lc_2="\"".# func
7630: 5f 77 72 69 74 65 5f 74 65 73 74 3d 6c 61 6d 62  _write_test=lamb
7640: 64 61 20 64 6f 20 7c 73 5f 69 6e 2c 73 5f 65 78  da do |s_in,s_ex
7650: 70 65 63 74 65 64 7c 0a 23 20 70 75 74 73 28 73  pected|.# puts(s
7660: 5f 6c 63 5f 30 2b 73 5f 69 6e 2b 73 5f 6c 63 5f  _lc_0+s_in+s_lc_
7670: 31 2b 73 5f 65 78 70 65 63 74 65 64 2b 73 5f 6c  1+s_expected+s_l
7680: 63 5f 32 2b 22 5c 6e 22 29 0a 23 20 65 6e 64 20  c_2+"\n").# end 
7690: 23 20 66 75 6e 63 5f 77 72 69 74 65 5f 74 65 73  # func_write_tes
76a0: 74 0a 23 20 61 72 2e 65 61 63 68 7b 7c 61 72 5f  t.# ar.each{|ar_
76b0: 30 7c 20 66 75 6e 63 5f 77 72 69 74 65 5f 74 65  0| func_write_te
76c0: 73 74 2e 63 61 6c 6c 28 61 72 5f 30 5b 30 5d 2c  st.call(ar_0[0],
76d0: 61 72 5f 30 5b 31 5d 29 7d 0a 23 20 52 45 4e 45  ar_0[1])}.# RENE
76e0: 53 53 41 41 54 4f 52 5f 53 4f 55 52 43 45 5f 45  SSAATOR_SOURCE_E
76f0: 4e 44 0a 23 20 0a 23 20 52 45 4e 45 53 53 41 41  ND.# .# RENESSAA
7700: 54 4f 52 5f 41 55 54 4f 47 45 4e 45 52 41 54 45  TOR_AUTOGENERATE
7710: 44 5f 54 45 58 54 5f 53 54 41 52 54 0a 66 75 6e  D_TEXT_START.fun
7720: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
7730: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
7740: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
7750: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
7760: 30 30 30 30 30 22 20 20 22 30 22 0a 66 75 6e 63  00000"  "0".func
7770: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
7780: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
7790: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
77a0: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b  t1_tester_t1  "+
77b0: 30 30 30 30 2e 30 22 20 20 22 22 0a 66 75 6e 63  0000.0"  "".func
77c0: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
77d0: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
77e0: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
77f0: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b  t1_tester_t1  "+
7800: 30 30 30 30 30 22 20 20 22 30 22 0a 66 75 6e 63  00000"  "0".func
7810: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
7820: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
7830: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
7840: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b  t1_tester_t1  "+
7850: 30 22 20 20 22 30 22 0a 66 75 6e 63 5f 6d 6d 6d  0"  "0".func_mmm
7860: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
7870: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
7880: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
7890: 65 73 74 65 72 5f 74 31 20 20 22 30 22 20 20 22  ester_t1  "0"  "
78a0: 30 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  0".func_mmmv_x_p
78b0: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
78c0: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
78d0: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
78e0: 5f 74 31 20 20 22 30 2b 22 20 20 22 22 0a 66 75  _t1  "0+"  "".fu
78f0: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
7900: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
7910: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
7920: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
7930: 22 2b 30 30 30 30 2c 30 22 20 20 22 22 0a 66 75  "+0000,0"  "".fu
7940: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
7950: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
7960: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
7970: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
7980: 22 2d 30 30 30 30 30 22 20 20 22 22 0a 66 75 6e  "-00000"  "".fun
7990: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
79a0: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
79b0: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
79c0: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
79d0: 2d 30 30 30 30 2c 30 22 20 20 22 22 0a 66 75 6e  -0000,0"  "".fun
79e0: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
79f0: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
7a00: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
7a10: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
7a20: 2d 30 30 30 30 2e 30 22 20 20 22 22 0a 66 75 6e  -0000.0"  "".fun
7a30: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
7a40: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
7a50: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
7a60: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
7a70: 2d 30 30 30 30 30 2d 22 20 20 22 22 0a 66 75 6e  -00000-"  "".fun
7a80: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
7a90: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
7aa0: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
7ab0: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
7ac0: 30 30 30 30 30 2d 22 20 20 22 22 0a 66 75 6e 63  00000-"  "".func
7ad0: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
7ae0: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
7af0: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
7b00: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 30  t1_tester_t1  "0
7b10: 30 30 30 30 20 22 20 20 22 22 0a 66 75 6e 63 5f  0000 "  "".func_
7b20: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
7b30: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
7b40: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
7b50: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 20 30  1_tester_t1  " 0
7b60: 30 30 30 30 22 20 20 22 22 0a 66 75 6e 63 5f 6d  0000"  "".func_m
7b70: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
7b80: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
7b90: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
7ba0: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2d 2d 30  _tester_t1  "--0
7bb0: 30 30 30 30 22 20 20 22 22 0a 66 75 6e 63 5f 6d  0000"  "".func_m
7bc0: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
7bd0: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
7be0: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
7bf0: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b 2b 30  _tester_t1  "++0
7c00: 30 30 30 30 22 20 20 22 22 0a 66 75 6e 63 5f 6d  0000"  "".func_m
7c10: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
7c20: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
7c30: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
7c40: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 30 30 30  _tester_t1  "000
7c50: 2d 30 30 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d  -00"  "".func_mm
7c60: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
7c70: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
7c80: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
7c90: 74 65 73 74 65 72 5f 74 31 20 20 22 2d 30 22 20  tester_t1  "-0" 
7ca0: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
7cb0: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
7cc0: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
7cd0: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
7ce0: 72 5f 74 31 20 20 22 30 2d 22 20 20 22 22 0a 66  r_t1  "0-"  "".f
7cf0: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
7d00: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
7d10: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
7d20: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
7d30: 20 22 30 30 30 30 2d 22 20 20 22 22 0a 66 75 6e   "0000-"  "".fun
7d40: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
7d50: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
7d60: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
7d70: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
7d80: 2b 30 30 30 30 2d 22 20 20 22 22 0a 66 75 6e 63  +0000-"  "".func
7d90: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
7da0: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
7db0: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
7dc0: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2d  t1_tester_t1  "-
7dd0: 30 30 30 30 2d 22 20 20 22 22 0a 66 75 6e 63 5f  0000-"  "".func_
7de0: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
7df0: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
7e00: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
7e10: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2d 30  1_tester_t1  "-0
7e20: 30 30 30 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d  000+"  "".func_m
7e30: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
7e40: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
7e50: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
7e60: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 30 30 30  _tester_t1  "000
7e70: 30 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d  0+"  "".func_mmm
7e80: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
7e90: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
7ea0: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
7eb0: 65 73 74 65 72 5f 74 31 20 20 22 30 30 30 2b 30  ester_t1  "000+0
7ec0: 30 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  0"  "".func_mmmv
7ed0: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
7ee0: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
7ef0: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
7f00: 73 74 65 72 5f 74 31 20 20 22 30 30 30 34 32 22  ster_t1  "00042"
7f10: 20 20 22 34 32 22 0a 66 75 6e 63 5f 6d 6d 6d 76    "42".func_mmmv
7f20: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
7f30: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
7f40: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
7f50: 73 74 65 72 5f 74 31 20 20 22 2b 30 30 30 34 32  ster_t1  "+00042
7f60: 22 20 20 22 34 32 22 0a 66 75 6e 63 5f 6d 6d 6d  "  "42".func_mmm
7f70: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
7f80: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
7f90: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
7fa0: 65 73 74 65 72 5f 74 31 20 20 22 30 30 34 32 30  ester_t1  "00420
7fb0: 22 20 20 22 34 32 30 22 0a 66 75 6e 63 5f 6d 6d  "  "420".func_mm
7fc0: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
7fd0: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
7fe0: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
7ff0: 74 65 73 74 65 72 5f 74 31 20 20 22 2b 30 30 34  tester_t1  "+004
8000: 32 30 22 20 20 22 34 32 30 22 0a 66 75 6e 63 5f  20"  "420".func_
8010: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
8020: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
8030: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
8040: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 30 30  1_tester_t1  "00
8050: 34 32 30 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d  420+"  "".func_m
8060: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
8070: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
8080: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
8090: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 30 30 34  _tester_t1  "004
80a0: 2b 32 30 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d  +20"  "".func_mm
80b0: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
80c0: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
80d0: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
80e0: 74 65 73 74 65 72 5f 74 31 20 20 22 34 32 30 22  tester_t1  "420"
80f0: 20 20 22 34 32 30 22 0a 66 75 6e 63 5f 6d 6d 6d    "420".func_mmm
8100: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
8110: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
8120: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
8130: 65 73 74 65 72 5f 74 31 20 20 22 2b 34 32 30 22  ester_t1  "+420"
8140: 20 20 22 34 32 30 22 0a 66 75 6e 63 5f 6d 6d 6d    "420".func_mmm
8150: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
8160: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
8170: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
8180: 65 73 74 65 72 5f 74 31 20 20 22 34 32 30 2b 22  ester_t1  "420+"
8190: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
81a0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
81b0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
81c0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
81d0: 65 72 5f 74 31 20 20 22 31 22 20 20 22 31 22 0a  er_t1  "1"  "1".
81e0: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
81f0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
8200: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
8210: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
8220: 20 20 22 2d 31 22 20 20 22 22 0a 66 75 6e 63 5f    "-1"  "".func_
8230: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
8240: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
8250: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
8260: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 31 2d  1_tester_t1  "1-
8270: 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  "  "".func_mmmv_
8280: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
8290: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
82a0: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
82b0: 74 65 72 5f 74 31 20 20 22 2b 31 22 20 20 22 31  ter_t1  "+1"  "1
82c0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
82d0: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
82e0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
82f0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
8300: 74 31 20 20 22 39 22 20 20 22 39 22 0a 66 75 6e  t1  "9"  "9".fun
8310: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
8320: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
8330: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
8340: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
8350: 2b 39 22 20 20 22 39 22 0a 66 75 6e 63 5f 6d 6d  +9"  "9".func_mm
8360: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
8370: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
8380: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
8390: 74 65 73 74 65 72 5f 74 31 20 20 22 39 30 30 30  tester_t1  "9000
83a0: 22 20 20 22 39 30 30 30 22 0a 66 75 6e 63 5f 6d  "  "9000".func_m
83b0: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
83c0: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
83d0: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
83e0: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 30 39 30  _tester_t1  "090
83f0: 30 30 22 20 20 22 39 30 30 30 22 0a 66 75 6e 63  00"  "9000".func
8400: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
8410: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
8420: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
8430: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b  t1_tester_t1  "+
8440: 30 39 30 30 30 22 20 20 22 39 30 30 30 22 0a 66  09000"  "9000".f
8450: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
8460: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
8470: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
8480: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
8490: 20 22 2b 2b 30 39 30 30 30 22 20 20 22 22 0a 66   "++09000"  "".f
84a0: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
84b0: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
84c0: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
84d0: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
84e0: 20 22 30 39 30 30 30 2b 22 20 20 22 22 0a 66 75   "09000+"  "".fu
84f0: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
8500: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
8510: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
8520: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
8530: 22 30 39 30 30 30 2d 22 20 20 22 22 0a 66 75 6e  "09000-"  "".fun
8540: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
8550: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
8560: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
8570: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
8580: 30 39 30 30 30 2d 2d 22 20 20 22 22 0a 66 75 6e  09000--"  "".fun
8590: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
85a0: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
85b0: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
85c0: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
85d0: 2d 39 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d  -9"  "".func_mmm
85e0: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
85f0: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
8600: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
8610: 65 73 74 65 72 5f 74 31 20 20 22 2b 2b 39 22 20  ester_t1  "++9" 
8620: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
8630: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
8640: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
8650: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
8660: 72 5f 74 31 20 20 22 39 2b 22 20 20 22 22 0a 66  r_t1  "9+"  "".f
8670: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
8680: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
8690: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
86a0: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
86b0: 20 22 39 2b 2b 22 20 20 22 22 0a 66 75 6e 63 5f   "9++"  "".func_
86c0: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
86d0: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
86e0: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
86f0: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 39 2b  1_tester_t1  "9+
8700: 2d 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  -"  "".func_mmmv
8710: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
8720: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
8730: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
8740: 73 74 65 72 5f 74 31 20 20 22 2b 2d 39 22 20 20  ster_t1  "+-9"  
8750: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
8760: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
8770: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
8780: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
8790: 5f 74 31 20 20 22 34 32 22 20 20 22 34 32 22 0a  _t1  "42"  "42".
87a0: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
87b0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
87c0: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
87d0: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
87e0: 20 20 22 2b 34 32 22 20 20 22 34 32 22 0a 66 75    "+42"  "42".fu
87f0: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
8800: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
8810: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
8820: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
8830: 22 2b 2b 34 32 22 20 20 22 22 0a 66 75 6e 63 5f  "++42"  "".func_
8840: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
8850: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
8860: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
8870: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b 34  1_tester_t1  "+4
8880: 32 20 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d  2 "  "".func_mmm
8890: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
88a0: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
88b0: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
88c0: 65 73 74 65 72 5f 74 31 20 20 22 2b 34 20 32 22  ester_t1  "+4 2"
88d0: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
88e0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
88f0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
8900: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
8910: 65 72 5f 74 31 20 20 22 20 2b 34 20 32 22 20 20  er_t1  " +4 2"  
8920: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
8930: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
8940: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
8950: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
8960: 5f 74 31 20 20 22 20 2b 34 32 22 20 20 22 22 0a  _t1  " +42"  "".
8970: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
8980: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
8990: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
89a0: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
89b0: 20 20 22 2d 34 32 22 20 20 22 22 0a 66 75 6e 63    "-42"  "".func
89c0: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
89d0: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
89e0: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
89f0: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 20  t1_tester_t1  " 
8a00: 2d 34 32 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d  -42"  "".func_mm
8a10: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
8a20: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
8a30: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
8a40: 74 65 73 74 65 72 5f 74 31 20 20 22 20 2d 34 32  tester_t1  " -42
8a50: 20 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76   "  "".func_mmmv
8a60: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
8a70: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
8a80: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
8a90: 73 74 65 72 5f 74 31 20 20 22 2d 2d 34 32 22 20  ster_t1  "--42" 
8aa0: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
8ab0: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
8ac0: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
8ad0: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
8ae0: 72 5f 74 31 20 20 22 2d 2d 2d 2d 34 32 22 20 20  r_t1  "----42"  
8af0: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
8b00: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
8b10: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
8b20: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
8b30: 5f 74 31 20 20 22 2b 34 32 2d 2d 2d 22 20 20 22  _t1  "+42---"  "
8b40: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
8b50: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
8b60: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
8b70: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
8b80: 74 31 20 20 22 2d 34 2d 32 22 20 20 22 22 0a 66  t1  "-4-2"  "".f
8b90: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
8ba0: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
8bb0: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
8bc0: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
8bd0: 20 22 2d 34 2d 32 2d 22 20 20 22 22 0a 66 75 6e   "-4-2-"  "".fun
8be0: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
8bf0: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
8c00: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
8c10: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
8c20: 34 2d 32 2d 22 20 20 22 22 0a 66 75 6e 63 5f 6d  4-2-"  "".func_m
8c30: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
8c40: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
8c50: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
8c60: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 34 32 2d  _tester_t1  "42-
8c70: 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  "  "".func_mmmv_
8c80: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
8c90: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
8ca0: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
8cb0: 74 65 72 5f 74 31 20 20 22 34 32 2d 2d 2d 22 20  ter_t1  "42---" 
8cc0: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
8cd0: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
8ce0: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
8cf0: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
8d00: 72 5f 74 31 20 20 22 2b 34 2b 32 22 20 20 22 22  r_t1  "+4+2"  ""
8d10: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73  .func_mmmv_x_pos
8d20: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
8d30: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
8d40: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
8d50: 31 20 20 22 34 2b 32 22 20 20 22 22 0a 66 75 6e  1  "4+2"  "".fun
8d60: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
8d70: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
8d80: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
8d90: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
8da0: 34 32 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d  42+"  "".func_mm
8db0: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
8dc0: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
8dd0: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
8de0: 74 65 73 74 65 72 5f 74 31 20 20 22 34 32 2b 2b  tester_t1  "42++
8df0: 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  +"  "".func_mmmv
8e00: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
8e10: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
8e20: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
8e30: 73 74 65 72 5f 74 31 20 20 22 2b 34 32 2b 22 20  ster_t1  "+42+" 
8e40: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
8e50: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
8e60: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
8e70: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
8e80: 72 5f 74 31 20 20 22 34 2e 32 22 20 20 22 22 0a  r_t1  "4.2"  "".
8e90: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
8ea0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
8eb0: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
8ec0: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
8ed0: 20 20 22 34 2c 32 22 20 20 22 22 0a 66 75 6e 63    "4,2"  "".func
8ee0: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
8ef0: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
8f00: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
8f10: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 34  t1_tester_t1  "4
8f20: 20 32 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d   2"  "".func_mmm
8f30: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
8f40: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
8f50: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
8f60: 65 73 74 65 72 5f 74 31 20 20 22 34 20 2b 32 22  ester_t1  "4 +2"
8f70: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
8f80: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
8f90: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
8fa0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
8fb0: 65 72 5f 74 31 20 20 22 34 20 32 2b 22 20 20 22  er_t1  "4 2+"  "
8fc0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
8fd0: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
8fe0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
8ff0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
9000: 74 31 20 20 22 34 32 20 22 20 20 22 22 0a 66 75  t1  "42 "  "".fu
9010: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
9020: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
9030: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
9040: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
9050: 22 34 32 2e 22 20 20 22 22 0a 66 75 6e 63 5f 6d  "42."  "".func_m
9060: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
9070: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
9080: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
9090: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 34 32 2c  _tester_t1  "42,
90a0: 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  "  "".func_mmmv_
90b0: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
90c0: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
90d0: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
90e0: 74 65 72 5f 74 31 20 20 22 61 20 20 62 63 22 20  ter_t1  "a  bc" 
90f0: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
9100: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
9110: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
9120: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
9130: 72 5f 74 31 20 20 22 22 20 20 22 22 0a 66 75 6e  r_t1  ""  "".fun
9140: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
9150: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
9160: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
9170: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
9180: 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  +"  "".func_mmmv
9190: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
91a0: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
91b0: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
91c0: 73 74 65 72 5f 74 31 20 20 22 2b 2b 22 20 20 22  ster_t1  "++"  "
91d0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
91e0: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
91f0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
9200: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
9210: 74 31 20 20 22 2b 2b 2b 22 20 20 22 22 0a 66 75  t1  "+++"  "".fu
9220: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
9230: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
9240: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
9250: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
9260: 22 2d 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d  "-"  "".func_mmm
9270: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
9280: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
9290: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
92a0: 65 73 74 65 72 5f 74 31 20 20 22 2d 2d 22 20 20  ester_t1  "--"  
92b0: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
92c0: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
92d0: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
92e0: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
92f0: 5f 74 31 20 20 22 2d 2d 2d 22 20 20 22 22 0a 66  _t1  "---"  "".f
9300: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
9310: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
9320: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
9330: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
9340: 20 22 2d 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d   "-+"  "".func_m
9350: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
9360: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
9370: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
9380: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b 2d 22  _tester_t1  "+-"
9390: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
93a0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
93b0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
93c0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
93d0: 65 72 5f 74 31 20 20 22 2b 2d 2d 2d 22 20 20 22  er_t1  "+---"  "
93e0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
93f0: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
9400: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
9410: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
9420: 74 31 20 20 22 5c 22 22 20 20 22 22 0a 66 75 6e  t1  "\""  "".fun
9430: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
9440: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
9450: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
9460: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
9470: 27 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  '"  "".func_mmmv
9480: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
9490: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
94a0: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
94b0: 73 74 65 72 5f 74 31 20 20 22 27 34 32 22 20 20  ster_t1  "'42"  
94c0: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
94d0: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
94e0: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
94f0: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
9500: 5f 74 31 20 20 22 34 32 27 22 20 20 22 22 0a 66  _t1  "42'"  "".f
9510: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
9520: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
9530: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
9540: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
9550: 20 22 20 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d   " "  "".func_mm
9560: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
9570: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
9580: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
9590: 74 65 73 74 65 72 5f 74 31 20 20 22 20 20 20 22  tester_t1  "   "
95a0: 20 20 22 22 0a 0a 23 20 52 45 4e 45 53 53 41 41    ""..# RENESSAA
95b0: 54 4f 52 5f 41 55 54 4f 47 45 4e 45 52 41 54 45  TOR_AUTOGENERATE
95c0: 44 5f 54 45 58 54 5f 45 4e 44 0a 23 20 52 45 4e  D_TEXT_END.# REN
95d0: 45 53 53 41 41 54 4f 52 5f 42 4c 4f 43 4b 5f 45  ESSAATOR_BLOCK_E
95e0: 4e 44 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ND.#------------
95f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23  ------------.} #
9610: 20 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73   func_mmmv_x_pos
9620: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
9630: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
9640: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
9650: 32 0a 0a 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 78  2..# func_mmmv_x
9660: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
9670: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
9680: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
9690: 65 72 5f 74 32 0a 23 20 65 78 69 74 20 31 20 23  er_t2.# exit 1 #
96a0: 20 65 78 69 74 20 77 69 74 68 20 61 6e 20 65 72   exit with an er
96b0: 72 6f 72 2c 20 62 65 63 61 75 73 65 20 74 68 65  ror, because the
96c0: 20 74 65 73 74 20 63 6f 64 65 20 73 68 6f 75 6c   test code shoul
96d0: 64 20 62 65 20 6f 75 74 63 6f 6d 6d 65 6e 74 65  d be outcommente
96e0: 64 2e 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  d...#-----------
96f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9700: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9710: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9720: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
9730: 0a 23 20 54 68 72 6f 77 73 2c 20 69 66 20 74 68  .# Throws, if th
9740: 65 20 61 72 67 75 6d 65 6e 74 20 69 73 20 70 72  e argument is pr
9750: 65 73 65 6e 74 2e 0a 66 75 6e 63 5f 6d 6d 6d 76  esent..func_mmmv
9760: 5f 61 73 73 65 72 74 5f 61 72 67 5f 69 73 5f 61  _assert_arg_is_a
9770: 62 73 65 6e 74 5f 74 31 28 29 20 7b 0a 20 20 20  bsent_t1() {.   
9780: 20 6c 6f 63 61 6c 20 53 5f 41 52 47 5f 58 3d 22   local S_ARG_X="
9790: 24 31 22 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53  $1" .    local S
97a0: 5f 41 52 47 5f 58 5f 4e 41 4d 45 3d 22 24 32 22  _ARG_X_NAME="$2"
97b0: 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 47 55   .    local S_GU
97c0: 49 44 3d 22 24 33 22 20 0a 20 20 20 20 23 2d 2d  ID="$3" .    #--
97d0: 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20  ------.    if [ 
97e0: 22 24 53 5f 47 55 49 44 22 20 3d 3d 20 22 22 20  "$S_GUID" == "" 
97f0: 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  ] ; then.       
9800: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
9810: 20 65 63 68 6f 20 22 54 68 65 20 69 6d 70 6c 65   echo "The imple
9820: 6d 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74 68 65  mentation of the
9830: 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74 20 22   function that "
9840: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 63  .        echo "c
9850: 61 6c 6c 73 20 74 68 65 20 22 0a 20 20 20 20 20  alls the ".     
9860: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
9870: 20 20 20 65 63 68 6f 20 22 20 20 20 20 66 75 6e     echo "    fun
9880: 63 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61 72  c_mmmv_assert_ar
9890: 67 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 22 0a  g_is_absent_t1".
98a0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
98b0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69 73          echo "is
98c0: 20 66 6c 61 77 65 64 2e 20 54 68 65 20 63 61 6c   flawed. The cal
98d0: 6c 20 74 6f 20 74 68 65 20 22 0a 20 20 20 20 20  l to the ".     
98e0: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
98f0: 20 20 20 65 63 68 6f 20 22 20 20 20 20 66 75 6e     echo "    fun
9900: 63 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61 72  c_mmmv_assert_ar
9910: 67 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 22 0a  g_is_absent_t1".
9920: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
9930: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 6d 69          echo "mi
9940: 73 73 65 73 20 74 68 65 20 74 68 69 72 64 20 66  sses the third f
9950: 75 6e 63 74 69 6f 6e 20 61 72 67 75 6d 65 6e 74  unction argument
9960: 2c 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  , ".        echo
9970: 20 22 77 68 69 63 68 20 69 73 20 65 78 70 65 63   "which is expec
9980: 74 65 64 20 74 6f 20 62 65 20 61 20 47 55 49 44  ted to be a GUID
9990: 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
99a0: 22 47 55 49 44 3d 3d 27 34 62 31 37 64 32 34 39  "GUID=='4b17d249
99b0: 2d 33 65 61 32 2d 34 62 37 64 2d 61 33 64 30 2d  -3ea2-4b7d-a3d0-
99c0: 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20  21b170e031e7'". 
99d0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
99e0: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
99f0: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
9a00: 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
9a10: 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
9a20: 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 69  ror.    fi.    i
9a30: 66 20 5b 20 22 24 53 5f 41 52 47 5f 58 5f 4e 41  f [ "$S_ARG_X_NA
9a40: 4d 45 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68  ME" == "" ] ; th
9a50: 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  en.        echo 
9a60: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
9a70: 22 54 68 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74  "The implementat
9a80: 69 6f 6e 20 6f 66 20 74 68 65 20 66 75 6e 63 74  ion of the funct
9a90: 69 6f 6e 20 74 68 61 74 20 22 0a 20 20 20 20 20  ion that ".     
9aa0: 20 20 20 65 63 68 6f 20 22 63 61 6c 6c 73 20 74     echo "calls t
9ab0: 68 65 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  he ".        ech
9ac0: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
9ad0: 6f 20 22 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  o "    func_mmmv
9ae0: 5f 61 73 73 65 72 74 5f 61 72 67 5f 69 73 5f 61  _assert_arg_is_a
9af0: 62 73 65 6e 74 5f 74 31 22 0a 20 20 20 20 20 20  bsent_t1".      
9b00: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
9b10: 20 20 65 63 68 6f 20 22 69 73 20 66 6c 61 77 65    echo "is flawe
9b20: 64 2e 20 54 68 65 20 63 61 6c 6c 20 74 6f 20 74  d. The call to t
9b30: 68 65 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  he ".        ech
9b40: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
9b50: 6f 20 22 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  o "    func_mmmv
9b60: 5f 61 73 73 65 72 74 5f 61 72 67 5f 69 73 5f 61  _assert_arg_is_a
9b70: 62 73 65 6e 74 5f 74 31 22 0a 20 20 20 20 20 20  bsent_t1".      
9b80: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
9b90: 20 20 65 63 68 6f 20 22 6d 69 73 73 65 73 20 74    echo "misses t
9ba0: 68 65 20 73 65 63 6f 6e 64 20 66 75 6e 63 74 69  he second functi
9bb0: 6f 6e 20 61 72 67 75 6d 65 6e 74 2e 22 0a 20 20  on argument.".  
9bc0: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
9bd0: 3d 3d 27 36 31 66 38 39 39 34 34 2d 33 37 62 36  =='61f89944-37b6
9be0: 2d 34 31 31 30 2d 62 31 64 30 2d 32 31 62 31 37  -4110-b1d0-21b17
9bf0: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
9c00: 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 24    echo "GUID=='$
9c10: 53 5f 47 55 49 44 27 22 0a 20 20 20 20 20 20 20  S_GUID'".       
9c20: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
9c30: 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63   #----.        c
9c40: 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
9c50: 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
9c60: 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
9c70: 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d    fi.    #------
9c80: 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  --.    if [ "$S_
9c90: 41 52 47 5f 58 22 20 21 3d 20 22 22 20 5d 20 3b  ARG_X" != "" ] ;
9ca0: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
9cb0: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
9cc0: 68 6f 20 22 49 66 20 74 68 65 20 66 69 72 73 74  ho "If the first
9cd0: 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65 6e   console argumen
9ce0: 74 20 69 73 20 5c 22 24 53 5f 41 52 47 56 5f 30  t is \"$S_ARGV_0
9cf0: 5c 22 2c 20 74 68 65 6e 20 22 0a 20 20 20 20 20  \", then ".     
9d00: 20 20 20 65 63 68 6f 20 22 74 68 65 20 24 53 5f     echo "the $S_
9d10: 41 52 47 5f 58 5f 4e 41 4d 45 20 69 73 20 72 65  ARG_X_NAME is re
9d20: 71 75 69 72 65 64 20 74 6f 20 62 65 20 61 62 73  quired to be abs
9d30: 65 6e 74 2c 20 22 0a 20 20 20 20 20 20 20 20 65  ent, ".        e
9d40: 63 68 6f 20 22 62 75 74 20 63 75 72 72 65 6e 74  cho "but current
9d50: 6c 79 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  ly ".        ech
9d60: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
9d70: 6f 20 22 20 20 20 20 3c 24 53 5f 41 52 47 5f 58  o "    <$S_ARG_X
9d80: 5f 4e 41 4d 45 3e 3d 24 53 5f 41 52 47 5f 58 22  _NAME>=$S_ARG_X"
9d90: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
9da0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47  .        echo "G
9db0: 55 49 44 3d 3d 27 34 39 35 64 64 32 31 33 2d 39  UID=='495dd213-9
9dc0: 62 32 61 2d 34 35 62 63 2d 39 33 64 30 2d 32 31  b2a-45bc-93d0-21
9dd0: 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  b170e031e7'".   
9de0: 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
9df0: 3d 27 24 53 5f 47 55 49 44 27 22 0a 20 20 20 20  ='$S_GUID'".    
9e00: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
9e10: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
9e20: 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
9e30: 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
9e40: 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
9e50: 0a 20 20 20 20 66 69 0a 7d 20 23 20 66 75 6e 63  .    fi.} # func
9e60: 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61 72 67  _mmmv_assert_arg
9e70: 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 0a 0a 0a  _is_absent_t1...
9e80: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
9e90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9ea0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9eb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9ec0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e  -----------..fun
9ed0: 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73 68 5f  c_mmmv_exc_hash_
9ee0: 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74 5f 76  function_input_v
9ef0: 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31 28 29  erification_t1()
9f00: 20 7b 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f   { .    local S_
9f10: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 42 41 53 48  NAME_OF_THE_BASH
9f20: 5f 46 55 4e 43 54 49 4f 4e 3d 22 24 31 22 20 23  _FUNCTION="$1" #
9f30: 20 54 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65   The name of the
9f40: 20 42 61 73 68 20 66 75 6e 63 74 69 6f 6e 2e 0a   Bash function..
9f50: 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 32      local S_FP_2
9f60: 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c  _AN_EXISTING_FIL
9f70: 45 3d 22 24 32 22 20 23 20 54 68 65 20 66 69 72  E="$2" # The fir
9f80: 73 74 20 61 72 67 75 6d 65 6e 74 20 6f 66 20 74  st argument of t
9f90: 68 65 20 42 61 73 68 20 66 75 6e 63 74 69 6f 6e  he Bash function
9fa0: 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  ..    #--------.
9fb0: 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f      local S_TMP_
9fc0: 30 3d 22 22 20 23 20 64 65 63 6c 61 72 61 74 69  0="" # declarati
9fd0: 6f 6e 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54  on.    local S_T
9fe0: 4d 50 5f 31 3d 22 22 20 23 20 64 65 63 6c 61 72  MP_1="" # declar
9ff0: 61 74 69 6f 6e 0a 20 20 20 20 23 2d 2d 2d 2d 2d  ation.    #-----
a000: 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ---.    if [ "$S
a010: 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 42 41 53  _NAME_OF_THE_BAS
a020: 48 5f 46 55 4e 43 54 49 4f 4e 22 20 3d 3d 20 22  H_FUNCTION" == "
a030: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
a040: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
a050: 20 20 20 65 63 68 6f 20 22 54 68 65 20 69 6d 70     echo "The imp
a060: 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74  lementation of t
a070: 68 65 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74  he function that
a080: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
a090: 22 63 61 6c 6c 73 20 74 68 65 20 22 0a 20 20 20  "calls the ".   
a0a0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
a0b0: 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 66       echo "    f
a0c0: 75 6e 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73  unc_mmmv_exc_has
a0d0: 68 5f 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74  h_function_input
a0e0: 5f 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31  _verification_t1
a0f0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a100: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a110: 69 73 20 66 6c 61 77 65 64 2e 20 54 68 65 20 63  is flawed. The c
a120: 61 6c 6c 20 74 6f 20 74 68 65 20 22 0a 20 20 20  all to the ".   
a130: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
a140: 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 66       echo "    f
a150: 75 6e 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73  unc_mmmv_exc_has
a160: 68 5f 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74  h_function_input
a170: 5f 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31  _verification_t1
a180: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a190: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a1a0: 6d 69 73 73 65 73 20 74 68 65 20 66 69 72 73 74  misses the first
a1b0: 20 61 72 67 75 6d 65 6e 74 20 6f 72 20 74 68 65   argument or the
a1c0: 20 66 69 72 73 74 20 61 72 67 75 6d 65 6e 74 20   first argument 
a1d0: 69 73 20 61 6e 20 65 6d 70 74 79 20 73 74 72 69  is an empty stri
a1e0: 6e 67 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68  ng.".        ech
a1f0: 6f 20 22 47 55 49 44 3d 3d 27 34 37 36 33 64 33  o "GUID=='4763d3
a200: 63 33 2d 37 33 63 30 2d 34 35 35 61 2d 39 31 64  c3-73c0-455a-91d
a210: 30 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22  0-21b170e031e7'"
a220: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
a230: 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
a240: 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
a250: 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69  ORIG.        exi
a260: 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
a270: 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20  error.    fi.   
a280: 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75 62 79 20   S_TMP_0="`ruby 
a290: 2d 65 20 5c 22 70 72 69 6e 74 28 27 24 53 5f 4e  -e \"print('$S_N
a2a0: 41 4d 45 5f 4f 46 5f 54 48 45 5f 42 41 53 48 5f  AME_OF_THE_BASH_
a2b0: 46 55 4e 43 54 49 4f 4e 27 2e 74 6f 5f 73 2e 67  FUNCTION'.to_s.g
a2c0: 73 75 62 28 2f 5b 5c 73 5d 2b 2f 2c 27 27 29 29  sub(/[\s]+/,''))
a2d0: 3b 5c 22 20 60 22 0a 20 20 20 20 69 66 20 5b 20  ;\" `".    if [ 
a2e0: 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f  "$S_NAME_OF_THE_
a2f0: 42 41 53 48 5f 46 55 4e 43 54 49 4f 4e 22 20 21  BASH_FUNCTION" !
a300: 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 20 3b  = "$S_TMP_0" ] ;
a310: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
a320: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
a330: 68 6f 20 22 54 68 65 20 69 6d 70 6c 65 6d 65 6e  ho "The implemen
a340: 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 66 75  tation of the fu
a350: 6e 63 74 69 6f 6e 20 74 68 61 74 20 22 0a 20 20  nction that ".  
a360: 20 20 20 20 20 20 65 63 68 6f 20 22 63 61 6c 6c        echo "call
a370: 73 20 74 68 65 20 22 0a 20 20 20 20 20 20 20 20  s the ".        
a380: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
a390: 65 63 68 6f 20 22 20 20 20 20 66 75 6e 63 5f 6d  echo "    func_m
a3a0: 6d 6d 76 5f 65 78 63 5f 68 61 73 68 5f 66 75 6e  mmv_exc_hash_fun
a3b0: 63 74 69 6f 6e 5f 69 6e 70 75 74 5f 76 65 72 69  ction_input_veri
a3c0: 66 69 63 61 74 69 6f 6e 5f 74 31 22 0a 20 20 20  fication_t1".   
a3d0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
a3e0: 20 20 20 20 20 65 63 68 6f 20 22 69 73 20 66 6c       echo "is fl
a3f0: 61 77 65 64 2e 20 46 75 6e 63 74 69 6f 6e 20 6e  awed. Function n
a400: 61 6d 65 73 20 61 72 65 20 6e 6f 74 20 61 6c 6c  ames are not all
a410: 6f 77 65 64 20 74 6f 20 63 6f 6e 74 61 69 6e 20  owed to contain 
a420: 73 70 61 63 65 73 20 6f 72 20 74 61 62 73 2e 22  spaces or tabs."
a430: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47  .        echo "G
a440: 55 49 44 3d 3d 27 37 64 32 66 63 61 31 39 2d 39  UID=='7d2fca19-9
a450: 37 33 34 2d 34 37 35 61 2d 62 31 64 30 2d 32 31  734-475a-b1d0-21
a460: 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  b170e031e7'".   
a470: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
a480: 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
a490: 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
a4a0: 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20  .        exit 1 
a4b0: 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
a4c0: 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d  r.    fi.    #--
a4d0: 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 46 75 6e  ------.    # Fun
a4e0: 63 74 69 6f 6e 20 63 61 6c 6c 73 20 6c 69 6b 65  ction calls like
a4f0: 0a 20 20 20 20 23 0a 20 20 20 20 23 20 20 20 20  .    #.    #    
a500: 20 3c 66 75 6e 63 74 69 6f 6e 20 6e 61 6d 65 3e   <function name>
a510: 20 22 22 0a 20 20 20 20 23 20 20 20 20 20 3c 66   "".    #     <f
a520: 75 6e 63 74 69 6f 6e 20 6e 61 6d 65 3e 20 22 20  unction name> " 
a530: 22 0a 20 20 20 20 23 0a 20 20 20 20 23 20 61 72  ".    #.    # ar
a540: 65 20 6e 6f 74 20 61 6c 6c 6f 77 65 64 2e 0a 20  e not allowed.. 
a550: 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75 62     S_TMP_0="`rub
a560: 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27 24 53  y -e \"print('$S
a570: 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e  _FP_2_AN_EXISTIN
a580: 47 5f 46 49 4c 45 27 2e 74 6f 5f 73 2e 67 73 75  G_FILE'.to_s.gsu
a590: 62 28 2f 5b 5c 73 5d 2b 2f 2c 27 27 29 29 3b 5c  b(/[\s]+/,''));\
a5a0: 22 20 60 22 0a 20 20 20 20 69 66 20 5b 20 22 24  " `".    if [ "$
a5b0: 53 5f 54 4d 50 5f 30 22 20 3d 3d 20 22 22 20 5d  S_TMP_0" == "" ]
a5c0: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
a5d0: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
a5e0: 65 63 68 6f 20 22 54 68 65 20 42 61 73 68 20 66  echo "The Bash f
a5f0: 75 6e 63 74 69 6f 6e 20 22 0a 20 20 20 20 20 20  unction ".      
a600: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
a610: 20 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 4e    echo "    $S_N
a620: 41 4d 45 5f 4f 46 5f 54 48 45 5f 42 41 53 48 5f  AME_OF_THE_BASH_
a630: 46 55 4e 43 54 49 4f 4e 22 0a 20 20 20 20 20 20  FUNCTION".      
a640: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
a650: 20 20 65 63 68 6f 20 22 69 73 20 6e 6f 74 20 64    echo "is not d
a660: 65 73 69 67 6e 65 64 20 74 6f 20 68 61 6e 64 6c  esigned to handl
a670: 65 20 61 6e 20 61 72 67 75 6d 65 6e 74 20 74 68  e an argument th
a680: 61 74 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  at ".        ech
a690: 6f 20 22 65 71 75 61 6c 73 20 77 69 74 68 20 61  o "equals with a
a6a0: 6e 20 65 6d 70 74 79 20 73 74 72 69 6e 67 20 6f  n empty string o
a6b0: 72 20 61 20 73 65 72 69 65 73 20 6f 66 20 73 70  r a series of sp
a6c0: 61 63 65 73 20 61 6e 64 20 74 61 62 73 2e 22 0a  aces and tabs.".
a6d0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
a6e0: 49 44 3d 3d 27 33 31 38 31 35 37 32 30 2d 32 30  ID=='31815720-20
a6f0: 62 34 2d 34 33 61 33 2d 38 32 64 30 2d 32 31 62  b4-43a3-82d0-21b
a700: 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  170e031e7'".    
a710: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
a720: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
a730: 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
a740: 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
a750: 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
a760: 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
a770: 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 21  -----.    if [ !
a780: 20 2d 65 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45   -e $S_FP_2_AN_E
a790: 58 49 53 54 49 4e 47 5f 46 49 4c 45 20 5d 20 3b  XISTING_FILE ] ;
a7a0: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
a7b0: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
a7c0: 68 6f 20 22 54 68 65 20 66 69 6c 65 20 22 0a 20  ho "The file ". 
a7d0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
a7e0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20         echo "   
a7f0: 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53   $S_FP_2_AN_EXIS
a800: 54 49 4e 47 5f 46 49 4c 45 20 22 0a 20 20 20 20  TING_FILE ".    
a810: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
a820: 20 20 20 20 65 63 68 6f 20 22 69 73 20 6d 69 73      echo "is mis
a830: 73 69 6e 67 20 6f 72 20 69 74 20 69 73 20 61 20  sing or it is a 
a840: 62 72 6f 6b 65 6e 20 6c 69 6e 6b 2e 22 0a 20 20  broken link.".  
a850: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
a860: 3d 3d 27 38 32 33 62 39 38 35 35 2d 66 36 64 33  =='823b9855-f6d3
a870: 2d 34 65 64 37 2d 61 34 64 30 2d 32 31 62 31 37  -4ed7-a4d0-21b17
a880: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
a890: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
a8a0: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
a8b0: 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20  cd $S_FP_ORIG.  
a8c0: 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
a8d0: 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
a8e0: 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20 2d     fi.    if [ -
a8f0: 64 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49  d $S_FP_2_AN_EXI
a900: 53 54 49 4e 47 5f 46 49 4c 45 20 5d 20 3b 20 74  STING_FILE ] ; t
a910: 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f  hen.        echo
a920: 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
a930: 20 22 54 68 65 20 66 69 6c 65 20 70 61 74 68 20   "The file path 
a940: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a950: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a960: 20 20 20 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45      $S_FP_2_AN_E
a970: 58 49 53 54 49 4e 47 5f 46 49 4c 45 20 22 0a 20  XISTING_FILE ". 
a980: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
a990: 20 20 20 20 20 20 20 65 63 68 6f 20 22 72 65 66         echo "ref
a9a0: 65 72 65 6e 63 65 73 20 61 20 66 6f 6c 64 65 72  erences a folder
a9b0: 2c 20 62 75 74 20 61 20 66 69 6c 65 20 69 73 20  , but a file is 
a9c0: 65 78 70 65 63 74 65 64 2e 22 0a 20 20 20 20 20  expected.".     
a9d0: 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
a9e0: 63 30 62 63 32 39 32 37 2d 32 39 63 30 2d 34 33  c0bc2927-29c0-43
a9f0: 63 61 2d 61 31 64 30 2d 32 31 62 31 37 30 65 30  ca-a1d0-21b170e0
aa00: 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
aa10: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
aa20: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
aa30: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
aa40: 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
aa50: 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
aa60: 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
aa70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20  ------------.   
aa80: 20 23 20 41 74 20 74 68 69 73 20 6c 69 6e 65 20   # At this line 
aa90: 74 68 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e  the verification
aaa0: 73 20 68 61 76 65 20 61 6c 6c 20 70 61 73 73 65  s have all passe
aab0: 64 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  d..    #--------
aac0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23  ------------.} #
aad0: 20 66 75 6e 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68   func_mmmv_exc_h
aae0: 61 73 68 5f 66 75 6e 63 74 69 6f 6e 5f 69 6e 70  ash_function_inp
aaf0: 75 74 5f 76 65 72 69 66 69 63 61 74 69 6f 6e 5f  ut_verification_
ab00: 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  t1...#----------
ab10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ab20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ab30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ab40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ab50: 0a 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55  ..S_FUNC_MMMV_GU
ab60: 49 44 5f 54 31 5f 52 45 53 55 4c 54 3d 22 6e 6f  ID_T1_RESULT="no
ab70: 74 5f 79 65 74 5f 73 65 74 22 0a 53 5f 46 55 4e  t_yet_set".S_FUN
ab80: 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 4d  C_MMMV_GUID_T1_M
ab90: 4f 44 45 3d 22 22 20 23 20 6f 70 74 69 6d 2e 20  ODE="" # optim. 
aba0: 74 6f 20 73 6b 69 70 20 72 65 70 65 61 74 69 6e  to skip repeatin
abb0: 67 20 63 6f 6e 73 6f 6c 65 20 74 6f 6f 6c 20 73  g console tool s
abc0: 65 6c 65 63 74 69 6f 6e 0a 66 75 6e 63 5f 6d 6d  election.func_mm
abd0: 6d 76 5f 47 55 49 44 5f 74 31 28 29 20 7b 20 0a  mv_GUID_t1() { .
abe0: 20 20 20 20 23 20 44 6f 65 73 20 6e 6f 74 20 74      # Does not t
abf0: 61 6b 65 20 61 6e 79 20 61 72 67 75 6d 65 6e 74  ake any argument
ac00: 73 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  s..    #--------
ac10: 0a 20 20 20 20 23 66 75 6e 63 5f 6d 6d 6d 76 5f  .    #func_mmmv_
ac20: 65 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69 6f  exc_hash_functio
ac30: 6e 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63 61  n_input_verifica
ac40: 74 69 6f 6e 5f 74 31 20 22 66 75 6e 63 5f 6d 6d  tion_t1 "func_mm
ac50: 6d 76 5f 47 55 49 44 5f 74 31 22 20 22 24 31 22  mv_GUID_t1" "$1"
ac60: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
ac70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23  ----------.    #
ac80: 20 4d 6f 64 65 20 73 65 6c 65 63 74 69 6f 6e 3a   Mode selection:
ac90: 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55  .    if [ "$S_FU
aca0: 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f  NC_MMMV_GUID_T1_
acb0: 4d 4f 44 45 22 20 3d 3d 20 22 22 20 5d 20 3b 20  MODE" == "" ] ; 
acc0: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f  then.        SB_
acd0: 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54  EXISTS_ON_PATH_T
ace0: 31 5f 52 45 53 55 4c 54 3d 22 66 22 20 20 23 20  1_RESULT="f"  # 
acf0: 69 66 2d 62 6c 6f 63 6b 20 69 6e 69 74 0a 20 20  if-block init.  
ad00: 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
ad10: 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58      if [ "$SB_EX
ad20: 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f  ISTS_ON_PATH_T1_
ad30: 52 45 53 55 4c 54 22 20 3d 3d 20 22 66 22 20 5d  RESULT" == "f" ]
ad40: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
ad50: 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 75 75 69      S_TMP_0="uui
ad60: 64 67 65 6e 22 20 23 20 4c 69 6e 75 78 20 76 65  dgen" # Linux ve
ad70: 72 73 69 6f 6e 0a 20 20 20 20 20 20 20 20 20 20  rsion.          
ad80: 20 20 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73    func_sb_exists
ad90: 5f 6f 6e 5f 70 61 74 68 5f 74 31 20 22 24 53 5f  _on_path_t1 "$S_
ada0: 54 4d 50 5f 30 22 20 0a 20 20 20 20 20 20 20 20  TMP_0" .        
adb0: 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58      if [ "$SB_EX
adc0: 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f  ISTS_ON_PATH_T1_
add0: 52 45 53 55 4c 54 22 20 3d 3d 20 22 74 22 20 5d  RESULT" == "t" ]
ade0: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
adf0: 20 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f           S_FUNC_
ae00: 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 4d 4f 44  MMMV_GUID_T1_MOD
ae10: 45 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20  E="$S_TMP_0".   
ae20: 20 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20           fi.    
ae30: 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23      fi.        #
ae40: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20  ----.        if 
ae50: 5b 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e  [ "$SB_EXISTS_ON
ae60: 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22  _PATH_T1_RESULT"
ae70: 20 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68 65 6e   == "f" ] ; then
ae80: 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 54  .            S_T
ae90: 4d 50 5f 30 3d 22 75 75 69 64 22 20 20 20 20 23  MP_0="uuid"    #
aea0: 20 42 53 44 20 76 65 72 73 69 6f 6e 0a 20 20 20   BSD version.   
aeb0: 20 20 20 20 20 20 20 20 20 66 75 6e 63 5f 73 62           func_sb
aec0: 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f  _exists_on_path_
aed0: 74 31 20 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20  t1 "$S_TMP_0" . 
aee0: 20 20 20 20 20 20 20 20 20 20 20 69 66 20 5b 20             if [ 
aef0: 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50  "$SB_EXISTS_ON_P
af00: 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d  ATH_T1_RESULT" =
af10: 3d 20 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20  = "t" ] ; then. 
af20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
af30: 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44  S_FUNC_MMMV_GUID
af40: 5f 54 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d 50  _T1_MODE="$S_TMP
af50: 5f 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  _0".            
af60: 66 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20  fi.        fi.  
af70: 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a        #--------.
af80: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
af90: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f  _FUNC_MMMV_GUID_
afa0: 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 22 20 5d  T1_MODE" == "" ]
afb0: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
afc0: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
afd0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 41 6c          echo "Al
afe0: 6c 20 6f 66 20 74 68 65 20 47 55 49 44 20 67 65  l of the GUID ge
aff0: 6e 65 72 61 74 69 6f 6e 20 69 6d 70 6c 65 6d 65  neration impleme
b000: 6e 74 61 74 69 6f 6e 73 20 74 68 61 74 20 74 68  ntations that th
b010: 69 73 20 73 63 72 69 70 74 20 22 20 0a 20 20 20  is script " .   
b020: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69           echo "i
b030: 73 20 63 61 70 61 62 6c 65 20 6f 66 20 75 73 69  s capable of usi
b040: 6e 67 20 28 75 75 69 64 67 65 6e 2c 20 75 75 69  ng (uuidgen, uui
b050: 64 29 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  d) ".           
b060: 20 65 63 68 6f 20 22 61 72 65 20 6d 69 73 73 69   echo "are missi
b070: 6e 67 20 66 72 6f 6d 20 74 68 65 20 50 41 54 48  ng from the PATH
b080: 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  .".            e
b090: 63 68 6f 20 22 47 55 49 44 3d 3d 27 34 35 30 35  cho "GUID=='4505
b0a0: 35 65 66 30 2d 63 61 35 34 2d 34 35 36 64 2d 39  5ef0-ca54-456d-9
b0b0: 34 63 30 2d 32 31 62 31 37 30 65 30 33 31 65 37  4c0-21b170e031e7
b0c0: 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  '".            e
b0d0: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
b0e0: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
b0f0: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
b100: 49 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  IG.            e
b110: 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
b120: 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20  h error.        
b130: 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  fi.        #----
b140: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20  ----.        if 
b150: 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b  [ "$?" != "0" ];
b160: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20   then.          
b170: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
b180: 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 69 73        echo "This
b190: 20 73 63 72 69 70 74 20 69 73 20 66 6c 61 77 65   script is flawe
b1a0: 64 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  d.".            
b1b0: 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 32 33 39  echo "GUID=='239
b1c0: 34 38 38 33 35 2d 62 33 62 31 2d 34 35 63 61 2d  48835-b3b1-45ca-
b1d0: 61 62 63 30 2d 32 31 62 31 37 30 65 30 33 31 65  abc0-21b170e031e
b1e0: 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  7'".            
b1f0: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
b200: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
b210: 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f        cd $S_FP_O
b220: 52 49 47 0a 20 20 20 20 20 20 20 20 20 20 20 20  RIG.            
b230: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
b240: 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20  th error.       
b250: 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   fi.        #---
b260: 2d 2d 2d 2d 2d 0a 20 20 20 20 66 69 0a 20 20 20  -----.    fi.   
b270: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   #--------------
b280: 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 46 55 4e  ------.    S_FUN
b290: 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52  C_MMMV_GUID_T1_R
b2a0: 45 53 55 4c 54 3d 22 22 0a 20 20 20 20 23 2d 2d  ESULT="".    #--
b2b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
b2c0: 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  --.    if [ "$S_
b2d0: 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54  FUNC_MMMV_GUID_T
b2e0: 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 75 75 69 64  1_MODE" == "uuid
b2f0: 67 65 6e 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  gen" ]; then.   
b300: 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 75       S_TMP_0="`u
b310: 75 69 64 67 65 6e 60 22 0a 20 20 20 20 20 20 20  uidgen`".       
b320: 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30   if [ "$?" != "0
b330: 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
b340: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
b350: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
b360: 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61 70 70 6c  The console appl
b370: 69 63 61 74 69 6f 6e 20 5c 22 75 75 69 64 67 65  ication \"uuidge
b380: 6e 5c 22 20 22 0a 20 20 20 20 20 20 20 20 20 20  n\" ".          
b390: 20 20 65 63 68 6f 20 22 65 78 69 74 65 64 20 77    echo "exited w
b3a0: 69 74 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20  ith an error.". 
b3b0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
b3c0: 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  "".            e
b3d0: 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65  cho "----console
b3e0: 2d 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69  --output--citati
b3f0: 6f 6e 2d 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a  on--start-----".
b400: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
b410: 20 22 60 75 75 69 64 67 65 6e 60 22 20 23 20 73   "`uuidgen`" # s
b420: 74 64 6f 75 74 20 61 6e 64 20 73 74 64 65 72 72  tdout and stderr
b430: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
b440: 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d  o "----console--
b450: 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e  output--citation
b460: 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20  --end-------".  
b470: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
b480: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
b490: 68 6f 20 22 47 55 49 44 3d 3d 27 30 33 62 38 39  ho "GUID=='03b89
b4a0: 33 34 31 2d 39 31 36 62 2d 34 31 37 61 2d 62 32  341-916b-417a-b2
b4b0: 63 30 2d 32 31 62 31 37 30 65 30 33 31 65 37 27  c0-21b170e031e7'
b4c0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
b4d0: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
b4e0: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
b4f0: 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
b500: 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78  G.            ex
b510: 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
b520: 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66   error.        f
b530: 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 20  i.        #---- 
b540: 0a 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f  .        S_FUNC_
b550: 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45 53  MMMV_GUID_T1_RES
b560: 55 4c 54 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20  ULT="$S_TMP_0". 
b570: 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
b580: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
b590: 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e      if [ "$S_FUN
b5a0: 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 4d  C_MMMV_GUID_T1_M
b5b0: 4f 44 45 22 20 3d 3d 20 22 75 75 69 64 22 20 5d  ODE" == "uuid" ]
b5c0: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53  ; then.        S
b5d0: 5f 54 4d 50 5f 30 3d 22 60 75 75 69 64 60 22 0a  _TMP_0="`uuid`".
b5e0: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 3f          if [ "$?
b5f0: 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e  " != "0" ]; then
b600: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
b610: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
b620: 20 65 63 68 6f 20 22 54 68 65 20 63 6f 6e 73 6f   echo "The conso
b630: 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 5c  le application \
b640: 22 75 75 69 64 5c 22 20 22 0a 20 20 20 20 20 20  "uuid\" ".      
b650: 20 20 20 20 20 20 65 63 68 6f 20 22 65 78 69 74        echo "exit
b660: 65 64 20 77 69 74 68 20 61 6e 20 65 72 72 6f 72  ed with an error
b670: 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  .".            e
b680: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
b690: 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e     echo "----con
b6a0: 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69  sole--output--ci
b6b0: 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74 2d 2d 2d  tation--start---
b6c0: 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  --".            
b6d0: 65 63 68 6f 20 22 60 75 75 69 64 60 22 20 23 20  echo "`uuid`" # 
b6e0: 73 74 64 6f 75 74 20 61 6e 64 20 73 74 64 65 72  stdout and stder
b6f0: 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  r.            ec
b700: 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d  ho "----console-
b710: 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f  -output--citatio
b720: 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20  n--end-------". 
b730: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
b740: 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  "".            e
b750: 63 68 6f 20 22 47 55 49 44 3d 3d 27 37 38 38 65  cho "GUID=='788e
b760: 66 32 32 34 2d 63 34 32 66 2d 34 66 31 31 2d 62  f224-c42f-4f11-b
b770: 35 63 30 2d 32 31 62 31 37 30 65 30 33 31 65 37  5c0-21b170e031e7
b780: 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  '".            e
b790: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
b7a0: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
b7b0: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
b7c0: 49 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  IG.            e
b7d0: 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
b7e0: 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20  h error.        
b7f0: 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  fi.        #----
b800: 20 0a 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43   .        S_FUNC
b810: 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45  _MMMV_GUID_T1_RE
b820: 53 55 4c 54 3d 22 24 53 5f 54 4d 50 5f 30 22 0a  SULT="$S_TMP_0".
b830: 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
b840: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
b850: 0a 20 20 20 20 23 20 54 68 65 20 72 65 61 73 6f  .    # The reaso
b860: 6e 2c 20 77 68 79 20 65 76 65 72 79 74 68 69 6e  n, why everythin
b870: 67 20 69 73 20 64 6f 6e 65 20 77 69 74 68 20 72  g is done with r
b880: 75 62 79 20 61 74 20 74 68 65 20 6e 65 78 74 20  uby at the next 
b890: 0a 20 20 20 20 23 20 42 61 73 68 20 61 73 73 69  .    # Bash assi
b8a0: 67 6e 6d 65 6e 74 20 63 6c 61 75 73 65 20 69 73  gnment clause is
b8b0: 20 74 68 61 74 20 74 68 65 20 22 77 63 20 2d 6d   that the "wc -m
b8c0: 22 20 70 61 64 73 20 69 74 73 20 6f 75 74 70 75  " pads its outpu
b8d0: 74 0a 20 20 20 20 23 20 77 69 74 68 20 73 70 61  t.    # with spa
b8e0: 63 65 73 20 6f 6e 20 42 53 44 2e 0a 20 20 20 20  ces on BSD..    
b8f0: 53 5f 54 4d 50 5f 30 3d 22 60 72 75 62 79 20 2d  S_TMP_0="`ruby -
b900: 65 20 5c 22 70 72 69 6e 74 28 41 52 47 56 5b 30  e \"print(ARGV[0
b910: 5d 2e 74 6f 5f 73 2e 6c 65 6e 67 74 68 2e 74 6f  ].to_s.length.to
b920: 5f 73 29 3b 5c 22 20 24 53 5f 46 55 4e 43 5f 4d  _s);\" $S_FUNC_M
b930: 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45 53 55  MMV_GUID_T1_RESU
b940: 4c 54 20 60 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d  LT `".    #-----
b950: 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d 50 5f 31 3d  ---.    S_TMP_1=
b960: 22 33 36 22 0a 20 20 20 20 69 66 20 5b 20 22 24  "36".    if [ "$
b970: 53 5f 54 4d 50 5f 30 22 20 21 3d 20 22 24 53 5f  S_TMP_0" != "$S_
b980: 54 4d 50 5f 31 22 20 5d 3b 20 74 68 65 6e 0a 20  TMP_1" ]; then. 
b990: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
b9a0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 41 63 63         echo "Acc
b9b0: 6f 72 64 69 6e 67 20 74 6f 20 74 68 65 20 47 55  ording to the GU
b9c0: 49 44 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e  ID specification
b9d0: 2c 20 49 45 54 46 20 52 46 43 20 34 31 32 32 2c  , IETF RFC 4122,
b9e0: 20 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f    ".        echo
b9f0: 20 22 74 68 65 20 6c 65 6e 67 74 68 20 6f 66 20   "the length of 
ba00: 74 68 65 20 47 55 49 44 20 69 73 20 22 0a 20 20  the GUID is ".  
ba10: 20 20 20 20 20 20 65 63 68 6f 20 22 24 53 5f 54        echo "$S_T
ba20: 4d 50 5f 31 20 63 68 61 72 61 63 74 65 72 73 2c  MP_1 characters,
ba30: 20 62 75 74 20 74 68 65 20 72 65 73 75 6c 74 20   but the result 
ba40: 6f 66 20 74 68 65 20 22 0a 20 20 20 20 20 20 20  of the ".       
ba50: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
ba60: 20 65 63 68 6f 20 22 20 20 20 20 66 75 6e 63 5f   echo "    func_
ba70: 6d 6d 6d 76 5f 47 55 49 44 5f 74 31 22 0a 20 20  mmmv_GUID_t1".  
ba80: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
ba90: 20 20 20 20 20 20 65 63 68 6f 20 22 69 73 20 73        echo "is s
baa0: 6f 6d 65 74 68 69 6e 67 20 65 6c 73 65 2e 20 54  omething else. T
bab0: 68 65 20 66 6c 61 77 65 64 20 47 55 49 44 20 63  he flawed GUID c
bac0: 61 6e 64 69 64 61 74 65 20 69 6e 20 70 61 72 65  andidate in pare
bad0: 6e 74 68 65 73 69 73 3a 22 0a 20 20 20 20 20 20  nthesis:".      
bae0: 20 20 65 63 68 6f 20 22 28 24 53 5f 46 55 4e 43    echo "($S_FUNC
baf0: 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45  _MMMV_GUID_T1_RE
bb00: 53 55 4c 54 29 22 0a 20 20 20 20 20 20 20 20 65  SULT)".        e
bb10: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
bb20: 63 68 6f 20 22 54 68 65 20 6c 65 6e 67 74 68 20  cho "The length 
bb30: 63 61 6e 64 69 64 61 74 65 20 6f 66 20 74 68 65  candidate of the
bb40: 20 66 6c 61 77 65 64 20 47 55 49 44 20 63 61 6e   flawed GUID can
bb50: 64 69 64 61 74 65 20 69 6e 20 70 61 72 65 6e 74  didate in parent
bb60: 68 65 73 69 73 3a 22 0a 20 20 20 20 20 20 20 20  hesis:".        
bb70: 65 63 68 6f 20 22 28 24 53 5f 54 4d 50 5f 30 29  echo "($S_TMP_0)
bb80: 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
bb90: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
bba0: 22 47 55 49 44 3d 3d 27 31 62 62 36 65 66 37 61  "GUID=='1bb6ef7a
bbb0: 2d 33 66 35 37 2d 34 39 33 62 2d 39 33 63 30 2d  -3f57-493b-93c0-
bbc0: 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20  21b170e031e7'". 
bbd0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
bbe0: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
bbf0: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
bc00: 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
bc10: 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
bc20: 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ror.    fi.    #
bc30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
bc40: 2d 2d 2d 2d 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d  ----.} # func_mm
bc50: 6d 76 5f 47 55 49 44 5f 74 31 0a 0a 0a 23 2d 2d  mv_GUID_t1...#--
bc60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
bc70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
bc80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
bc90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
bca0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55 4e 43  --------..S_FUNC
bcb0: 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54 31 5f  _MMMV_SHA256_T1_
bcc0: 52 45 53 55 4c 54 3d 22 6e 6f 74 5f 79 65 74 5f  RESULT="not_yet_
bcd0: 73 65 74 22 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56  set".S_FUNC_MMMV
bce0: 5f 53 48 41 32 35 36 5f 54 31 5f 4d 4f 44 45 3d  _SHA256_T1_MODE=
bcf0: 22 22 20 23 20 6f 70 74 69 6d 2e 20 74 6f 20 73  "" # optim. to s
bd00: 6b 69 70 20 72 65 70 65 61 74 69 6e 67 20 63 6f  kip repeating co
bd10: 6e 73 6f 6c 65 20 74 6f 6f 6c 20 73 65 6c 65 63  nsole tool selec
bd20: 74 69 6f 6e 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73  tion.func_mmmv_s
bd30: 68 61 32 35 36 5f 74 31 28 29 20 7b 20 23 20 72  ha256_t1() { # r
bd40: 65 71 75 69 72 65 73 20 61 6c 73 6f 20 72 75 62  equires also rub
bd50: 79 20 61 6e 64 20 67 61 77 6b 20 0a 20 20 20 20  y and gawk .    
bd60: 6c 6f 63 61 6c 20 53 5f 46 50 5f 32 5f 41 4e 5f  local S_FP_2_AN_
bd70: 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 3d 22 24  EXISTING_FILE="$
bd80: 31 22 20 23 20 66 69 72 73 74 20 66 75 6e 63 74  1" # first funct
bd90: 69 6f 6e 20 61 72 67 75 6d 65 6e 74 0a 20 20 20  ion argument.   
bda0: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66   #--------.    f
bdb0: 75 6e 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73  unc_mmmv_exc_has
bdc0: 68 5f 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74  h_function_input
bdd0: 5f 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31  _verification_t1
bde0: 20 22 66 75 6e 63 5f 6d 6d 6d 76 5f 73 68 61 32   "func_mmmv_sha2
bdf0: 35 36 5f 74 31 22 20 22 24 31 22 0a 20 20 20 20  56_t1" "$1".    
be00: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
be10: 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 4d 6f 64 65  -----.    # Mode
be20: 20 73 65 6c 65 63 74 69 6f 6e 3a 0a 20 20 20 20   selection:.    
be30: 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d  if [ "$S_FUNC_MM
be40: 4d 56 5f 53 48 41 32 35 36 5f 54 31 5f 4d 4f 44  MV_SHA256_T1_MOD
be50: 45 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65  E" == "" ] ; the
be60: 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 45 58 49  n.        SB_EXI
be70: 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52  STS_ON_PATH_T1_R
be80: 45 53 55 4c 54 3d 22 66 22 20 20 23 20 69 66 2d  ESULT="f"  # if-
be90: 62 6c 6f 63 6b 20 69 6e 69 74 0a 20 20 20 20 20  block init.     
bea0: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
beb0: 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54   if [ "$SB_EXIST
bec0: 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53  S_ON_PATH_T1_RES
bed0: 55 4c 54 22 20 3d 3d 20 22 66 22 20 5d 20 3b 20  ULT" == "f" ] ; 
bee0: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
bef0: 20 53 5f 54 4d 50 5f 30 3d 22 73 68 61 32 35 36   S_TMP_0="sha256
bf00: 73 75 6d 22 20 23 20 75 73 75 61 6c 6c 79 20 61  sum" # usually a
bf10: 76 61 69 6c 61 62 6c 65 20 6f 6e 20 4c 69 6e 75  vailable on Linu
bf20: 78 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 75  x.            fu
bf30: 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e 5f  nc_sb_exists_on_
bf40: 70 61 74 68 5f 74 31 20 22 24 53 5f 54 4d 50 5f  path_t1 "$S_TMP_
bf50: 30 22 20 0a 20 20 20 20 20 20 20 20 20 20 20 20  0" .            
bf60: 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54 53  if [ "$SB_EXISTS
bf70: 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55  _ON_PATH_T1_RESU
bf80: 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20 3b 20 74  LT" == "t" ] ; t
bf90: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
bfa0: 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56       S_FUNC_MMMV
bfb0: 5f 53 48 41 32 35 36 5f 54 31 5f 4d 4f 44 45 3d  _SHA256_T1_MODE=
bfc0: 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20  "$S_TMP_0".     
bfd0: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
bfe0: 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d    fi.        #--
bff0: 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20  --.        if [ 
c000: 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50  "$SB_EXISTS_ON_P
c010: 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d  ATH_T1_RESULT" =
c020: 3d 20 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a 20  = "f" ] ; then. 
c030: 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50             S_TMP
c040: 5f 30 3d 22 72 68 61 73 68 22 20 20 20 20 23 20  _0="rhash"    # 
c050: 70 61 72 74 20 6f 66 20 74 68 65 20 42 53 44 20  part of the BSD 
c060: 70 61 63 6b 61 67 65 20 63 6f 6c 6c 65 63 74 69  package collecti
c070: 6f 6e 20 69 6e 20 32 30 31 36 0a 20 20 20 20 20  on in 2016.     
c080: 20 20 20 20 20 20 20 66 75 6e 63 5f 73 62 5f 65         func_sb_e
c090: 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31  xists_on_path_t1
c0a0: 20 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20 20 20   "$S_TMP_0" .   
c0b0: 20 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24           if [ "$
c0c0: 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54  SB_EXISTS_ON_PAT
c0d0: 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20  H_T1_RESULT" == 
c0e0: 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20  "t" ] ; then.   
c0f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 5f                S_
c100: 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36  FUNC_MMMV_SHA256
c110: 5f 54 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d 50  _T1_MODE="$S_TMP
c120: 5f 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  _0".            
c130: 66 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20  fi.        fi.  
c140: 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
c150: 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58      if [ "$SB_EX
c160: 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f  ISTS_ON_PATH_T1_
c170: 52 45 53 55 4c 54 22 20 3d 3d 20 22 66 22 20 5d  RESULT" == "f" ]
c180: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
c190: 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 73 68 61      S_TMP_0="sha
c1a0: 32 35 36 22 20 20 20 20 23 20 75 73 75 61 6c 6c  256"    # usuall
c1b0: 79 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 42  y available on B
c1c0: 53 44 0a 20 20 20 20 20 20 20 20 20 20 20 20 66  SD.            f
c1d0: 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e  unc_sb_exists_on
c1e0: 5f 70 61 74 68 5f 74 31 20 22 24 53 5f 54 4d 50  _path_t1 "$S_TMP
c1f0: 5f 30 22 20 0a 20 20 20 20 20 20 20 20 20 20 20  _0" .           
c200: 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54   if [ "$SB_EXIST
c210: 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53  S_ON_PATH_T1_RES
c220: 55 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20 3b 20  ULT" == "t" ] ; 
c230: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
c240: 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d        S_FUNC_MMM
c250: 56 5f 53 48 41 32 35 36 5f 54 31 5f 4d 4f 44 45  V_SHA256_T1_MODE
c260: 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20  ="$S_TMP_0".    
c270: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
c280: 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 20     fi.        # 
c290: 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61 70 70 6c  The console appl
c2a0: 69 63 61 74 69 6f 6e 20 22 72 68 61 73 68 22 20  ication "rhash" 
c2b0: 69 73 20 70 72 65 66 65 72 72 65 64 20 74 6f 20  is preferred to 
c2c0: 74 68 65 20 22 73 68 61 32 35 36 22 0a 20 20 20  the "sha256".   
c2d0: 20 20 20 20 20 23 20 62 65 63 61 75 73 65 20 74       # because t
c2e0: 68 65 20 22 72 68 61 73 68 22 20 6f 75 74 70 75  he "rhash" outpu
c2f0: 74 20 63 61 6e 20 62 65 20 73 69 6d 70 6c 79 20  t can be simply 
c300: 70 72 6f 63 65 73 73 65 64 20 77 69 74 68 20 0a  processed with .
c310: 20 20 20 20 20 20 20 20 23 20 22 67 61 77 6b 22          # "gawk"
c320: 2c 20 77 68 69 63 68 20 74 61 6b 65 73 20 6f 76  , which takes ov
c330: 65 72 20 35 78 20 6c 65 73 73 20 6d 65 6d 6f 72  er 5x less memor
c340: 79 20 74 68 61 6e 20 74 68 65 20 52 75 62 79 20  y than the Ruby 
c350: 69 6e 74 65 72 70 72 65 74 65 72 2c 0a 20 20 20  interpreter,.   
c360: 20 20 20 20 20 23 20 6e 6f 74 20 74 6f 20 6d 65       # not to me
c370: 6e 74 69 6f 6e 20 74 68 65 20 69 6e 69 74 69 61  ntion the initia
c380: 6c 69 7a 61 74 69 6f 6e 20 63 6f 73 74 20 6f 66  lization cost of
c390: 20 74 68 65 20 52 75 62 79 20 69 6e 74 65 72 70   the Ruby interp
c3a0: 72 65 74 65 72 2e 0a 20 20 20 20 20 20 20 20 23  reter..        #
c3b0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20 20  --------.       
c3c0: 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d   if [ "$S_FUNC_M
c3d0: 4d 4d 56 5f 53 48 41 32 35 36 5f 54 31 5f 4d 4f  MMV_SHA256_T1_MO
c3e0: 44 45 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68  DE" == "" ] ; th
c3f0: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
c400: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
c410: 20 20 20 65 63 68 6f 20 22 41 6c 6c 20 6f 66 20     echo "All of 
c420: 74 68 65 20 53 48 41 2d 32 35 36 20 69 6d 70 6c  the SHA-256 impl
c430: 65 6d 65 6e 74 61 74 69 6f 6e 73 20 74 68 61 74  ementations that
c440: 20 74 68 69 73 20 73 63 72 69 70 74 20 22 20 0a   this script " .
c450: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
c460: 20 22 69 73 20 63 61 70 61 62 6c 65 20 6f 66 20   "is capable of 
c470: 75 73 69 6e 67 20 28 73 68 61 32 35 36 73 75 6d  using (sha256sum
c480: 2c 20 72 68 61 73 68 2c 20 73 68 61 32 35 36 29  , rhash, sha256)
c490: 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65   ".            e
c4a0: 63 68 6f 20 22 61 72 65 20 6d 69 73 73 69 6e 67  cho "are missing
c4b0: 20 66 72 6f 6d 20 74 68 65 20 50 41 54 48 2e 22   from the PATH."
c4c0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
c4d0: 6f 20 22 47 55 49 44 3d 3d 27 36 38 34 63 33 32  o "GUID=='684c32
c4e0: 31 66 2d 34 65 37 35 2d 34 36 35 64 2d 38 31 63  1f-4e75-465d-81c
c4f0: 30 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22  0-21b170e031e7'"
c500: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
c510: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
c520: 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20   #----.         
c530: 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
c540: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69  .            exi
c550: 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
c560: 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69  error.        fi
c570: 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d  .        #------
c580: 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20  --.        if [ 
c590: 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74  "$?" != "0" ]; t
c5a0: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
c5b0: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
c5c0: 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20 73      echo "This s
c5d0: 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64 2e  cript is flawed.
c5e0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
c5f0: 68 6f 20 22 47 55 49 44 3d 3d 27 32 63 63 34 32  ho "GUID=='2cc42
c600: 66 31 34 2d 39 63 63 65 2d 34 34 38 61 2d 39 34  f14-9cce-448a-94
c610: 63 30 2d 32 31 62 31 37 30 65 30 33 31 65 37 27  c0-21b170e031e7'
c620: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
c630: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
c640: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
c650: 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
c660: 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78  G.            ex
c670: 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
c680: 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66   error.        f
c690: 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d  i.        #-----
c6a0: 2d 2d 2d 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ---.    fi.    #
c6b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
c6c0: 2d 2d 2d 2d 0a 20 20 20 20 53 5f 46 55 4e 43 5f  ----.    S_FUNC_
c6d0: 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54 31 5f 52  MMMV_SHA256_T1_R
c6e0: 45 53 55 4c 54 3d 22 22 0a 20 20 20 20 23 2d 2d  ESULT="".    #--
c6f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
c700: 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  --.    if [ "$S_
c710: 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36  FUNC_MMMV_SHA256
c720: 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 73 68  _T1_MODE" == "sh
c730: 61 32 35 36 73 75 6d 22 20 5d 3b 20 74 68 65 6e  a256sum" ]; then
c740: 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30  .        S_TMP_0
c750: 3d 22 60 73 68 61 32 35 36 73 75 6d 20 24 53 5f  ="`sha256sum $S_
c760: 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47  FP_2_AN_EXISTING
c770: 5f 46 49 4c 45 20 32 3e 2f 64 65 76 2f 6e 75 6c  _FILE 2>/dev/nul
c780: 6c 60 22 0a 20 20 20 20 20 20 20 20 69 66 20 5b  l`".        if [
c790: 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20   "$?" != "0" ]; 
c7a0: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
c7b0: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
c7c0: 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 63       echo "The c
c7d0: 6f 6e 73 6f 6c 65 20 61 70 70 6c 69 63 61 74 69  onsole applicati
c7e0: 6f 6e 20 5c 22 73 68 61 32 35 36 73 75 6d 5c 22  on \"sha256sum\"
c7f0: 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65   ".            e
c800: 63 68 6f 20 22 65 78 69 74 65 64 20 77 69 74 68  cho "exited with
c810: 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20 20 20   an error.".    
c820: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
c830: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
c840: 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f   "----console--o
c850: 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d  utput--citation-
c860: 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20 20 20  -start-----".   
c870: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 60           echo "`
c880: 73 68 61 32 35 36 73 75 6d 20 24 53 5f 46 50 5f  sha256sum $S_FP_
c890: 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49  2_AN_EXISTING_FI
c8a0: 4c 45 60 22 20 23 20 73 74 64 6f 75 74 20 61 6e  LE`" # stdout an
c8b0: 64 20 73 74 64 65 72 72 0a 20 20 20 20 20 20 20  d stderr.       
c8c0: 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63       echo "----c
c8d0: 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d  onsole--output--
c8e0: 63 69 74 61 74 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d  citation--end---
c8f0: 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20  ----".          
c900: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
c910: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
c920: 3d 3d 27 61 66 32 31 38 37 34 38 2d 32 62 32 39  =='af218748-2b29
c930: 2d 34 61 62 39 2d 38 35 63 30 2d 32 31 62 31 37  -4ab9-85c0-21b17
c940: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
c950: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
c960: 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a            #----.
c970: 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24              cd $
c980: 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
c990: 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
c9a0: 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
c9b0: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
c9c0: 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48    S_FUNC_MMMV_SH
c9d0: 41 32 35 36 5f 54 31 5f 52 45 53 55 4c 54 3d 22  A256_T1_RESULT="
c9e0: 60 72 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74  `ruby -e \"print
c9f0: 28 41 52 47 56 5b 30 5d 29 3b 5c 22 20 24 53 5f  (ARGV[0]);\" $S_
ca00: 54 4d 50 5f 30 20 60 22 0a 20 20 20 20 66 69 0a  TMP_0 `".    fi.
ca10: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
ca20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66  ---------.    if
ca30: 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56   [ "$S_FUNC_MMMV
ca40: 5f 53 48 41 32 35 36 5f 54 31 5f 4d 4f 44 45 22  _SHA256_T1_MODE"
ca50: 20 3d 3d 20 22 72 68 61 73 68 22 20 5d 3b 20 74   == "rhash" ]; t
ca60: 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d  hen.        S_TM
ca70: 50 5f 30 3d 22 60 72 68 61 73 68 20 2d 2d 73 68  P_0="`rhash --sh
ca80: 61 32 35 36 20 24 53 5f 46 50 5f 32 5f 41 4e 5f  a256 $S_FP_2_AN_
ca90: 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 20 32 3e  EXISTING_FILE 2>
caa0: 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 20 20 20 20  /dev/null`".    
cab0: 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d      if [ "$?" !=
cac0: 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20   "0" ]; then.   
cad0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
cae0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
caf0: 6f 20 22 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61  o "The console a
cb00: 70 70 6c 69 63 61 74 69 6f 6e 20 5c 22 72 68 61  pplication \"rha
cb10: 73 68 5c 22 20 22 0a 20 20 20 20 20 20 20 20 20  sh\" ".         
cb20: 20 20 20 65 63 68 6f 20 22 65 78 69 74 65 64 20     echo "exited 
cb30: 77 69 74 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a  with an error.".
cb40: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
cb50: 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
cb60: 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c  echo "----consol
cb70: 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74  e--output--citat
cb80: 69 6f 6e 2d 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22  ion--start-----"
cb90: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
cba0: 6f 20 22 60 72 68 61 73 68 20 2d 2d 73 68 61 32  o "`rhash --sha2
cbb0: 35 36 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58  56 $S_FP_2_AN_EX
cbc0: 49 53 54 49 4e 47 5f 46 49 4c 45 20 60 22 0a 20  ISTING_FILE `". 
cbd0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
cbe0: 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75  "----console--ou
cbf0: 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d  tput--citation--
cc00: 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20 20 20  end-------".    
cc10: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
cc20: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
cc30: 20 22 47 55 49 44 3d 3d 27 63 30 34 37 61 66 33   "GUID=='c047af3
cc40: 35 2d 31 61 32 65 2d 34 65 35 65 2d 39 34 62 30  5-1a2e-4e5e-94b0
cc50: 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a  -21b170e031e7'".
cc60: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
cc70: 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
cc80: 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20  #----.          
cc90: 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
cca0: 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74              exit
ccb0: 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
ccc0: 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a  rror.        fi.
ccd0: 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d          S_FUNC_M
cce0: 4d 4d 56 5f 53 48 41 32 35 36 5f 54 31 5f 52 45  MMV_SHA256_T1_RE
ccf0: 53 55 4c 54 3d 22 60 72 75 62 79 20 2d 65 20 5c  SULT="`ruby -e \
cd00: 22 70 72 69 6e 74 28 41 52 47 56 5b 30 5d 29 3b  "print(ARGV[0]);
cd10: 5c 22 20 24 53 5f 54 4d 50 5f 30 20 60 22 0a 20  \" $S_TMP_0 `". 
cd20: 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
cd30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
cd40: 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e      if [ "$S_FUN
cd50: 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54 31  C_MMMV_SHA256_T1
cd60: 5f 4d 4f 44 45 22 20 3d 3d 20 22 73 68 61 32 35  _MODE" == "sha25
cd70: 36 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  6" ]; then.     
cd80: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
cd90: 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41   S_FUNC_MMMV_SHA
cda0: 32 35 36 5f 54 31 5f 52 45 53 55 4c 54 3d 5c 0a  256_T1_RESULT=\.
cdb0: 20 20 20 20 20 20 20 20 22 60 53 5f 54 4d 50 5f          "`S_TMP_
cdc0: 30 3d 5c 22 5c 60 73 68 61 32 35 36 20 24 53 5f  0=\"\`sha256 $S_
cdd0: 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47  FP_2_AN_EXISTING
cde0: 5f 46 49 4c 45 5c 60 5c 22 20 72 75 62 79 20 2d  _FILE\`\" ruby -
cdf0: 65 20 5c 22 73 30 3d 45 4e 56 5b 27 53 5f 54 4d  e \"s0=ENV['S_TM
ce00: 50 5f 30 27 5d 2e 74 6f 5f 73 3b 69 78 5f 30 3d  P_0'].to_s;ix_0=
ce10: 73 30 2e 69 6e 64 65 78 28 27 29 20 3d 20 27 29  s0.index(') = ')
ce20: 3b 70 72 69 6e 74 20 73 30 5b 28 69 78 5f 30 2b  ;print s0[(ix_0+
ce30: 34 29 2e 2e 28 2d 31 29 5d 5c 22 20 32 3e 2f 64  4)..(-1)]\" 2>/d
ce40: 65 76 2f 6e 75 6c 6c 60 22 0a 20 20 20 20 20 20  ev/null`".      
ce50: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
ce60: 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22  if [ "$?" != "0"
ce70: 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
ce80: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
ce90: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54           echo "T
cea0: 68 65 20 63 6f 6e 73 6f 6c 65 20 61 70 70 6c 69  he console appli
ceb0: 63 61 74 69 6f 6e 20 5c 22 73 68 61 32 35 36 5c  cation \"sha256\
cec0: 22 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  " ".            
ced0: 65 63 68 6f 20 22 65 78 69 74 65 64 20 77 69 74  echo "exited wit
cee0: 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20 20  h an error.".   
cef0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
cf00: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
cf10: 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d  o "----console--
cf20: 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e  output--citation
cf30: 2d 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20 20  --start-----".  
cf40: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 5c            echo \
cf50: 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 60 53  .            "`S
cf60: 5f 54 4d 50 5f 30 3d 5c 22 5c 60 73 68 61 32 35  _TMP_0=\"\`sha25
cf70: 36 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49  6 $S_FP_2_AN_EXI
cf80: 53 54 49 4e 47 5f 46 49 4c 45 5c 60 5c 22 20 72  STING_FILE\`\" r
cf90: 75 62 79 20 2d 65 20 5c 22 73 30 3d 45 4e 56 5b  uby -e \"s0=ENV[
cfa0: 27 53 5f 54 4d 50 5f 30 27 5d 2e 74 6f 5f 73 3b  'S_TMP_0'].to_s;
cfb0: 69 78 5f 30 3d 73 30 2e 69 6e 64 65 78 28 27 29  ix_0=s0.index(')
cfc0: 20 3d 20 27 29 3b 70 72 69 6e 74 20 73 30 5b 28   = ');print s0[(
cfd0: 69 78 5f 30 2b 34 29 2e 2e 28 2d 31 29 5d 5c 22  ix_0+4)..(-1)]\"
cfe0: 60 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  `".            e
cff0: 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65  cho "----console
d000: 2d 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69  --output--citati
d010: 6f 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a  on--end-------".
d020: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
d030: 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
d040: 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 33 37 61  echo "GUID=='37a
d050: 30 63 61 62 33 2d 33 31 34 62 2d 34 64 64 34 2d  0cab3-314b-4dd4-
d060: 62 31 62 30 2d 32 31 62 31 37 30 65 30 33 31 65  b1b0-21b170e031e
d070: 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  7'".            
d080: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
d090: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
d0a0: 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f        cd $S_FP_O
d0b0: 52 49 47 0a 20 20 20 20 20 20 20 20 20 20 20 20  RIG.            
d0c0: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
d0d0: 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20  th error.       
d0e0: 20 66 69 0a 20 20 20 20 66 69 0a 20 20 20 20 23   fi.    fi.    #
d0f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d100: 2d 2d 2d 2d 0a 20 20 20 20 23 20 54 68 65 20 72  ----.    # The r
d110: 65 61 73 6f 6e 2c 20 77 68 79 20 65 76 65 72 79  eason, why every
d120: 74 68 69 6e 67 20 69 73 20 64 6f 6e 65 20 77 69  thing is done wi
d130: 74 68 20 72 75 62 79 20 61 74 20 74 68 65 20 6e  th ruby at the n
d140: 65 78 74 20 0a 20 20 20 20 23 20 42 61 73 68 20  ext .    # Bash 
d150: 61 73 73 69 67 6e 6d 65 6e 74 20 63 6c 61 75 73  assignment claus
d160: 65 20 69 73 20 74 68 61 74 20 74 68 65 20 22 77  e is that the "w
d170: 63 20 2d 6d 22 20 70 61 64 73 20 69 74 73 20 6f  c -m" pads its o
d180: 75 74 70 75 74 0a 20 20 20 20 23 20 77 69 74 68  utput.    # with
d190: 20 73 70 61 63 65 73 20 6f 6e 20 42 53 44 2e 0a   spaces on BSD..
d1a0: 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75      S_TMP_0="`ru
d1b0: 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 41 52  by -e \"print(AR
d1c0: 47 56 5b 30 5d 2e 74 6f 5f 73 2e 6c 65 6e 67 74  GV[0].to_s.lengt
d1d0: 68 2e 74 6f 5f 73 29 3b 5c 22 20 24 53 5f 46 55  h.to_s);\" $S_FU
d1e0: 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54  NC_MMMV_SHA256_T
d1f0: 31 5f 52 45 53 55 4c 54 20 60 22 0a 20 20 20 20  1_RESULT `".    
d200: 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f  #--------.    S_
d210: 54 4d 50 5f 31 3d 22 36 34 22 0a 20 20 20 20 69  TMP_1="64".    i
d220: 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22 20 21  f [ "$S_TMP_0" !
d230: 3d 20 22 24 53 5f 54 4d 50 5f 31 22 20 5d 3b 20  = "$S_TMP_1" ]; 
d240: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68  then.        ech
d250: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
d260: 6f 20 22 41 63 63 6f 72 64 69 6e 67 20 74 6f 20  o "According to 
d270: 74 68 65 20 73 70 65 63 69 66 69 63 61 74 69 6f  the specificatio
d280: 6e 20 6f 66 20 74 68 65 20 53 48 41 2d 32 35 36  n of the SHA-256
d290: 20 68 61 73 68 20 61 6c 67 6f 72 69 74 68 6d 22   hash algorithm"
d2a0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 74  .        echo "t
d2b0: 68 65 20 6c 65 6e 67 74 68 20 6f 66 20 74 68 65  he length of the
d2c0: 20 53 48 41 2d 32 35 36 20 68 61 73 68 20 69 73   SHA-256 hash is
d2d0: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
d2e0: 22 24 53 5f 54 4d 50 5f 31 20 68 65 78 61 64 65  "$S_TMP_1 hexade
d2f0: 63 69 6d 61 6c 20 63 68 61 72 61 63 74 65 72 73  cimal characters
d300: 2c 20 62 75 74 20 74 68 65 20 72 65 73 75 6c 74  , but the result
d310: 20 6f 66 20 74 68 65 20 22 0a 20 20 20 20 20 20   of the ".      
d320: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
d330: 20 20 65 63 68 6f 20 22 20 20 20 20 66 75 6e 63    echo "    func
d340: 5f 6d 6d 6d 76 5f 73 68 61 32 35 36 5f 74 31 22  _mmmv_sha256_t1"
d350: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
d360: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69  .        echo "i
d370: 73 20 73 6f 6d 65 74 68 69 6e 67 20 65 6c 73 65  s something else
d380: 2e 20 54 68 65 20 66 6c 61 77 65 64 20 68 61 73  . The flawed has
d390: 68 20 63 61 6e 64 69 64 61 74 65 20 69 6e 20 70  h candidate in p
d3a0: 61 72 65 6e 74 68 65 73 69 73 3a 22 0a 20 20 20  arenthesis:".   
d3b0: 20 20 20 20 20 65 63 68 6f 20 22 28 24 53 5f 46       echo "($S_F
d3c0: 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f  UNC_MMMV_SHA256_
d3d0: 54 31 5f 52 45 53 55 4c 54 29 22 0a 20 20 20 20  T1_RESULT)".    
d3e0: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
d3f0: 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 6c 65      echo "The le
d400: 6e 67 74 68 20 63 61 6e 64 69 64 61 74 65 20 6f  ngth candidate o
d410: 66 20 74 68 65 20 66 6c 61 77 65 64 20 68 61 73  f the flawed has
d420: 68 20 63 61 6e 64 69 64 61 74 65 20 69 6e 20 70  h candidate in p
d430: 61 72 65 6e 74 68 65 73 69 73 3a 22 0a 20 20 20  arenthesis:".   
d440: 20 20 20 20 20 65 63 68 6f 20 22 28 24 53 5f 54       echo "($S_T
d450: 4d 50 5f 30 29 2e 22 0a 20 20 20 20 20 20 20 20  MP_0).".        
d460: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
d470: 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 31 38 35  echo "GUID=='185
d480: 61 61 64 34 35 2d 34 62 62 31 2d 34 37 34 39 2d  aad45-4bb1-4749-
d490: 62 38 62 30 2d 32 31 62 31 37 30 65 30 33 31 65  b8b0-21b170e031e
d4a0: 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
d4b0: 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
d4c0: 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
d4d0: 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
d4e0: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
d4f0: 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
d500: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
d510: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23 20 66 75  ---------.} # fu
d520: 6e 63 5f 6d 6d 6d 76 5f 73 68 61 32 35 36 5f 74  nc_mmmv_sha256_t
d530: 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  1...#-----------
d540: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d550: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d560: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d570: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
d580: 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47  .S_FUNC_MMMV_TIG
d590: 45 52 48 41 53 48 5f 54 31 5f 52 45 53 55 4c 54  ERHASH_T1_RESULT
d5a0: 3d 22 6e 6f 74 5f 79 65 74 5f 73 65 74 22 0a 53  ="not_yet_set".S
d5b0: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52  _FUNC_MMMV_TIGER
d5c0: 48 41 53 48 5f 54 31 5f 4d 4f 44 45 3d 22 22 20  HASH_T1_MODE="" 
d5d0: 23 20 6f 70 74 69 6d 2e 20 74 6f 20 73 6b 69 70  # optim. to skip
d5e0: 20 72 65 70 65 61 74 69 6e 67 20 63 6f 6e 73 6f   repeating conso
d5f0: 6c 65 20 74 6f 6f 6c 20 73 65 6c 65 63 74 69 6f  le tool selectio
d600: 6e 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 74 69 67 65  n.func_mmmv_tige
d610: 72 68 61 73 68 5f 74 31 28 29 20 7b 20 23 20 72  rhash_t1() { # r
d620: 65 71 75 69 72 65 73 20 61 6c 73 6f 20 72 75 62  equires also rub
d630: 79 20 61 6e 64 20 67 61 77 6b 20 0a 20 20 20 20  y and gawk .    
d640: 6c 6f 63 61 6c 20 53 5f 46 50 5f 32 5f 41 4e 5f  local S_FP_2_AN_
d650: 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 3d 22 24  EXISTING_FILE="$
d660: 31 22 20 23 20 66 69 72 73 74 20 66 75 6e 63 74  1" # first funct
d670: 69 6f 6e 20 61 72 67 75 6d 65 6e 74 0a 20 20 20  ion argument.   
d680: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 6c   #--------.    l
d690: 6f 63 61 6c 20 53 5f 54 4d 50 5f 30 20 23 20 64  ocal S_TMP_0 # d
d6a0: 65 63 6c 61 72 61 74 69 6f 6e 0a 20 20 20 20 6c  eclaration.    l
d6b0: 6f 63 61 6c 20 53 5f 54 4d 50 5f 31 20 23 20 64  ocal S_TMP_1 # d
d6c0: 65 63 6c 61 72 61 74 69 6f 6e 0a 20 20 20 20 66  eclaration.    f
d6d0: 75 6e 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73  unc_mmmv_exc_has
d6e0: 68 5f 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74  h_function_input
d6f0: 5f 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31  _verification_t1
d700: 20 22 66 75 6e 63 5f 6d 6d 6d 76 5f 74 69 67 65   "func_mmmv_tige
d710: 72 68 61 73 68 5f 74 31 22 20 22 24 31 22 0a 20  rhash_t1" "$1". 
d720: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
d730: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 4d  --------.    # M
d740: 6f 64 65 20 73 65 6c 65 63 74 69 6f 6e 3a 0a 20  ode selection:. 
d750: 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43     if [ "$S_FUNC
d760: 5f 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53 48 5f  _MMMV_TIGERHASH_
d770: 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 22 20 5d  T1_MODE" == "" ]
d780: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
d790: 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54  SB_EXISTS_ON_PAT
d7a0: 48 5f 54 31 5f 52 45 53 55 4c 54 3d 22 66 22 20  H_T1_RESULT="f" 
d7b0: 20 23 20 69 66 2d 62 6c 6f 63 6b 20 69 6e 69 74   # if-block init
d7c0: 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
d7d0: 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 42         if [ "$SB
d7e0: 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f  _EXISTS_ON_PATH_
d7f0: 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22 66  T1_RESULT" == "f
d800: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
d810: 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22         S_TMP_0="
d820: 74 69 67 65 72 64 65 65 70 22 20 23 20 75 73 75  tigerdeep" # usu
d830: 61 6c 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 6f  ally available o
d840: 6e 20 4c 69 6e 75 78 0a 20 20 20 20 20 20 20 20  n Linux.        
d850: 20 20 20 20 66 75 6e 63 5f 73 62 5f 65 78 69 73      func_sb_exis
d860: 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31 20 22 24  ts_on_path_t1 "$
d870: 53 5f 54 4d 50 5f 30 22 20 0a 20 20 20 20 20 20  S_TMP_0" .      
d880: 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f        if [ "$SB_
d890: 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54  EXISTS_ON_PATH_T
d8a0: 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22 74 22  1_RESULT" == "t"
d8b0: 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20   ] ; then.      
d8c0: 20 20 20 20 20 20 20 20 20 20 20 53 5f 46 55 4e             S_FUN
d8d0: 43 5f 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53 48  C_MMMV_TIGERHASH
d8e0: 5f 54 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d 50  _T1_MODE="$S_TMP
d8f0: 5f 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  _0".            
d900: 66 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20  fi.        fi.  
d910: 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
d920: 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58      if [ "$SB_EX
d930: 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f  ISTS_ON_PATH_T1_
d940: 52 45 53 55 4c 54 22 20 3d 3d 20 22 66 22 20 5d  RESULT" == "f" ]
d950: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
d960: 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 72 68 61      S_TMP_0="rha
d970: 73 68 22 20 20 20 20 23 20 70 61 72 74 20 6f 66  sh"    # part of
d980: 20 74 68 65 20 42 53 44 20 70 61 63 6b 61 67 65   the BSD package
d990: 20 63 6f 6c 6c 65 63 74 69 6f 6e 20 69 6e 20 32   collection in 2
d9a0: 30 31 36 0a 20 20 20 20 20 20 20 20 20 20 20 20  016.            
d9b0: 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f  func_sb_exists_o
d9c0: 6e 5f 70 61 74 68 5f 74 31 20 22 24 53 5f 54 4d  n_path_t1 "$S_TM
d9d0: 50 5f 30 22 20 0a 20 20 20 20 20 20 20 20 20 20  P_0" .          
d9e0: 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53    if [ "$SB_EXIS
d9f0: 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45  TS_ON_PATH_T1_RE
da00: 53 55 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20 3b  SULT" == "t" ] ;
da10: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20   then.          
da20: 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d         S_FUNC_MM
da30: 4d 56 5f 54 49 47 45 52 48 41 53 48 5f 54 31 5f  MV_TIGERHASH_T1_
da40: 4d 4f 44 45 3d 22 24 53 5f 54 4d 50 5f 30 22 0a  MODE="$S_TMP_0".
da50: 20 20 20 20 20 20 20 20 20 20 20 20 66 69 0a 20              fi. 
da60: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
da70: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
da80: 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e      if [ "$S_FUN
da90: 43 5f 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53 48  C_MMMV_TIGERHASH
daa0: 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 22 20  _T1_MODE" == "" 
dab0: 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  ] ; then.       
dac0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
dad0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 41           echo "A
dae0: 6c 6c 20 6f 66 20 74 68 65 20 54 69 67 65 72 20  ll of the Tiger 
daf0: 68 61 73 68 20 69 6d 70 6c 65 6d 65 6e 74 61 74  hash implementat
db00: 69 6f 6e 73 20 74 68 61 74 20 74 68 69 73 20 73  ions that this s
db10: 63 72 69 70 74 20 22 20 0a 20 20 20 20 20 20 20  cript " .       
db20: 20 20 20 20 20 65 63 68 6f 20 22 69 73 20 63 61       echo "is ca
db30: 70 61 62 6c 65 20 6f 66 20 75 73 69 6e 67 20 28  pable of using (
db40: 74 69 67 65 72 64 65 65 70 2c 20 72 68 61 73 68  tigerdeep, rhash
db50: 29 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  ) ".            
db60: 65 63 68 6f 20 22 61 72 65 20 6d 69 73 73 69 6e  echo "are missin
db70: 67 20 66 72 6f 6d 20 74 68 65 20 50 41 54 48 2e  g from the PATH.
db80: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
db90: 68 6f 20 22 47 55 49 44 3d 3d 27 34 61 35 61 30  ho "GUID=='4a5a0
dba0: 39 37 32 2d 33 33 62 30 2d 34 61 33 65 2d 38 35  972-33b0-4a3e-85
dbb0: 62 30 2d 32 31 62 31 37 30 65 30 33 31 65 37 27  b0-21b170e031e7'
dbc0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
dbd0: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
dbe0: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
dbf0: 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
dc00: 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78  G.            ex
dc10: 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
dc20: 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66   error.        f
dc30: 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d  i.        #-----
dc40: 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b  ---.        if [
dc50: 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20   "$?" != "0" ]; 
dc60: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
dc70: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
dc80: 20 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20       echo "This 
dc90: 73 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64  script is flawed
dca0: 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  .".            e
dcb0: 63 68 6f 20 22 47 55 49 44 3d 3d 27 30 65 32 35  cho "GUID=='0e25
dcc0: 63 33 33 36 2d 34 62 66 62 2d 34 31 38 63 2d 62  c336-4bfb-418c-b
dcd0: 33 62 30 2d 32 31 62 31 37 30 65 30 33 31 65 37  3b0-21b170e031e7
dce0: 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  '".            e
dcf0: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
dd00: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
dd10: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
dd20: 49 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  IG.            e
dd30: 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
dd40: 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20  h error.        
dd50: 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  fi.        #----
dd60: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 66 75 6e  ----.        fun
dd70: 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e 5f 70  c_sb_exists_on_p
dd80: 61 74 68 5f 74 31 20 22 72 75 62 79 22 20 0a 20  ath_t1 "ruby" . 
dd90: 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 42         if [ "$SB
dda0: 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f  _EXISTS_ON_PATH_
ddb0: 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22 66  T1_RESULT" == "f
ddc0: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
ddd0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
dde0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
ddf0: 22 5c 22 72 75 62 79 5c 22 20 69 73 20 6d 69 73  "\"ruby\" is mis
de00: 73 69 6e 67 20 66 72 6f 6d 20 74 68 65 20 50 41  sing from the PA
de10: 54 48 2c 20 62 75 74 20 22 0a 20 20 20 20 20 20  TH, but ".      
de20: 20 20 20 20 20 20 65 63 68 6f 20 22 74 68 69 73        echo "this
de30: 20 66 75 6e 63 74 69 6f 6e 20 72 65 71 75 69 72   function requir
de40: 65 73 20 74 68 61 74 20 69 74 20 69 73 20 6f 6e  es that it is on
de50: 20 74 68 65 20 50 41 54 48 2e 22 0a 20 20 20 20   the PATH.".    
de60: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
de70: 49 44 3d 3d 27 33 64 31 37 32 30 61 33 2d 65 32  ID=='3d1720a3-e2
de80: 65 37 2d 34 33 30 38 2d 39 33 62 30 2d 32 31 62  e7-4308-93b0-21b
de90: 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  170e031e7'".    
dea0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
deb0: 20 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d              #---
dec0: 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 64  -.            cd
ded0: 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20   $S_FP_ORIG.    
dee0: 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
def0: 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
df00: 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20  .        fi.    
df10: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
df20: 20 20 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20        if [ "$?" 
df30: 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20  != "0" ]; then. 
df40: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
df50: 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  "".            e
df60: 63 68 6f 20 22 54 68 69 73 20 73 63 72 69 70 74  cho "This script
df70: 20 69 73 20 66 6c 61 77 65 64 2e 22 0a 20 20 20   is flawed.".   
df80: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47           echo "G
df90: 55 49 44 3d 3d 27 35 33 64 39 36 65 34 64 2d 36  UID=='53d96e4d-6
dfa0: 38 32 63 2d 34 30 37 35 2d 62 36 62 30 2d 32 31  82c-4075-b6b0-21
dfb0: 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  b170e031e7'".   
dfc0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
dfd0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d  .            #--
dfe0: 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63  --.            c
dff0: 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
e000: 20 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20           exit 1 
e010: 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
e020: 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20  r.        fi.   
e030: 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20       #--------. 
e040: 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
e050: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
e060: 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f      S_FUNC_MMMV_
e070: 54 49 47 45 52 48 41 53 48 5f 54 31 5f 52 45 53  TIGERHASH_T1_RES
e080: 55 4c 54 3d 22 22 0a 20 20 20 20 23 2d 2d 2d 2d  ULT="".    #----
e090: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
e0a0: 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55  .    if [ "$S_FU
e0b0: 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53  NC_MMMV_TIGERHAS
e0c0: 48 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 74  H_T1_MODE" == "t
e0d0: 69 67 65 72 64 65 65 70 22 20 5d 3b 20 74 68 65  igerdeep" ]; the
e0e0: 6e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f  n.        S_TMP_
e0f0: 30 3d 22 60 74 69 67 65 72 64 65 65 70 20 24 53  0="`tigerdeep $S
e100: 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e  _FP_2_AN_EXISTIN
e110: 47 5f 46 49 4c 45 20 32 3e 2f 64 65 76 2f 6e 75  G_FILE 2>/dev/nu
e120: 6c 6c 60 22 0a 20 20 20 20 20 20 20 20 69 66 20  ll`".        if 
e130: 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b  [ "$?" != "0" ];
e140: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20   then.          
e150: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
e160: 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
e170: 63 6f 6e 73 6f 6c 65 20 61 70 70 6c 69 63 61 74  console applicat
e180: 69 6f 6e 20 5c 22 74 69 67 65 72 64 65 65 70 5c  ion \"tigerdeep\
e190: 22 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  " ".            
e1a0: 65 63 68 6f 20 22 65 78 69 74 65 64 20 77 69 74  echo "exited wit
e1b0: 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20 20  h an error.".   
e1c0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
e1d0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
e1e0: 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d  o "----console--
e1f0: 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e  output--citation
e200: 2d 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20 20  --start-----".  
e210: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
e220: 60 74 69 67 65 72 64 65 65 70 20 24 53 5f 46 50  `tigerdeep $S_FP
e230: 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46  _2_AN_EXISTING_F
e240: 49 4c 45 60 22 20 23 20 73 74 64 6f 75 74 20 61  ILE`" # stdout a
e250: 6e 64 20 73 74 64 65 72 72 0a 20 20 20 20 20 20  nd stderr.      
e260: 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d        echo "----
e270: 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d  console--output-
e280: 2d 63 69 74 61 74 69 6f 6e 2d 2d 65 6e 64 2d 2d  -citation--end--
e290: 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20  -----".         
e2a0: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
e2b0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
e2c0: 44 3d 3d 27 33 61 33 31 66 37 32 61 2d 35 62 61  D=='3a31f72a-5ba
e2d0: 30 2d 34 39 32 32 2d 38 32 62 30 2d 32 31 62 31  0-4922-82b0-21b1
e2e0: 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
e2f0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
e300: 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d             #----
e310: 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20  .            cd 
e320: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
e330: 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
e340: 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
e350: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
e360: 20 20 20 23 20 54 68 65 20 22 74 69 67 65 72 64     # The "tigerd
e370: 65 65 70 22 20 72 65 74 75 72 6e 73 20 61 20 73  eep" returns a s
e380: 69 6e 67 6c 65 20 6c 69 6e 65 20 74 68 61 74 20  ingle line that 
e390: 68 61 73 20 74 68 65 20 66 6f 72 6d 61 74 20 6f  has the format o
e3a0: 66 20 0a 20 20 20 20 20 20 20 20 23 0a 20 20 20  f .        #.   
e3b0: 20 20 20 20 20 23 20 20 20 20 20 3c 74 68 65 20       #     <the 
e3c0: 68 61 73 68 3e 20 3c 70 61 74 68 20 74 6f 20 74  hash> <path to t
e3d0: 68 65 20 66 69 6c 65 3e 0a 20 20 20 20 20 20 20  he file>.       
e3e0: 20 23 0a 20 20 20 20 20 20 20 20 23 20 54 68 65   #.        # The
e3f0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 6c 69 6e 65 20   following line 
e400: 69 73 20 74 6f 20 70 69 63 6b 20 74 68 65 20 66  is to pick the f
e410: 69 72 73 74 20 63 6f 6c 75 6d 6e 20 66 72 6f 6d  irst column from
e420: 20 74 68 61 74 20 6c 69 6e 65 2e 0a 20 20 20 20   that line..    
e430: 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f      S_FUNC_MMMV_
e440: 54 49 47 45 52 48 41 53 48 5f 54 31 5f 52 45 53  TIGERHASH_T1_RES
e450: 55 4c 54 3d 22 60 72 75 62 79 20 2d 65 20 5c 22  ULT="`ruby -e \"
e460: 70 72 69 6e 74 28 41 52 47 56 5b 30 5d 29 3b 5c  print(ARGV[0]);\
e470: 22 20 24 53 5f 54 4d 50 5f 30 60 22 0a 20 20 20  " $S_TMP_0`".   
e480: 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d   fi.    #-------
e490: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20  -------------.  
e4a0: 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f    if [ "$S_FUNC_
e4b0: 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53 48 5f 54  MMMV_TIGERHASH_T
e4c0: 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 72 68 61 73  1_MODE" == "rhas
e4d0: 68 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  h" ]; then.     
e4e0: 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 68 61     S_TMP_0="`rha
e4f0: 73 68 20 2d 2d 74 69 67 65 72 20 24 53 5f 46 50  sh --tiger $S_FP
e500: 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46  _2_AN_EXISTING_F
e510: 49 4c 45 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  ILE 2>/dev/null`
e520: 22 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22  ".        if [ "
e530: 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68  $?" != "0" ]; th
e540: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
e550: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
e560: 20 20 20 65 63 68 6f 20 22 54 68 65 20 63 6f 6e     echo "The con
e570: 73 6f 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e  sole application
e580: 20 5c 22 72 68 61 73 68 5c 22 20 22 0a 20 20 20   \"rhash\" ".   
e590: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 65           echo "e
e5a0: 78 69 74 65 64 20 77 69 74 68 20 61 6e 20 65 72  xited with an er
e5b0: 72 6f 72 2e 22 0a 20 20 20 20 20 20 20 20 20 20  ror.".          
e5c0: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
e5d0: 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d        echo "----
e5e0: 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d  console--output-
e5f0: 2d 63 69 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74  -citation--start
e600: 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20  -----".         
e610: 20 20 20 65 63 68 6f 20 22 60 72 68 61 73 68 20     echo "`rhash 
e620: 2d 2d 74 69 67 65 72 20 24 53 5f 46 50 5f 32 5f  --tiger $S_FP_2_
e630: 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c 45  AN_EXISTING_FILE
e640: 20 60 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   `".            
e650: 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c  echo "----consol
e660: 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74  e--output--citat
e670: 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22  ion--end-------"
e680: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
e690: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
e6a0: 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 66 32   echo "GUID=='f2
e6b0: 34 62 36 61 32 32 2d 61 30 38 63 2d 34 34 37 61  4b6a22-a08c-447a
e6c0: 2d 61 64 62 30 2d 32 31 62 31 37 30 65 30 33 31  -adb0-21b170e031
e6d0: 65 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20  e7'".           
e6e0: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
e6f0: 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
e700: 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
e710: 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20 20 20  ORIG.           
e720: 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
e730: 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20  ith error.      
e740: 20 20 66 69 0a 20 20 20 20 20 20 20 20 53 5f 46    fi.        S_F
e750: 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52 48 41  UNC_MMMV_TIGERHA
e760: 53 48 5f 54 31 5f 52 45 53 55 4c 54 3d 22 60 72  SH_T1_RESULT="`r
e770: 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 41  uby -e \"print(A
e780: 52 47 56 5b 30 5d 29 3b 5c 22 20 24 53 5f 54 4d  RGV[0]);\" $S_TM
e790: 50 5f 30 60 22 0a 20 20 20 20 66 69 0a 20 20 20  P_0`".    fi.   
e7a0: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   #--------------
e7b0: 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 54 68 65  ------.    # The
e7c0: 20 72 65 61 73 6f 6e 2c 20 77 68 79 20 65 76 65   reason, why eve
e7d0: 72 79 74 68 69 6e 67 20 69 73 20 64 6f 6e 65 20  rything is done 
e7e0: 77 69 74 68 20 72 75 62 79 20 61 74 20 74 68 65  with ruby at the
e7f0: 20 6e 65 78 74 20 0a 20 20 20 20 23 20 42 61 73   next .    # Bas
e800: 68 20 61 73 73 69 67 6e 6d 65 6e 74 20 63 6c 61  h assignment cla
e810: 75 73 65 20 69 73 20 74 68 61 74 20 74 68 65 20  use is that the 
e820: 22 77 63 20 2d 6d 22 20 70 61 64 73 20 69 74 73  "wc -m" pads its
e830: 20 6f 75 74 70 75 74 0a 20 20 20 20 23 20 77 69   output.    # wi
e840: 74 68 20 73 70 61 63 65 73 20 6f 6e 20 42 53 44  th spaces on BSD
e850: 2e 0a 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60  ..    S_TMP_0="`
e860: 72 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28  ruby -e \"print(
e870: 41 52 47 56 5b 30 5d 2e 74 6f 5f 73 2e 6c 65 6e  ARGV[0].to_s.len
e880: 67 74 68 2e 74 6f 5f 73 29 3b 5c 22 20 24 53 5f  gth.to_s);\" $S_
e890: 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52 48  FUNC_MMMV_TIGERH
e8a0: 41 53 48 5f 54 31 5f 52 45 53 55 4c 54 20 60 22  ASH_T1_RESULT `"
e8b0: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  .    #--------. 
e8c0: 20 20 20 53 5f 54 4d 50 5f 31 3d 22 34 38 22 0a     S_TMP_1="48".
e8d0: 20 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50      if [ "$S_TMP
e8e0: 5f 30 22 20 21 3d 20 22 24 53 5f 54 4d 50 5f 31  _0" != "$S_TMP_1
e8f0: 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
e900: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
e910: 20 20 65 63 68 6f 20 22 41 63 63 6f 72 64 69 6e    echo "Accordin
e920: 67 20 74 6f 20 74 68 65 20 73 70 65 63 69 66 69  g to the specifi
e930: 63 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 54 69  cation of the Ti
e940: 67 65 72 20 68 61 73 68 20 61 6c 67 6f 72 69 74  ger hash algorit
e950: 68 6d 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  hm".        echo
e960: 20 22 74 68 65 20 6c 65 6e 67 74 68 20 6f 66 20   "the length of 
e970: 74 68 65 20 54 69 67 65 72 20 68 61 73 68 20 69  the Tiger hash i
e980: 73 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  s ".        echo
e990: 20 22 24 53 5f 54 4d 50 5f 31 20 68 65 78 61 64   "$S_TMP_1 hexad
e9a0: 65 63 69 6d 61 6c 20 63 68 61 72 61 63 74 65 72  ecimal character
e9b0: 73 2c 20 62 75 74 20 74 68 65 20 72 65 73 75 6c  s, but the resul
e9c0: 74 20 6f 66 20 74 68 65 20 22 0a 20 20 20 20 20  t of the ".     
e9d0: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
e9e0: 20 20 20 65 63 68 6f 20 22 20 20 20 20 66 75 6e     echo "    fun
e9f0: 63 5f 6d 6d 6d 76 5f 74 69 67 65 72 68 61 73 68  c_mmmv_tigerhash
ea00: 5f 74 31 22 0a 20 20 20 20 20 20 20 20 65 63 68  _t1".        ech
ea10: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
ea20: 6f 20 22 69 73 20 73 6f 6d 65 74 68 69 6e 67 20  o "is something 
ea30: 65 6c 73 65 2e 20 54 68 65 20 66 6c 61 77 65 64  else. The flawed
ea40: 20 68 61 73 68 20 63 61 6e 64 69 64 61 74 65 20   hash candidate 
ea50: 69 6e 20 70 61 72 65 6e 74 68 65 73 69 73 3a 22  in parenthesis:"
ea60: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 28  .        echo "(
ea70: 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47  $S_FUNC_MMMV_TIG
ea80: 45 52 48 41 53 48 5f 54 31 5f 52 45 53 55 4c 54  ERHASH_T1_RESULT
ea90: 29 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  )".        echo 
eaa0: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
eab0: 22 54 68 65 20 6c 65 6e 67 74 68 20 63 61 6e 64  "The length cand
eac0: 69 64 61 74 65 20 6f 66 20 74 68 65 20 66 6c 61  idate of the fla
ead0: 77 65 64 20 68 61 73 68 20 63 61 6e 64 69 64 61  wed hash candida
eae0: 74 65 20 69 6e 20 70 61 72 65 6e 74 68 65 73 69  te in parenthesi
eaf0: 73 3a 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  s:".        echo
eb00: 20 22 28 24 53 5f 54 4d 50 5f 30 29 2e 22 0a 20   "($S_TMP_0).". 
eb10: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
eb20: 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
eb30: 44 3d 3d 27 62 34 31 33 62 62 33 63 2d 38 39 31  D=='b413bb3c-891
eb40: 31 2d 34 37 65 37 2d 62 31 61 30 2d 32 31 62 31  1-47e7-b1a0-21b1
eb50: 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
eb60: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
eb70: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
eb80: 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
eb90: 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
eba0: 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
ebb0: 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
ebc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ebd0: 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 74  .} # func_mmmv_t
ebe0: 69 67 65 72 68 61 73 68 5f 74 31 0a 0a 0a 23 2d  igerhash_t1...#-
ebf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ec00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ec10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ec20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ec30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55 4e  ---------..S_FUN
ec40: 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c  C_MMMV_WHIRLPOOL
ec50: 48 41 53 48 5f 54 31 5f 52 45 53 55 4c 54 3d 22  HASH_T1_RESULT="
ec60: 6e 6f 74 5f 79 65 74 5f 73 65 74 22 0a 53 5f 46  not_yet_set".S_F
ec70: 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f  UNC_MMMV_WHIRLPO
ec80: 4f 4c 48 41 53 48 5f 54 31 5f 4d 4f 44 45 3d 22  OLHASH_T1_MODE="
ec90: 22 20 23 20 6f 70 74 69 6d 2e 20 74 6f 20 73 6b  " # optim. to sk
eca0: 69 70 20 72 65 70 65 61 74 69 6e 67 20 63 6f 6e  ip repeating con
ecb0: 73 6f 6c 65 20 74 6f 6f 6c 20 73 65 6c 65 63 74  sole tool select
ecc0: 69 6f 6e 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 77 68  ion.func_mmmv_wh
ecd0: 69 72 6c 70 6f 6f 6c 68 61 73 68 5f 74 31 28 29  irlpoolhash_t1()
ece0: 20 7b 20 23 20 72 65 71 75 69 72 65 73 20 61 6c   { # requires al
ecf0: 73 6f 20 72 75 62 79 20 61 6e 64 20 67 61 77 6b  so ruby and gawk
ed00: 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50   .    local S_FP
ed10: 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46  _2_AN_EXISTING_F
ed20: 49 4c 45 3d 22 24 31 22 20 23 20 66 69 72 73 74  ILE="$1" # first
ed30: 20 66 75 6e 63 74 69 6f 6e 20 61 72 67 75 6d 65   function argume
ed40: 6e 74 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  nt.    #--------
ed50: 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 65  .    func_mmmv_e
ed60: 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69 6f 6e  xc_hash_function
ed70: 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63 61 74  _input_verificat
ed80: 69 6f 6e 5f 74 31 20 22 66 75 6e 63 5f 6d 6d 6d  ion_t1 "func_mmm
ed90: 76 5f 77 68 69 72 6c 70 6f 6f 6c 68 61 73 68 5f  v_whirlpoolhash_
eda0: 74 31 22 20 22 24 31 22 0a 20 20 20 20 23 2d 2d  t1" "$1".    #--
edb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
edc0: 2d 2d 0a 20 20 20 20 23 20 4d 6f 64 65 20 73 65  --.    # Mode se
edd0: 6c 65 63 74 69 6f 6e 3a 0a 20 20 20 20 69 66 20  lection:.    if 
ede0: 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  [ "$S_FUNC_MMMV_
edf0: 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54 31  WHIRLPOOLHASH_T1
ee00: 5f 4d 4f 44 45 22 20 3d 3d 20 22 22 20 5d 20 3b  _MODE" == "" ] ;
ee10: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42   then.        SB
ee20: 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f  _EXISTS_ON_PATH_
ee30: 54 31 5f 52 45 53 55 4c 54 3d 22 66 22 20 20 23  T1_RESULT="f"  #
ee40: 20 69 66 2d 62 6c 6f 63 6b 20 69 6e 69 74 0a 20   if-block init. 
ee50: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
ee60: 20 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45       if [ "$SB_E
ee70: 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31  XISTS_ON_PATH_T1
ee80: 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22 66 22 20  _RESULT" == "f" 
ee90: 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  ] ; then.       
eea0: 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 77 68       S_TMP_0="wh
eeb0: 69 72 6c 70 6f 6f 6c 64 65 65 70 22 20 23 20 75  irlpooldeep" # u
eec0: 73 75 61 6c 6c 79 20 61 76 61 69 6c 61 62 6c 65  sually available
eed0: 20 6f 6e 20 4c 69 6e 75 78 0a 20 20 20 20 20 20   on Linux.      
eee0: 20 20 20 20 20 20 66 75 6e 63 5f 73 62 5f 65 78        func_sb_ex
eef0: 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31 20  ists_on_path_t1 
ef00: 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20 20 20 20  "$S_TMP_0" .    
ef10: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
ef20: 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48  B_EXISTS_ON_PATH
ef30: 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22  _T1_RESULT" == "
ef40: 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  t" ] ; then.    
ef50: 20 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 46               S_F
ef60: 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f  UNC_MMMV_WHIRLPO
ef70: 4f 4c 48 41 53 48 5f 54 31 5f 4d 4f 44 45 3d 22  OLHASH_T1_MODE="
ef80: 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20  $S_TMP_0".      
ef90: 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20        fi.       
efa0: 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   fi.        #---
efb0: 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22  -.        if [ "
efc0: 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41  $SB_EXISTS_ON_PA
efd0: 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d  TH_T1_RESULT" ==
efe0: 20 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20   "f" ] ; then.  
eff0: 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f            S_TMP_
f000: 30 3d 22 72 68 61 73 68 22 20 20 20 20 23 20 70  0="rhash"    # p
f010: 61 72 74 20 6f 66 20 74 68 65 20 42 53 44 20 70  art of the BSD p
f020: 61 63 6b 61 67 65 20 63 6f 6c 6c 65 63 74 69 6f  ackage collectio
f030: 6e 20 69 6e 20 32 30 31 36 0a 20 20 20 20 20 20  n in 2016.      
f040: 20 20 20 20 20 20 66 75 6e 63 5f 73 62 5f 65 78        func_sb_ex
f050: 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31 20  ists_on_path_t1 
f060: 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20 20 20 20  "$S_TMP_0" .    
f070: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
f080: 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48  B_EXISTS_ON_PATH
f090: 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22  _T1_RESULT" == "
f0a0: 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  t" ] ; then.    
f0b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 46               S_F
f0c0: 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f  UNC_MMMV_WHIRLPO
f0d0: 4f 4c 48 41 53 48 5f 54 31 5f 4d 4f 44 45 3d 22  OLHASH_T1_MODE="
f0e0: 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20  $S_TMP_0".      
f0f0: 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20        fi.       
f100: 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   fi.        #---
f110: 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66  -----.        if
f120: 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56   [ "$S_FUNC_MMMV
f130: 5f 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54  _WHIRLPOOLHASH_T
f140: 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 22 20 5d 20  1_MODE" == "" ] 
f150: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20  ; then.         
f160: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
f170: 20 20 20 20 20 20 20 65 63 68 6f 20 22 41 6c 6c         echo "All
f180: 20 6f 66 20 74 68 65 20 57 68 69 72 6c 70 6f 6f   of the Whirlpoo
f190: 6c 20 68 61 73 68 20 69 6d 70 6c 65 6d 65 6e 74  l hash implement
f1a0: 61 74 69 6f 6e 73 20 74 68 61 74 20 74 68 69 73  ations that this
f1b0: 20 73 63 72 69 70 74 20 22 20 0a 20 20 20 20 20   script " .     
f1c0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 69 73 20         echo "is 
f1d0: 63 61 70 61 62 6c 65 20 6f 66 20 75 73 69 6e 67  capable of using
f1e0: 20 28 77 68 69 72 6c 70 6f 6f 6c 64 65 65 70 2c   (whirlpooldeep,
f1f0: 20 72 68 61 73 68 29 20 22 0a 20 20 20 20 20 20   rhash) ".      
f200: 20 20 20 20 20 20 65 63 68 6f 20 22 61 72 65 20        echo "are 
f210: 6d 69 73 73 69 6e 67 20 66 72 6f 6d 20 74 68 65  missing from the
f220: 20 50 41 54 48 2e 22 0a 20 20 20 20 20 20 20 20   PATH.".        
f230: 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
f240: 27 33 66 37 34 30 32 32 36 2d 31 65 37 65 2d 34  '3f740226-1e7e-4
f250: 63 66 33 2d 38 31 61 30 2d 32 31 62 31 37 30 65  cf3-81a0-21b170e
f260: 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
f270: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
f280: 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
f290: 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f            cd $S_
f2a0: 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
f2b0: 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
f2c0: 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
f2d0: 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20       fi.        
f2e0: 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20  #--------.      
f2f0: 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22    if [ "$?" != "
f300: 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
f310: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
f320: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
f330: 22 54 68 69 73 20 73 63 72 69 70 74 20 69 73 20  "This script is 
f340: 66 6c 61 77 65 64 2e 22 0a 20 20 20 20 20 20 20  flawed.".       
f350: 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
f360: 3d 27 64 66 33 39 32 35 31 34 2d 33 31 36 65 2d  ='df392514-316e-
f370: 34 66 66 36 2d 39 34 61 30 2d 32 31 62 31 37 30  4ff6-94a0-21b170
f380: 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
f390: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
f3a0: 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20           #----. 
f3b0: 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53             cd $S
f3c0: 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
f3d0: 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
f3e0: 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
f3f0: 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20        fi.       
f400: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66   #--------.    f
f410: 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  i.    #---------
f420: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20  -----------.    
f430: 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52  S_FUNC_MMMV_WHIR
f440: 4c 50 4f 4f 4c 48 41 53 48 5f 54 31 5f 52 45 53  LPOOLHASH_T1_RES
f450: 55 4c 54 3d 22 22 0a 20 20 20 20 23 2d 2d 2d 2d  ULT="".    #----
f460: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f470: 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55  .    if [ "$S_FU
f480: 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f 4f  NC_MMMV_WHIRLPOO
f490: 4c 48 41 53 48 5f 54 31 5f 4d 4f 44 45 22 20 3d  LHASH_T1_MODE" =
f4a0: 3d 20 22 77 68 69 72 6c 70 6f 6f 6c 64 65 65 70  = "whirlpooldeep
f4b0: 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
f4c0: 20 20 53 5f 54 4d 50 5f 30 3d 22 60 77 68 69 72    S_TMP_0="`whir
f4d0: 6c 70 6f 6f 6c 64 65 65 70 20 24 53 5f 46 50 5f  lpooldeep $S_FP_
f4e0: 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49  2_AN_EXISTING_FI
f4f0: 4c 45 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22  LE 2>/dev/null`"
f500: 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
f510: 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65  ?" != "0" ]; the
f520: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  n.            ec
f530: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
f540: 20 20 65 63 68 6f 20 22 54 68 65 20 63 6f 6e 73    echo "The cons
f550: 6f 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20  ole application 
f560: 5c 22 77 68 69 72 6c 70 6f 6f 6c 64 65 65 70 5c  \"whirlpooldeep\
f570: 22 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  " ".            
f580: 65 63 68 6f 20 22 65 78 69 74 65 64 20 77 69 74  echo "exited wit
f590: 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20 20  h an error.".   
f5a0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
f5b0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
f5c0: 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d  o "----console--
f5d0: 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e  output--citation
f5e0: 2d 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20 20  --start-----".  
f5f0: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
f600: 60 77 68 69 72 6c 70 6f 6f 6c 64 65 65 70 20 24  `whirlpooldeep $
f610: 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49  S_FP_2_AN_EXISTI
f620: 4e 47 5f 46 49 4c 45 60 22 20 23 20 73 74 64 6f  NG_FILE`" # stdo
f630: 75 74 20 61 6e 64 20 73 74 64 65 72 72 0a 20 20  ut and stderr.  
f640: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
f650: 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74  ----console--out
f660: 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d 65  put--citation--e
f670: 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20  nd-------".     
f680: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
f690: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
f6a0: 22 47 55 49 44 3d 3d 27 36 33 66 63 30 36 34 32  "GUID=='63fc0642
f6b0: 2d 39 37 35 37 2d 34 37 38 31 2d 38 35 61 30 2d  -9757-4781-85a0-
f6c0: 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20  21b170e031e7'". 
f6d0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
f6e0: 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 23  "".            #
f6f0: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20  ----.           
f700: 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
f710: 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74 20             exit 
f720: 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
f730: 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20  ror.        fi. 
f740: 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d         S_FUNC_MM
f750: 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48  MV_WHIRLPOOLHASH
f760: 5f 54 31 5f 52 45 53 55 4c 54 3d 22 60 72 75 62  _T1_RESULT="`rub
f770: 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 41 52 47  y -e \"print(ARG
f780: 56 5b 30 5d 29 3b 5c 22 20 24 53 5f 54 4d 50 5f  V[0]);\" $S_TMP_
f790: 30 20 60 22 0a 20 20 20 20 66 69 0a 20 20 20 20  0 `".    fi.    
f7a0: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
f7b0: 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22  -----.    if [ "
f7c0: 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49  $S_FUNC_MMMV_WHI
f7d0: 52 4c 50 4f 4f 4c 48 41 53 48 5f 54 31 5f 4d 4f  RLPOOLHASH_T1_MO
f7e0: 44 45 22 20 3d 3d 20 22 72 68 61 73 68 22 20 5d  DE" == "rhash" ]
f7f0: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53  ; then.        S
f800: 5f 54 4d 50 5f 30 3d 22 60 72 68 61 73 68 20 2d  _TMP_0="`rhash -
f810: 2d 77 68 69 72 6c 70 6f 6f 6c 20 24 53 5f 46 50  -whirlpool $S_FP
f820: 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46  _2_AN_EXISTING_F
f830: 49 4c 45 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  ILE 2>/dev/null`
f840: 22 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22  ".        if [ "
f850: 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68  $?" != "0" ]; th
f860: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
f870: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
f880: 20 20 20 65 63 68 6f 20 22 54 68 65 20 63 6f 6e     echo "The con
f890: 73 6f 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e  sole application
f8a0: 20 5c 22 72 68 61 73 68 5c 22 20 22 0a 20 20 20   \"rhash\" ".   
f8b0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 65           echo "e
f8c0: 78 69 74 65 64 20 77 69 74 68 20 61 6e 20 65 72  xited with an er
f8d0: 72 6f 72 2e 22 0a 20 20 20 20 20 20 20 20 20 20  ror.".          
f8e0: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
f8f0: 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d        echo "----
f900: 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d  console--output-
f910: 2d 63 69 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74  -citation--start
f920: 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20  -----".         
f930: 20 20 20 65 63 68 6f 20 22 60 72 68 61 73 68 20     echo "`rhash 
f940: 2d 2d 77 68 69 72 6c 70 6f 6f 6c 20 24 53 5f 46  --whirlpool $S_F
f950: 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f  P_2_AN_EXISTING_
f960: 46 49 4c 45 20 60 22 0a 20 20 20 20 20 20 20 20  FILE `".        
f970: 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f      echo "----co
f980: 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63  nsole--output--c
f990: 69 74 61 74 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d 2d  itation--end----
f9a0: 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20 20  ---".           
f9b0: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
f9c0: 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
f9d0: 3d 27 65 38 66 34 62 63 63 39 2d 62 33 30 64 2d  ='e8f4bcc9-b30d-
f9e0: 34 62 38 62 2d 61 35 61 30 2d 32 31 62 31 37 30  4b8b-a5a0-21b170
f9f0: 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
fa00: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
fa10: 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20           #----. 
fa20: 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53             cd $S
fa30: 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
fa40: 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
fa50: 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
fa60: 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20        fi.       
fa70: 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49   S_FUNC_MMMV_WHI
fa80: 52 4c 50 4f 4f 4c 48 41 53 48 5f 54 31 5f 52 45  RLPOOLHASH_T1_RE
fa90: 53 55 4c 54 3d 22 60 72 75 62 79 20 2d 65 20 5c  SULT="`ruby -e \
faa0: 22 70 72 69 6e 74 28 41 52 47 56 5b 30 5d 29 3b  "print(ARGV[0]);
fab0: 5c 22 20 24 53 5f 54 4d 50 5f 30 20 60 22 0a 20  \" $S_TMP_0 `". 
fac0: 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
fad0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
fae0: 20 20 20 20 23 20 54 68 65 20 72 65 61 73 6f 6e      # The reason
faf0: 2c 20 77 68 79 20 65 76 65 72 79 74 68 69 6e 67  , why everything
fb00: 20 69 73 20 64 6f 6e 65 20 77 69 74 68 20 72 75   is done with ru
fb10: 62 79 20 61 74 20 74 68 65 20 6e 65 78 74 20 0a  by at the next .
fb20: 20 20 20 20 23 20 42 61 73 68 20 61 73 73 69 67      # Bash assig
fb30: 6e 6d 65 6e 74 20 63 6c 61 75 73 65 20 69 73 20  nment clause is 
fb40: 74 68 61 74 20 74 68 65 20 22 77 63 20 2d 6d 22  that the "wc -m"
fb50: 20 70 61 64 73 20 69 74 73 20 6f 75 74 70 75 74   pads its output
fb60: 0a 20 20 20 20 23 20 77 69 74 68 20 73 70 61 63  .    # with spac
fb70: 65 73 20 6f 6e 20 42 53 44 2e 0a 20 20 20 20 53  es on BSD..    S
fb80: 5f 54 4d 50 5f 30 3d 22 60 72 75 62 79 20 2d 65  _TMP_0="`ruby -e
fb90: 20 5c 22 70 72 69 6e 74 28 41 52 47 56 5b 30 5d   \"print(ARGV[0]
fba0: 2e 74 6f 5f 73 2e 6c 65 6e 67 74 68 2e 74 6f 5f  .to_s.length.to_
fbb0: 73 29 3b 5c 22 20 24 53 5f 46 55 4e 43 5f 4d 4d  s);\" $S_FUNC_MM
fbc0: 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48  MV_WHIRLPOOLHASH
fbd0: 5f 54 31 5f 52 45 53 55 4c 54 20 60 22 0a 20 20  _T1_RESULT `".  
fbe0: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
fbf0: 53 5f 54 4d 50 5f 31 3d 22 31 32 38 22 0a 20 20  S_TMP_1="128".  
fc00: 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30    if [ "$S_TMP_0
fc10: 22 20 21 3d 20 22 24 53 5f 54 4d 50 5f 31 22 20  " != "$S_TMP_1" 
fc20: 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
fc30: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
fc40: 65 63 68 6f 20 22 41 63 63 6f 72 64 69 6e 67 20  echo "According 
fc50: 74 6f 20 74 68 65 20 73 70 65 63 69 66 69 63 61  to the specifica
fc60: 74 69 6f 6e 20 6f 66 20 74 68 65 20 57 68 69 72  tion of the Whir
fc70: 6c 70 6f 6f 6c 20 68 61 73 68 20 61 6c 67 6f 72  lpool hash algor
fc80: 69 74 68 6d 22 0a 20 20 20 20 20 20 20 20 65 63  ithm".        ec
fc90: 68 6f 20 22 74 68 65 20 6c 65 6e 67 74 68 20 6f  ho "the length o
fca0: 66 20 74 68 65 20 54 69 67 65 72 20 68 61 73 68  f the Tiger hash
fcb0: 20 69 73 20 22 0a 20 20 20 20 20 20 20 20 65 63   is ".        ec
fcc0: 68 6f 20 22 24 53 5f 54 4d 50 5f 31 20 68 65 78  ho "$S_TMP_1 hex
fcd0: 61 64 65 63 69 6d 61 6c 20 63 68 61 72 61 63 74  adecimal charact
fce0: 65 72 73 2c 20 62 75 74 20 74 68 65 20 72 65 73  ers, but the res
fcf0: 75 6c 74 20 6f 66 20 74 68 65 20 22 0a 20 20 20  ult of the ".   
fd00: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
fd10: 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 66       echo "    f
fd20: 75 6e 63 5f 6d 6d 6d 76 5f 77 68 69 72 6c 70 6f  unc_mmmv_whirlpo
fd30: 6f 6c 68 61 73 68 5f 74 31 22 0a 20 20 20 20 20  olhash_t1".     
fd40: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
fd50: 20 20 20 65 63 68 6f 20 22 69 73 20 73 6f 6d 65     echo "is some
fd60: 74 68 69 6e 67 20 65 6c 73 65 2e 20 54 68 65 20  thing else. The 
fd70: 66 6c 61 77 65 64 20 68 61 73 68 20 63 61 6e 64  flawed hash cand
fd80: 69 64 61 74 65 20 69 6e 20 70 61 72 65 6e 74 68  idate in parenth
fd90: 65 73 69 73 3a 22 0a 20 20 20 20 20 20 20 20 65  esis:".        e
fda0: 63 68 6f 20 22 28 24 53 5f 46 55 4e 43 5f 4d 4d  cho "($S_FUNC_MM
fdb0: 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48  MV_WHIRLPOOLHASH
fdc0: 5f 54 31 5f 52 45 53 55 4c 54 29 22 0a 20 20 20  _T1_RESULT)".   
fdd0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
fde0: 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 6c       echo "The l
fdf0: 65 6e 67 74 68 20 63 61 6e 64 69 64 61 74 65 20  ength candidate 
fe00: 6f 66 20 74 68 65 20 66 6c 61 77 65 64 20 68 61  of the flawed ha
fe10: 73 68 20 63 61 6e 64 69 64 61 74 65 20 69 6e 20  sh candidate in 
fe20: 70 61 72 65 6e 74 68 65 73 69 73 3a 22 0a 20 20  parenthesis:".  
fe30: 20 20 20 20 20 20 65 63 68 6f 20 22 28 24 53 5f        echo "($S_
fe40: 54 4d 50 5f 30 29 2e 22 0a 20 20 20 20 20 20 20  TMP_0).".       
fe50: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
fe60: 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 34 36   echo "GUID=='46
fe70: 31 35 63 38 31 36 2d 66 62 35 33 2d 34 61 32 66  15c816-fb53-4a2f
fe80: 2d 62 35 61 30 2d 32 31 62 31 37 30 65 30 33 31  -b5a0-21b170e031
fe90: 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68  e7'".        ech
fea0: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d  o "".        #--
feb0: 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53  --.        cd $S
fec0: 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
fed0: 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
fee0: 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69  ith error.    fi
fef0: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
ff00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23 20 66  ----------.} # f
ff10: 75 6e 63 5f 6d 6d 6d 76 5f 77 68 69 72 6c 70 6f  unc_mmmv_whirlpo
ff20: 6f 6c 68 61 73 68 5f 74 31 0a 0a 0a 23 2d 2d 2d  olhash_t1...#---
ff30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ff40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ff50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ff60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ff70: 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55 4e 43 5f  -------..S_FUNC_
ff80: 4d 4d 4d 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31  MMMV_FILESIZE_T1
ff90: 5f 52 45 53 55 4c 54 3d 22 6e 6f 74 5f 79 65 74  _RESULT="not_yet
ffa0: 5f 73 65 74 22 0a 53 5f 46 55 4e 43 5f 4d 4d 4d  _set".S_FUNC_MMM
ffb0: 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 4d 4f  V_FILESIZE_T1_MO
ffc0: 44 45 3d 22 22 20 23 20 6f 70 74 69 6d 2e 20 74  DE="" # optim. t
ffd0: 6f 20 73 6b 69 70 20 72 65 70 65 61 74 69 6e 67  o skip repeating
ffe0: 20 63 6f 6e 73 6f 6c 65 20 74 6f 6f 6c 20 73 65   console tool se
fff0: 6c 65 63 74 69 6f 6e 0a 66 75 6e 63 5f 6d 6d 6d  lection.func_mmm
10000 76 5f 66 69 6c 65 73 69 7a 65 5f 74 31 28 29 20  v_filesize_t1() 
10010 7b 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46  { .    local S_F
10020 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f  P_2_AN_EXISTING_
10030 46 49 4c 45 3d 22 24 31 22 20 23 20 66 69 72 73  FILE="$1" # firs
10040 74 20 66 75 6e 63 74 69 6f 6e 20 61 72 67 75 6d  t function argum
10050 65 6e 74 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  ent.    #-------
10060 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f  -.    func_mmmv_
10070 65 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69 6f  exc_hash_functio
10080 6e 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63 61  n_input_verifica
10090 74 69 6f 6e 5f 74 31 20 22 66 75 6e 63 5f 6d 6d  tion_t1 "func_mm
100a0 6d 76 5f 66 69 6c 65 73 69 7a 65 5f 74 31 22 20  mv_filesize_t1" 
100b0 22 24 31 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  "$1".    #------
100c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  --------------. 
100d0 20 20 20 23 20 4d 6f 64 65 20 73 65 6c 65 63 74     # Mode select
100e0 69 6f 6e 3a 0a 20 20 20 20 69 66 20 5b 20 22 24  ion:.    if [ "$
100f0 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45  S_FUNC_MMMV_FILE
10100 53 49 5a 45 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d  SIZE_T1_MODE" ==
10110 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20   "" ] ; then.   
10120 20 20 20 20 20 53 42 5f 45 58 49 53 54 53 5f 4f       SB_EXISTS_O
10130 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54  N_PATH_T1_RESULT
10140 3d 22 66 22 20 20 23 20 69 66 2d 62 6c 6f 63 6b  ="f"  # if-block
10150 20 69 6e 69 74 0a 20 20 20 20 20 20 20 20 23 2d   init.        #-
10160 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b  ---.        if [
10170 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f   "$SB_EXISTS_ON_
10180 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20  PATH_T1_RESULT" 
10190 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a  == "f" ] ; then.
101a0 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d              S_TM
101b0 50 5f 30 3d 22 66 69 6c 65 73 69 7a 65 22 20 23  P_0="filesize" #
101c0 20 75 73 75 61 6c 6c 79 20 61 76 61 69 6c 61 62   usually availab
101d0 6c 65 20 6f 6e 20 4c 69 6e 75 78 0a 20 20 20 20  le on Linux.    
101e0 20 20 20 20 20 20 20 20 66 75 6e 63 5f 73 62 5f          func_sb_
101f0 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
10200 31 20 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20 20  1 "$S_TMP_0" .  
10210 20 20 20 20 20 20 20 20 20 20 69 66 20 5b 20 22            if [ "
10220 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41  $SB_EXISTS_ON_PA
10230 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d  TH_T1_RESULT" ==
10240 20 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20   "t" ] ; then.  
10250 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53                 S
10260 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53  _FUNC_MMMV_FILES
10270 49 5a 45 5f 54 31 5f 4d 4f 44 45 3d 22 24 53 5f  IZE_T1_MODE="$S_
10280 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20 20  TMP_0".         
10290 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 66 69     fi.        fi
102a0 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
102b0 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 42         if [ "$SB
102c0 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f  _EXISTS_ON_PATH_
102d0 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22 66  T1_RESULT" == "f
102e0 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
102f0 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22         S_TMP_0="
10300 72 75 62 79 22 20 20 20 20 23 20 68 65 6c 70 73  ruby"    # helps
10310 20 6f 6e 20 42 53 44 0a 20 20 20 20 20 20 20 20   on BSD.        
10320 20 20 20 20 66 75 6e 63 5f 73 62 5f 65 78 69 73      func_sb_exis
10330 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31 20 22 24  ts_on_path_t1 "$
10340 53 5f 54 4d 50 5f 30 22 20 0a 20 20 20 20 20 20  S_TMP_0" .      
10350 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f        if [ "$SB_
10360 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54  EXISTS_ON_PATH_T
10370 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22 74 22  1_RESULT" == "t"
10380 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20   ] ; then.      
10390 20 20 20 20 20 20 20 20 20 20 20 53 5f 46 55 4e             S_FUN
103a0 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49 5a 45 5f  C_MMMV_FILESIZE_
103b0 54 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d 50 5f  T1_MODE="$S_TMP_
103c0 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 66  0".            f
103d0 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20  i.        fi.   
103e0 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20       #--------. 
103f0 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f         if [ "$S_
10400 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49  FUNC_MMMV_FILESI
10410 5a 45 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22  ZE_T1_MODE" == "
10420 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
10430 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
10440 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
10450 22 41 6c 6c 20 6f 66 20 74 68 65 20 61 70 70 6c  "All of the appl
10460 69 63 61 74 69 6f 6e 73 20 74 68 61 74 20 74 68  ications that th
10470 69 73 20 66 75 6e 63 74 69 6f 6e 20 69 73 20 22  is function is "
10480 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63   .            ec
10490 68 6f 20 22 63 61 70 61 62 6c 65 20 6f 66 20 75  ho "capable of u
104a0 73 69 6e 67 20 66 6f 72 20 66 69 6e 64 69 6e 67  sing for finding
104b0 20 6f 75 74 20 66 69 6c 65 20 73 69 7a 65 20 28   out file size (
104c0 66 69 6c 65 73 69 7a 65 2c 20 72 75 62 79 29 22  filesize, ruby)"
104d0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
104e0 6f 20 22 61 72 65 20 6d 69 73 73 69 6e 67 20 66  o "are missing f
104f0 72 6f 6d 20 74 68 65 20 50 41 54 48 2e 22 0a 20  rom the PATH.". 
10500 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
10510 22 47 55 49 44 3d 3d 27 63 32 30 38 36 37 35 37  "GUID=='c2086757
10520 2d 33 33 32 61 2d 34 39 36 35 2d 62 32 61 30 2d  -332a-4965-b2a0-
10530 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20  21b170e031e7'". 
10540 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
10550 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 23  "".            #
10560 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20  ----.           
10570 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
10580 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74 20             exit 
10590 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
105a0 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20  ror.        fi. 
105b0 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d         #--------
105c0 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
105d0 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65  ?" != "0" ]; the
105e0 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  n.            ec
105f0 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
10600 20 20 65 63 68 6f 20 22 54 68 69 73 20 73 63 72    echo "This scr
10610 69 70 74 20 69 73 20 66 6c 61 77 65 64 2e 22 0a  ipt is flawed.".
10620 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
10630 20 22 47 55 49 44 3d 3d 27 33 65 33 64 33 65 32   "GUID=='3e3d3e2
10640 31 2d 33 61 65 65 2d 34 61 61 34 2d 39 31 61 30  1-3aee-4aa4-91a0
10650 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a  -21b170e031e7'".
10660 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
10670 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
10680 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20  #----.          
10690 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
106a0 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74              exit
106b0 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
106c0 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a  rror.        fi.
106d0 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d          #-------
106e0 2d 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d  -.    fi.    #--
106f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
10700 2d 2d 0a 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d  --.    S_FUNC_MM
10710 4d 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 52  MV_FILESIZE_T1_R
10720 45 53 55 4c 54 3d 22 22 0a 20 20 20 20 23 2d 2d  ESULT="".    #--
10730 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
10740 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  --.    if [ "$S_
10750 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49  FUNC_MMMV_FILESI
10760 5a 45 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22  ZE_T1_MODE" == "
10770 66 69 6c 65 73 69 7a 65 22 20 5d 3b 20 74 68 65  filesize" ]; the
10780 6e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f  n.        S_TMP_
10790 30 3d 22 60 66 69 6c 65 73 69 7a 65 20 24 53 5f  0="`filesize $S_
107a0 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47  FP_2_AN_EXISTING
107b0 5f 46 49 4c 45 20 32 3e 2f 64 65 76 2f 6e 75 6c  _FILE 2>/dev/nul
107c0 6c 60 22 0a 20 20 20 20 20 20 20 20 69 66 20 5b  l`".        if [
107d0 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20   "$?" != "0" ]; 
107e0 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
107f0 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
10800 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 63       echo "The c
10810 6f 6e 73 6f 6c 65 20 61 70 70 6c 69 63 61 74 69  onsole applicati
10820 6f 6e 20 5c 22 66 69 6c 65 73 69 7a 65 5c 22 20  on \"filesize\" 
10830 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
10840 68 6f 20 22 65 78 69 74 65 64 20 77 69 74 68 20  ho "exited with 
10850 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20 20 20 20  an error.".     
10860 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
10870 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
10880 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75  "----console--ou
10890 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d  tput--citation--
108a0 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20 20 20 20  start-----".    
108b0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 60 66          echo "`f
108c0 69 6c 65 73 69 7a 65 20 24 53 5f 46 50 5f 32 5f  ilesize $S_FP_2_
108d0 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c 45  AN_EXISTING_FILE
108e0 60 22 20 23 20 73 74 64 6f 75 74 20 61 6e 64 20  `" # stdout and 
108f0 73 74 64 65 72 72 0a 20 20 20 20 20 20 20 20 20  stderr.         
10900 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e     echo "----con
10910 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69  sole--output--ci
10920 74 61 74 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d  tation--end-----
10930 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  --".            
10940 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
10950 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
10960 27 66 37 32 62 30 30 31 64 2d 63 35 38 31 2d 34  'f72b001d-c581-4
10970 32 36 61 2d 39 35 39 30 2d 32 31 62 31 37 30 65  26a-9590-21b170e
10980 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
10990 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
109a0 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
109b0 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f            cd $S_
109c0 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
109d0 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
109e0 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
109f0 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20       fi.        
10a00 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45  S_FUNC_MMMV_FILE
10a10 53 49 5a 45 5f 54 31 5f 52 45 53 55 4c 54 3d 22  SIZE_T1_RESULT="
10a20 60 72 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74  `ruby -e \"print
10a30 28 41 52 47 56 5b 30 5d 29 3b 5c 22 20 24 53 5f  (ARGV[0]);\" $S_
10a40 54 4d 50 5f 30 20 60 22 0a 20 20 20 20 66 69 0a  TMP_0 `".    fi.
10a50 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
10a60 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66  ---------.    if
10a70 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56   [ "$S_FUNC_MMMV
10a80 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 4d 4f 44  _FILESIZE_T1_MOD
10a90 45 22 20 3d 3d 20 22 72 75 62 79 22 20 5d 3b 20  E" == "ruby" ]; 
10aa0 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 54  then.        S_T
10ab0 4d 50 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c  MP_0="`ruby -e \
10ac0 22 70 72 69 6e 74 66 28 46 69 6c 65 2e 73 69 7a  "printf(File.siz
10ad0 65 28 27 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58  e('$S_FP_2_AN_EX
10ae0 49 53 54 49 4e 47 5f 46 49 4c 45 27 29 2e 74 6f  ISTING_FILE').to
10af0 5f 73 29 5c 22 20 32 3e 2f 64 65 76 2f 6e 75 6c  _s)\" 2>/dev/nul
10b00 6c 60 22 0a 20 20 20 20 20 20 20 20 69 66 20 5b  l`".        if [
10b10 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20   "$?" != "0" ]; 
10b20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
10b30 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
10b40 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 63       echo "The c
10b50 6f 6e 73 6f 6c 65 20 61 70 70 6c 69 63 61 74 69  onsole applicati
10b60 6f 6e 20 5c 22 72 75 62 79 5c 22 20 22 0a 20 20  on \"ruby\" ".  
10b70 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
10b80 65 78 69 74 65 64 20 77 69 74 68 20 61 6e 20 65  exited with an e
10b90 72 72 6f 72 2e 22 0a 20 20 20 20 20 20 20 20 20  rror.".         
10ba0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
10bb0 20 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d         echo "---
10bc0 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74  -console--output
10bd0 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d 73 74 61 72  --citation--star
10be0 74 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20  t-----".        
10bf0 20 20 20 20 65 63 68 6f 20 22 60 72 75 62 79 20      echo "`ruby 
10c00 2d 65 20 5c 22 70 72 69 6e 74 66 28 46 69 6c 65  -e \"printf(File
10c10 2e 73 69 7a 65 28 27 24 53 5f 46 50 5f 32 5f 41  .size('$S_FP_2_A
10c20 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 27  N_EXISTING_FILE'
10c30 29 2e 74 6f 5f 73 29 5c 22 60 22 0a 20 20 20 20  ).to_s)\"`".    
10c40 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d          echo "--
10c50 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75  --console--outpu
10c60 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d 65 6e 64  t--citation--end
10c70 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20  -------".       
10c80 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
10c90 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47           echo "G
10ca0 55 49 44 3d 3d 27 33 33 38 34 38 36 33 65 2d 63  UID=='3384863e-c
10cb0 30 61 31 2d 34 39 32 37 2d 38 35 39 30 2d 32 31  0a1-4927-8590-21
10cc0 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  b170e031e7'".   
10cd0 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
10ce0 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d  .            #--
10cf0 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63  --.            c
10d00 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
10d10 20 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20           exit 1 
10d20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
10d30 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20  r.        fi.   
10d40 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56       S_FUNC_MMMV
10d50 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 52 45 53  _FILESIZE_T1_RES
10d60 55 4c 54 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20  ULT="$S_TMP_0". 
10d70 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
10d80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
10d90 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75      S_TMP_0="`ru
10da0 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 28 27  by -e \"print(('
10db0 27 2b 41 52 47 56 5b 30 5d 29 2e 67 73 75 62 28  '+ARGV[0]).gsub(
10dc0 2f 5b 5c 73 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20  /[\s]+/,''));\" 
10dd0 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c  $S_FUNC_MMMV_FIL
10de0 45 53 49 5a 45 5f 54 31 5f 52 45 53 55 4c 54 20  ESIZE_T1_RESULT 
10df0 60 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53 42 5f  `".    local SB_
10e00 54 48 52 4f 57 3d 22 66 22 0a 20 20 20 20 69 66  THROW="f".    if
10e10 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22 20 21 3d   [ "$S_TMP_0" !=
10e20 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46   "$S_FUNC_MMMV_F
10e30 49 4c 45 53 49 5a 45 5f 54 31 5f 52 45 53 55 4c  ILESIZE_T1_RESUL
10e40 54 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  T" ]; then.     
10e50 20 20 20 53 42 5f 54 48 52 4f 57 3d 22 74 22 0a     SB_THROW="t".
10e60 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20      else.       
10e70 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d   if [ "$S_FUNC_M
10e80 4d 4d 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f  MMV_FILESIZE_T1_
10e90 52 45 53 55 4c 54 22 20 3d 3d 20 22 22 20 5d 3b  RESULT" == "" ];
10ea0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20   then.          
10eb0 20 20 53 42 5f 54 48 52 4f 57 3d 22 74 22 0a 20    SB_THROW="t". 
10ec0 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 66 69         fi.    fi
10ed0 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69  .    #----.    i
10ee0 66 20 5b 20 22 24 53 42 5f 54 48 52 4f 57 22 20  f [ "$SB_THROW" 
10ef0 3d 3d 20 22 74 22 20 5d 3b 20 74 68 65 6e 0a 20  == "t" ]; then. 
10f00 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
10f10 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65         echo "The
10f20 20 72 65 73 75 6c 74 20 6f 66 20 74 68 65 20 22   result of the "
10f30 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
10f40 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
10f50 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 66 69 6c     func_mmmv_fil
10f60 65 73 69 7a 65 5f 74 31 22 0a 20 20 20 20 20 20  esize_t1".      
10f70 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
10f80 20 20 65 63 68 6f 20 22 66 6f 72 20 22 0a 20 20    echo "for ".  
10f90 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
10fa0 20 20 20 20 20 20 65 63 68 6f 20 22 28 24 53 5f        echo "($S_
10fb0 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49  FUNC_MMMV_FILESI
10fc0 5a 45 5f 54 31 5f 52 45 53 55 4c 54 29 22 0a 20  ZE_T1_RESULT)". 
10fd0 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
10fe0 20 20 20 20 20 20 20 65 63 68 6f 20 22 65 69 74         echo "eit
10ff0 68 65 72 20 63 6f 6e 74 61 69 6e 20 73 70 61 63  her contain spac
11000 65 73 2c 20 74 61 62 73 20 6f 72 20 69 73 20 61  es, tabs or is a
11010 6e 20 65 6d 70 74 79 20 73 74 72 69 6e 67 2c 22  n empty string,"
11020 20 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22   .        echo "
11030 77 68 69 63 68 20 69 73 20 77 72 6f 6e 67 2c 20  which is wrong, 
11040 62 65 63 61 75 73 65 20 65 76 65 6e 20 61 20 66  because even a f
11050 69 6c 65 20 77 69 74 68 20 74 68 65 20 73 69 7a  ile with the siz
11060 65 20 6f 66 20 30 20 22 0a 20 20 20 20 20 20 20  e of 0 ".       
11070 20 65 63 68 6f 20 22 73 68 6f 75 6c 64 20 68 61   echo "should ha
11080 76 65 20 61 20 66 69 6c 65 20 73 69 7a 65 20 6f  ve a file size o
11090 66 20 5c 22 30 5c 22 2c 20 77 68 69 63 68 20 69  f \"0\", which i
110a0 73 20 6e 6f 74 20 61 6e 20 65 6d 70 74 79 20 73  s not an empty s
110b0 74 72 69 6e 67 2e 22 0a 20 20 20 20 20 20 20 20  tring.".        
110c0 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 34 61 31  echo "GUID=='4a1
110d0 33 33 62 35 65 2d 63 37 62 64 2d 34 63 62 31 2d  33b5e-c7bd-4cb1-
110e0 61 35 39 30 2d 32 31 62 31 37 30 65 30 33 31 65  a590-21b170e031e
110f0 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
11100 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
11110 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
11120 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
11130 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
11140 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
11150 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
11160 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23 20 66 75  ---------.} # fu
11170 6e 63 5f 6d 6d 6d 76 5f 66 69 6c 65 73 69 7a 65  nc_mmmv_filesize
11180 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  _t1...#---------
11190 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
111a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
111b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
111c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
111d0 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c  -..func_mmmv_sil
111e0 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65  ktorrent_package
111f0 72 5f 74 31 5f 62 61 73 68 5f 70 72 69 6e 74 5f  r_t1_bash_print_
11200 68 65 6c 70 5f 6d 73 67 5f 74 31 28 29 20 7b 20  help_msg_t1() { 
11210 0a 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20  .    echo "".   
11220 20 65 63 68 6f 20 22 43 6f 6d 6d 61 6e 64 20 6c   echo "Command l
11230 69 6e 65 20 66 6f 72 6d 61 74 3a 20 22 0a 20 20  ine format: ".  
11240 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 65 63    echo "".    ec
11250 68 6f 20 22 3c 74 68 65 20 6e 61 6d 65 20 6f 66  ho "<the name of
11260 20 74 68 69 73 20 73 63 72 69 70 74 3e 20 20 41   this script>  A
11270 52 47 4c 49 53 54 20 22 0a 20 20 20 20 65 63 68  RGLIST ".    ech
11280 6f 20 22 22 0a 20 20 20 20 65 63 68 6f 20 22 20  o "".    echo " 
11290 20 41 52 47 4c 49 53 54 20 3a 3d 3d 20 68 65 6c   ARGLIST :== hel
112a0 70 20 7c 20 57 52 41 50 20 7c 20 55 4e 57 52 41  p | WRAP | UNWRA
112b0 50 20 7c 20 52 55 4e 5f 53 45 4c 46 54 45 53 54  P | RUN_SELFTEST
112c0 20 7c 20 56 45 52 49 46 59 20 7c 22 0a 20 20 20   | VERIFY |".   
112d0 20 65 63 68 6f 20 22 20 20 20 20 20 20 20 20 20   echo "         
112e0 20 20 20 20 20 56 45 52 49 46 59 5f 50 41 43 4b       VERIFY_PACK
112f0 45 54 5f 4e 41 4d 45 5f 46 4f 52 4d 41 54 5f 56  ET_NAME_FORMAT_V
11300 31 20 7c 20 76 65 72 73 69 6f 6e 20 7c 20 76 65  1 | version | ve
11310 72 73 69 6f 6e 5f 74 69 6d 65 73 74 61 6d 70 20  rsion_timestamp 
11320 22 0a 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20  ".    echo "".  
11330 20 20 65 63 68 6f 20 22 20 20 20 20 20 20 20 20    echo "        
11340 20 20 20 20 20 20 20 20 20 20 20 57 52 41 50 20             WRAP 
11350 3a 3d 3d 20 77 72 61 70 20 20 20 20 20 20 20 20  :== wrap        
11360 20 3c 66 69 6c 65 20 70 61 74 68 3e 20 28 4e 5f   <file path> (N_
11370 4f 46 5f 52 41 4e 44 4f 4d 5f 54 45 58 54 5f 42  OF_RANDOM_TEXT_B
11380 4c 4f 43 4b 53 29 3f 22 0a 20 20 20 20 65 63 68  LOCKS)?".    ech
11390 6f 20 22 4e 5f 4f 46 5f 52 41 4e 44 4f 4d 5f 54  o "N_OF_RANDOM_T
113a0 45 58 54 5f 42 4c 4f 43 4b 53 20 3a 3d 3d 20 20  EXT_BLOCKS :==  
113b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
113c0 20 20 20 20 20 20 20 20 20 3c 70 6f 73 69 74 69           <positi
113d0 76 65 20 77 68 6f 6c 65 20 6e 75 6d 62 65 72 3e  ve whole number>
113e0 20 22 0a 20 20 20 20 65 63 68 6f 20 22 22 0a 20   ".    echo "". 
113f0 20 20 20 65 63 68 6f 20 22 20 20 20 20 20 20 20     echo "       
11400 20 20 20 20 20 20 20 20 20 20 55 4e 57 52 41 50            UNWRAP
11410 20 3a 3d 3d 20 75 6e 77 72 61 70 20 20 20 20 20   :== unwrap     
11420 20 20 3c 66 69 6c 65 20 70 61 74 68 3e 20 22 0a    <file path> ".
11430 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 20 20      echo "      
11440 20 20 20 20 20 52 55 4e 5f 53 45 4c 46 54 45 53       RUN_SELFTES
11450 54 20 3a 3d 3d 20 74 65 73 74 5f 68 61 73 68 5f  T :== test_hash_
11460 74 31 20 3c 66 69 6c 65 20 70 61 74 68 3e 20 22  t1 <file path> "
11470 0a 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 20  .    echo "     
11480 20 20 20 20 20 20 20 20 20 20 20 20 56 45 52 49              VERI
11490 46 59 20 3a 3d 3d 20 76 65 72 69 66 79 20 20 20  FY :== verify   
114a0 20 20 20 20 3c 66 69 6c 65 20 70 61 74 68 3e 20      <file path> 
114b0 22 0a 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20  ".    echo "".  
114c0 20 20 65 63 68 6f 20 22 20 20 56 45 52 49 46 59    echo "  VERIFY
114d0 5f 50 41 43 4b 45 54 5f 4e 41 4d 45 5f 46 4f 52  _PACKET_NAME_FOR
114e0 4d 41 54 5f 56 31 20 3a 3d 3d 20 76 65 72 69 66  MAT_V1 :== verif
114f0 79 5f 70 61 63 6b 65 74 5f 6e 61 6d 65 5f 66 6f  y_packet_name_fo
11500 72 6d 61 74 5f 76 31 20 58 3c 70 61 63 6b 65 74  rmat_v1 X<packet
11510 20 6e 61 6d 65 20 22 0a 20 20 20 20 65 63 68 6f   name ".    echo
11520 20 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20   "              
11530 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
11540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
11550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
11560 20 20 20 63 61 6e 64 69 64 61 74 65 20 73 74 72     candidate str
11570 69 6e 67 3e 58 22 0a 20 20 20 20 65 63 68 6f 20  ing>X".    echo 
11580 22 22 0a 20 20 20 20 65 63 68 6f 20 22 22 0a 20  "".    echo "". 
11590 20 20 20 65 63 68 6f 20 22 49 66 20 74 68 69 73     echo "If this
115a0 20 41 50 49 20 69 73 20 75 73 65 64 20 63 6f 72   API is used cor
115b0 72 65 63 74 6c 79 20 61 6e 64 20 74 68 65 72 65  rectly and there
115c0 20 61 72 65 20 6e 6f 20 6f 74 68 65 72 20 22 0a   are no other ".
115d0 20 20 20 20 65 63 68 6f 20 22 72 65 61 73 6f 6e      echo "reason
115e0 73 20 66 6f 72 20 74 68 65 20 66 61 69 6c 75 72  s for the failur
115f0 65 20 6f 66 20 74 68 69 73 20 73 63 72 69 70 74  e of this script
11600 2c 20 74 68 65 6e 20 22 0a 20 20 20 20 65 63 68  , then ".    ech
11610 6f 20 22 61 6c 6c 20 6f 66 20 74 68 65 20 76 65  o "all of the ve
11620 72 69 66 69 63 61 74 69 6f 6e 20 63 6f 6d 6d 61  rification comma
11630 6e 64 73 20 65 78 69 74 20 77 69 74 68 20 65 72  nds exit with er
11640 72 6f 72 20 63 6f 64 65 20 30 20 22 0a 20 20 20  ror code 0 ".   
11650 20 65 63 68 6f 20 22 72 65 67 61 72 64 6c 65 73   echo "regardles
11660 73 20 6f 66 20 77 68 65 74 68 65 72 20 74 68 65  s of whether the
11670 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 66 61   verification fa
11680 69 6c 73 20 6f 72 20 70 61 73 73 65 73 2e 22 0a  ils or passes.".
11690 20 20 20 20 65 63 68 6f 20 22 41 6c 6c 20 76 65      echo "All ve
116a0 72 69 66 69 63 61 74 69 6f 6e 20 63 6f 6d 6d 61  rification comma
116b0 6e 64 73 20 72 65 74 75 72 6e 20 61 20 73 74 72  nds return a str
116c0 69 6e 67 20 74 68 61 74 20 22 0a 20 20 20 20 65  ing that ".    e
116d0 63 68 6f 20 22 62 65 6c 6f 6e 67 73 20 74 6f 20  cho "belongs to 
116e0 74 68 65 20 73 65 74 20 7b 5c 22 76 65 72 69 66  the set {\"verif
116f0 69 63 61 74 69 6f 6e 5f 70 61 73 73 65 64 5c 22  ication_passed\"
11700 2c 20 22 0a 20 20 20 20 65 63 68 6f 20 22 20 20  , ".    echo "  
11710 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
11720 20 20 5c 22 76 65 72 69 66 69 63 61 74 69 6f 6e    \"verification
11730 5f 66 61 69 6c 65 64 5c 22 7d 2e 22 0a 20 20 20  _failed\"}.".   
11740 20 65 63 68 6f 20 22 22 0a 20 20 20 20 65 63 68   echo "".    ech
11750 6f 20 22 49 66 20 74 68 65 20 77 6f 72 6b 69 6e  o "If the workin
11760 67 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74  g directory cont
11770 61 69 6e 73 20 61 20 66 6f 6c 64 65 72 20 6e 61  ains a folder na
11780 6d 65 64 20 5c 22 63 75 73 74 6f 6d 5f 68 65 61  med \"custom_hea
11790 64 65 72 73 5c 22 20 61 6e 64 20 22 0a 20 20 20  ders\" and ".   
117a0 20 65 63 68 6f 20 22 74 68 61 74 20 66 6f 6c 64   echo "that fold
117b0 65 72 20 69 73 20 72 65 63 75 72 73 69 76 65 6c  er is recursivel
117c0 79 20 72 65 61 64 61 62 6c 65 2f 63 6f 70 79 61  y readable/copya
117d0 62 6c 65 2c 20 74 68 65 6e 20 74 68 65 20 63 6f  ble, then the co
117e0 6d 6d 61 6e 64 20 5c 22 77 72 61 70 5c 22 20 22  mmand \"wrap\" "
117f0 0a 20 20 20 20 65 63 68 6f 20 22 61 64 64 73 20  .    echo "adds 
11800 74 68 61 74 20 66 6f 6c 64 65 72 20 74 6f 20 74  that folder to t
11810 68 65 20 68 65 61 64 65 72 20 66 6f 6c 64 65 72  he header folder
11820 20 6f 66 20 74 68 65 20 6e 65 77 6c 79 20 63 72   of the newly cr
11830 65 61 74 65 64 20 53 69 6c 6b 74 6f 72 72 65 6e  eated Silktorren
11840 74 20 70 61 63 6b 65 74 2e 22 0a 20 20 20 20 65  t packet.".    e
11850 63 68 6f 20 22 49 66 20 74 68 65 72 65 20 69 73  cho "If there is
11860 20 61 20 66 61 69 6c 75 72 65 20 61 74 20 74 68   a failure at th
11870 65 20 72 65 63 75 72 73 69 76 65 20 63 6f 70 79  e recursive copy
11880 69 6e 67 20 6f 66 20 74 68 65 20 5c 22 63 75 73  ing of the \"cus
11890 74 6f 6d 5f 68 65 61 64 65 72 73 5c 22 2c 20 22  tom_headers\", "
118a0 0a 20 20 20 20 65 63 68 6f 20 22 74 68 65 6e 20  .    echo "then 
118b0 74 68 69 73 20 73 63 72 69 70 74 20 65 78 69 74  this script exit
118c0 73 20 77 69 74 68 20 61 20 6e 6f 6e 2d 30 20 65  s with a non-0 e
118d0 72 72 6f 72 20 63 6f 64 65 20 22 0a 20 20 20 20  rror code ".    
118e0 65 63 68 6f 20 22 62 65 66 6f 72 65 20 74 68 65  echo "before the
118f0 20 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63   Silktorrent pac
11900 6b 65 74 20 69 73 20 63 72 65 61 74 65 64 2e 22  ket is created."
11910 0a 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20  .    echo "".   
11920 20 65 63 68 6f 20 22 22 0a 7d 20 23 20 66 75 6e   echo "".} # fun
11930 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65  c_mmmv_silktorre
11940 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62  nt_packager_t1_b
11950 61 73 68 5f 70 72 69 6e 74 5f 68 65 6c 70 5f 6d  ash_print_help_m
11960 73 67 5f 74 31 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  sg_t1..#--------
11970 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11980 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11990 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
119a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
119b0 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69  --..func_mmmv_si
119c0 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67  lktorrent_packag
119d0 65 72 5f 74 31 5f 62 61 73 68 5f 65 78 63 5f 61  er_t1_bash_exc_a
119e0 73 73 65 72 74 5f 77 72 61 70 70 61 62 6c 65 5f  ssert_wrappable_
119f0 66 69 6c 65 5f 65 78 69 73 74 73 5f 74 31 28 29  file_exists_t1()
11a00 20 7b 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f   { .    local S_
11a10 46 50 5f 30 3d 22 24 31 22 20 23 20 50 61 74 68  FP_0="$1" # Path
11a20 20 74 6f 20 74 68 65 20 66 69 6c 65 2e 20 0a 20   to the file. . 
11a30 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
11a40 20 69 66 20 5b 20 22 24 53 5f 46 50 5f 30 22 20   if [ "$S_FP_0" 
11a50 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20  == "" ]; then.  
11a60 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
11a70 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
11a80 32 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75 6d  2. console argum
11a90 65 6e 74 20 69 73 20 65 78 70 65 63 74 65 64 20  ent is expected 
11aa0 74 6f 20 62 65 20 22 0a 20 20 20 20 20 20 20 20  to be ".        
11ab0 65 63 68 6f 20 22 61 20 70 61 74 68 20 74 6f 20  echo "a path to 
11ac0 61 20 66 69 6c 65 2c 20 62 75 74 20 63 75 72 72  a file, but curr
11ad0 65 6e 74 6c 79 20 22 0a 20 20 20 20 20 20 20 20  ently ".        
11ae0 65 63 68 6f 20 22 74 68 65 20 32 2e 20 63 6f 6e  echo "the 2. con
11af0 73 6f 6c 65 20 61 72 67 75 6d 65 6e 74 20 69 73  sole argument is
11b00 20 6d 69 73 73 69 6e 67 2e 22 0a 20 20 20 20 20   missing.".     
11b10 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
11b20 37 61 36 66 35 66 33 66 2d 65 35 61 35 2d 34 34  7a6f5f3f-e5a5-44
11b30 31 33 2d 61 34 39 30 2d 32 31 62 31 37 30 65 30  13-a490-21b170e0
11b40 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
11b50 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
11b60 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
11b70 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
11b80 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
11b90 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
11ba0 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
11bb0 0a 20 20 20 20 69 66 20 5b 20 21 20 2d 65 20 22  .    if [ ! -e "
11bc0 24 53 5f 46 50 5f 30 22 20 5d 3b 20 74 68 65 6e  $S_FP_0" ]; then
11bd0 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 2d 68  .        if [ -h
11be0 20 22 24 53 5f 46 50 5f 30 22 20 5d 3b 20 74 68   "$S_FP_0" ]; th
11bf0 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
11c00 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
11c10 20 20 20 65 63 68 6f 20 22 54 68 65 20 66 69 6c     echo "The fil
11c20 65 20 70 61 74 68 20 22 0a 20 20 20 20 20 20 20  e path ".       
11c30 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
11c40 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20           echo " 
11c50 20 20 20 24 53 5f 46 50 5f 30 22 0a 20 20 20 20     $S_FP_0".    
11c60 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
11c70 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
11c80 20 22 69 73 20 61 20 70 61 74 68 20 6f 66 20 61   "is a path of a
11c90 20 62 72 6f 6b 65 6e 20 73 79 6d 6c 69 6e 6b 2c   broken symlink,
11ca0 20 62 75 74 20 73 79 6d 6c 69 6e 6b 73 20 22 0a   but symlinks ".
11cb0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
11cc0 20 22 61 72 65 20 6e 6f 74 20 73 75 70 70 6f 72   "are not suppor
11cd0 74 65 64 20 61 74 20 61 6c 6c 2e 22 0a 20 20 20  ted at all.".   
11ce0 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54           echo "T
11cf0 68 65 20 72 65 61 73 6f 6e 2c 20 77 68 79 20 73  he reason, why s
11d00 79 6d 6c 69 6e 6b 73 20 74 6f 20 66 69 6c 65 73  ymlinks to files
11d10 20 61 72 65 20 6e 6f 74 20 73 75 70 70 6f 72 74   are not support
11d20 65 64 20 69 73 20 74 68 61 74 20 22 0a 20 20 20  ed is that ".   
11d30 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 74           echo "t
11d40 68 65 20 66 69 6c 65 20 73 69 7a 65 20 6f 66 20  he file size of 
11d50 73 79 6d 6c 69 6e 6b 73 20 63 61 6e 20 64 69 66  symlinks can dif
11d60 66 65 72 20 66 72 6f 6d 20 22 0a 20 20 20 20 20  fer from ".     
11d70 20 20 20 20 20 20 20 65 63 68 6f 20 22 74 68 65         echo "the
11d80 20 66 69 6c 65 20 73 69 7a 65 20 6f 66 20 74 68   file size of th
11d90 65 20 74 61 72 67 65 74 20 6f 66 20 74 68 65 20  e target of the 
11da0 73 79 6d 6c 69 6e 6b 2e 22 0a 20 20 20 20 20 20  symlink.".      
11db0 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
11dc0 3d 3d 27 62 63 66 65 38 65 34 62 2d 39 63 38 63  =='bcfe8e4b-9c8c
11dd0 2d 34 65 61 34 2d 38 33 39 30 2d 32 31 62 31 37  -4ea4-8390-21b17
11de0 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
11df0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
11e00 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20        else.     
11e10 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
11e20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
11e30 22 54 68 65 20 66 69 6c 65 20 77 69 74 68 20 74  "The file with t
11e40 68 65 20 70 61 74 68 20 6f 66 20 22 0a 20 20 20  he path of ".   
11e50 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
11e60 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
11e70 6f 20 22 20 20 20 20 24 53 5f 46 50 5f 30 22 0a  o "    $S_FP_0".
11e80 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
11e90 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
11ea0 65 63 68 6f 20 22 64 6f 65 73 20 6e 6f 74 20 65  echo "does not e
11eb0 78 69 73 74 2e 22 0a 20 20 20 20 20 20 20 20 20  xist.".         
11ec0 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
11ed0 32 64 62 34 62 32 39 32 2d 64 35 64 35 2d 34 32  2db4b292-d5d5-42
11ee0 38 36 2d 38 31 39 30 2d 32 31 62 31 37 30 65 30  86-8190-21b170e0
11ef0 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 20  31e7'".         
11f00 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
11f10 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d     fi.        #-
11f20 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
11f30 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
11f40 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
11f50 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66  with error.    f
11f60 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  i.    #--------.
11f70 20 20 20 20 69 66 20 5b 20 2d 64 20 22 24 53 5f      if [ -d "$S_
11f80 46 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  FP_0" ]; then.  
11f90 20 20 20 20 20 20 69 66 20 5b 20 2d 68 20 22 24        if [ -h "$
11fa0 53 5f 46 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a  S_FP_0" ]; then.
11fb0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
11fc0 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
11fd0 65 63 68 6f 20 22 54 68 65 20 70 61 74 68 20 22  echo "The path "
11fe0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
11ff0 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
12000 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50   echo "    $S_FP
12010 5f 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  _0".            
12020 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
12030 20 20 20 20 65 63 68 6f 20 22 72 65 66 65 72 65      echo "refere
12040 6e 63 65 73 20 61 20 73 79 6d 6c 69 6e 6b 20 74  nces a symlink t
12050 68 61 74 20 72 65 66 65 72 65 6e 63 65 73 20 66  hat references f
12060 6f 6c 64 65 72 2c 20 62 75 74 20 22 0a 20 20 20  older, but ".   
12070 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 61           echo "a
12080 20 66 69 6c 65 20 69 73 20 65 78 70 65 63 74 65   file is expecte
12090 64 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  d.".            
120a0 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 30 33 35  echo "GUID=='035
120b0 31 36 30 35 37 2d 36 34 66 63 2d 34 39 31 33 2d  16057-64fc-4913-
120c0 38 31 39 30 2d 32 31 62 31 37 30 65 30 33 31 65  8190-21b170e031e
120d0 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  7'".            
120e0 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
120f0 65 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20 20  else.           
12100 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
12110 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 70       echo "The p
12120 61 74 68 20 22 0a 20 20 20 20 20 20 20 20 20 20  ath ".          
12130 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
12140 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20        echo "    
12150 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 20 20 20  $S_FP_0".       
12160 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
12170 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 72           echo "r
12180 65 66 65 72 65 6e 63 65 73 20 61 20 66 6f 6c 64  eferences a fold
12190 65 72 2c 20 62 75 74 20 69 74 20 69 73 20 65 78  er, but it is ex
121a0 70 65 63 74 65 64 20 74 6f 20 22 0a 20 20 20 20  pected to ".    
121b0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 74 6f          echo "to
121c0 20 72 65 66 65 72 65 6e 63 65 20 61 20 66 69 6c   reference a fil
121d0 65 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  e.".            
121e0 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 32 32 31  echo "GUID=='221
121f0 64 38 65 32 62 2d 63 31 30 62 2d 34 32 62 39 2d  d8e2b-c10b-42b9-
12200 61 34 38 30 2d 32 31 62 31 37 30 65 30 33 31 65  a480-21b170e031e
12210 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  7'".            
12220 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
12230 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  fi.        #----
12240 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
12250 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
12260 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
12270 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20  h error.    fi. 
12280 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
12290 20 69 66 20 5b 20 2d 68 20 22 24 53 5f 46 50 5f   if [ -h "$S_FP_
122a0 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
122b0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
122c0 20 20 20 65 63 68 6f 20 22 54 68 65 20 70 61 74     echo "The pat
122d0 68 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  h ".        echo
122e0 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
122f0 20 22 20 20 20 20 24 53 5f 46 50 5f 30 22 0a 20   "    $S_FP_0". 
12300 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
12310 20 20 20 20 20 20 20 65 63 68 6f 20 22 72 65 66         echo "ref
12320 65 72 65 6e 63 65 73 20 61 20 73 79 6d 6c 69 6e  erences a symlin
12330 6b 2c 20 61 20 66 69 6c 65 20 69 73 20 65 78 70  k, a file is exp
12340 65 63 74 65 64 2e 22 0a 20 20 20 20 20 20 20 20  ected.".        
12350 65 63 68 6f 20 22 54 68 65 20 72 65 61 73 6f 6e  echo "The reason
12360 2c 20 77 68 79 20 73 79 6d 6c 69 6e 6b 73 20 74  , why symlinks t
12370 6f 20 66 69 6c 65 73 20 61 72 65 20 6e 6f 74 20  o files are not 
12380 73 75 70 70 6f 72 74 65 64 20 69 73 20 74 68 61  supported is tha
12390 74 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  t ".        echo
123a0 20 22 74 68 65 20 66 69 6c 65 20 73 69 7a 65 20   "the file size 
123b0 6f 66 20 73 79 6d 6c 69 6e 6b 73 20 63 61 6e 20  of symlinks can 
123c0 64 69 66 66 65 72 20 66 72 6f 6d 20 22 0a 20 20  differ from ".  
123d0 20 20 20 20 20 20 65 63 68 6f 20 22 74 68 65 20        echo "the 
123e0 66 69 6c 65 20 73 69 7a 65 20 6f 66 20 74 68 65  file size of the
123f0 20 74 61 72 67 65 74 20 6f 66 20 74 68 65 20 73   target of the s
12400 79 6d 6c 69 6e 6b 2e 22 0a 20 20 20 20 20 20 20  ymlink.".       
12410 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 34 35   echo "GUID=='45
12420 35 36 64 35 32 33 2d 31 65 39 33 2d 34 39 66 38  56d523-1e93-49f8
12430 2d 39 33 38 30 2d 32 31 62 31 37 30 65 30 33 31  -9380-21b170e031
12440 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68  e7'".        ech
12450 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d  o "".        #--
12460 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53  --.        cd $S
12470 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
12480 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
12490 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69  ith error.    fi
124a0 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73  .} # func_mmmv_s
124b0 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61  ilktorrent_packa
124c0 67 65 72 5f 74 31 5f 62 61 73 68 5f 65 78 63 5f  ger_t1_bash_exc_
124d0 61 73 73 65 72 74 5f 77 72 61 70 70 61 62 6c 65  assert_wrappable
124e0 5f 66 69 6c 65 5f 65 78 69 73 74 73 5f 74 31 0a  _file_exists_t1.
124f0 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
12500 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12510 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12520 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12530 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66  -------------..f
12540 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72  unc_mmmv_silktor
12550 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31  rent_packager_t1
12560 5f 62 61 73 68 5f 65 78 63 5f 61 73 73 65 72 74  _bash_exc_assert
12570 5f 70 61 63 6b 65 74 5f 6e 61 6d 65 5f 63 61 6e  _packet_name_can
12580 64 69 64 61 74 65 5f 65 78 69 73 74 73 5f 74 31  didate_exists_t1
12590 28 29 20 7b 20 0a 20 20 20 20 6c 6f 63 61 6c 20  () { .    local 
125a0 53 5f 46 50 5f 30 3d 22 24 31 22 20 23 20 50 61  S_FP_0="$1" # Pa
125b0 74 68 20 74 6f 20 74 68 65 20 66 69 6c 65 2e 20  th to the file. 
125c0 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  .    #--------. 
125d0 20 20 20 69 66 20 5b 20 22 24 53 5f 46 50 5f 30     if [ "$S_FP_0
125e0 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a  " == "" ]; then.
125f0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
12600 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
12610 65 20 32 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67  e 2. console arg
12620 75 6d 65 6e 74 20 69 73 20 65 78 70 65 63 74 65  ument is expecte
12630 64 20 74 6f 20 62 65 20 22 0a 20 20 20 20 20 20  d to be ".      
12640 20 20 65 63 68 6f 20 22 61 20 53 69 6c 6b 74 6f    echo "a Silkto
12650 72 72 65 6e 74 20 70 61 63 6b 65 74 20 6e 61 6d  rrent packet nam
12660 65 20 63 61 6e 64 69 64 61 74 65 2c 20 62 75 74  e candidate, but
12670 20 63 75 72 72 65 6e 74 6c 79 20 22 0a 20 20 20   currently ".   
12680 20 20 20 20 20 65 63 68 6f 20 22 74 68 65 20 32       echo "the 2
12690 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65  . console argume
126a0 6e 74 20 69 73 20 6d 69 73 73 69 6e 67 2e 22 0a  nt is missing.".
126b0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
126c0 49 44 3d 3d 27 39 64 64 38 30 31 32 35 2d 66 34  ID=='9dd80125-f4
126d0 62 38 2d 34 30 63 35 2d 62 31 38 30 2d 32 31 62  b8-40c5-b180-21b
126e0 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  170e031e7'".    
126f0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
12700 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
12710 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
12720 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
12730 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
12740 0a 20 20 20 20 66 69 0a 7d 20 23 20 66 75 6e 63  .    fi.} # func
12750 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
12760 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61  t_packager_t1_ba
12770 73 68 5f 65 78 63 5f 61 73 73 65 72 74 5f 70 61  sh_exc_assert_pa
12780 63 6b 65 74 5f 6e 61 6d 65 5f 63 61 6e 64 69 64  cket_name_candid
12790 61 74 65 5f 65 78 69 73 74 73 5f 74 31 0a 0a 0a  ate_exists_t1...
127a0 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
127b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
127c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
127d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
127e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46  -----------..S_F
127f0 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52  UNC_MMMV_SILKTOR
12800 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31  RENT_PACKAGER_T1
12810 5f 42 41 53 48 5f 52 45 56 45 52 53 45 5f 53 54  _BASH_REVERSE_ST
12820 52 49 4e 47 5f 52 45 47 49 53 54 45 52 3d 22 66  RING_REGISTER="f
12830 6f 72 20 69 6e 70 75 74 20 61 6e 64 20 6f 75 74  or input and out
12840 70 75 74 22 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56  put".S_FUNC_MMMV
12850 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
12860 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 52 45  KAGER_T1_BASH_RE
12870 56 45 52 53 45 5f 53 54 52 49 4e 47 5f 4d 4f 44  VERSE_STRING_MOD
12880 45 3d 22 22 20 23 20 6f 70 74 69 6d 2e 20 20 68  E="" # optim.  h
12890 61 63 6b 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69  ack.func_mmmv_si
128a0 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67  lktorrent_packag
128b0 65 72 5f 74 31 5f 62 61 73 68 5f 72 65 76 65 72  er_t1_bash_rever
128c0 73 65 5f 73 74 72 69 6e 67 28 29 20 7b 20 0a 20  se_string() { . 
128d0 20 20 20 6c 6f 63 61 6c 20 53 5f 49 4e 3d 22 24     local S_IN="$
128e0 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b  S_FUNC_MMMV_SILK
128f0 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52  TORRENT_PACKAGER
12900 5f 54 31 5f 42 41 53 48 5f 52 45 56 45 52 53 45  _T1_BASH_REVERSE
12910 5f 53 54 52 49 4e 47 5f 52 45 47 49 53 54 45 52  _STRING_REGISTER
12920 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ".    #---------
12930 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20  -----------.    
12940 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 30 3d 22 22  local S_TMP_0=""
12950 20 23 20 64 65 63 6c 61 72 61 74 69 6f 6e 0a 20   # declaration. 
12960 20 20 20 23 20 4d 6f 64 65 20 73 65 6c 65 63 74     # Mode select
12970 69 6f 6e 3a 0a 20 20 20 20 69 66 20 5b 20 22 24  ion:.    if [ "$
12980 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b  S_FUNC_MMMV_SILK
12990 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52  TORRENT_PACKAGER
129a0 5f 54 31 5f 42 41 53 48 5f 52 45 56 45 52 53 45  _T1_BASH_REVERSE
129b0 5f 53 54 52 49 4e 47 5f 4d 4f 44 45 22 20 3d 3d  _STRING_MODE" ==
129c0 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20   "" ] ; then.   
129d0 20 20 20 20 20 53 42 5f 45 58 49 53 54 53 5f 4f       SB_EXISTS_O
129e0 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54  N_PATH_T1_RESULT
129f0 3d 22 66 22 20 20 23 20 69 66 2d 62 6c 6f 63 6b  ="f"  # if-block
12a00 20 69 6e 69 74 0a 20 20 20 20 20 20 20 20 23 2d   init.        #-
12a10 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b  ---.        if [
12a20 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f   "$SB_EXISTS_ON_
12a30 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20  PATH_T1_RESULT" 
12a40 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a  == "f" ] ; then.
12a50 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d              S_TM
12a60 50 5f 30 3d 22 72 75 62 79 22 20 20 20 20 23 20  P_0="ruby"    # 
12a70 68 65 6c 70 73 20 6f 6e 20 42 53 44 0a 20 20 20  helps on BSD.   
12a80 20 20 20 20 20 20 20 20 20 66 75 6e 63 5f 73 62           func_sb
12a90 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f  _exists_on_path_
12aa0 74 31 20 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20  t1 "$S_TMP_0" . 
12ab0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 5b 20             if [ 
12ac0 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50  "$SB_EXISTS_ON_P
12ad0 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d  ATH_T1_RESULT" =
12ae0 3d 20 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20  = "t" ] ; then. 
12af0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
12b00 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b  S_FUNC_MMMV_SILK
12b10 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52  TORRENT_PACKAGER
12b20 5f 54 31 5f 42 41 53 48 5f 52 45 56 45 52 53 45  _T1_BASH_REVERSE
12b30 5f 53 54 52 49 4e 47 5f 4d 4f 44 45 3d 22 24 53  _STRING_MODE="$S
12b40 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20  _TMP_0".        
12b50 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 66      fi.        f
12b60 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d  i.        #-----
12b70 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b  ---.        if [
12b80 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53   "$S_FUNC_MMMV_S
12b90 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41  ILKTORRENT_PACKA
12ba0 47 45 52 5f 54 31 5f 42 41 53 48 5f 52 45 56 45  GER_T1_BASH_REVE
12bb0 52 53 45 5f 53 54 52 49 4e 47 5f 4d 4f 44 45 22  RSE_STRING_MODE"
12bc0 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a   == "" ] ; then.
12bd0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
12be0 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
12bf0 65 63 68 6f 20 22 41 6c 6c 20 6f 66 20 74 68 65  echo "All of the
12c00 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 74 68   applications th
12c10 61 74 20 74 68 69 73 20 66 75 6e 63 74 69 6f 6e  at this function
12c20 20 69 73 20 22 20 0a 20 20 20 20 20 20 20 20 20   is " .         
12c30 20 20 20 65 63 68 6f 20 22 63 61 70 61 62 6c 65     echo "capable
12c40 20 6f 66 20 75 73 69 6e 67 20 66 6f 72 20 72 65   of using for re
12c50 76 65 72 73 69 6e 67 20 61 20 73 74 72 69 6e 67  versing a string
12c60 28 72 75 62 79 29 22 0a 20 20 20 20 20 20 20 20  (ruby)".        
12c70 20 20 20 20 65 63 68 6f 20 22 61 72 65 20 6d 69      echo "are mi
12c80 73 73 69 6e 67 20 66 72 6f 6d 20 74 68 65 20 50  ssing from the P
12c90 41 54 48 2e 22 0a 20 20 20 20 20 20 20 20 20 20  ATH.".          
12ca0 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 62    echo "GUID=='b
12cb0 63 37 37 62 34 31 64 2d 36 34 37 38 2d 34 65 31  c77b41d-6478-4e1
12cc0 61 2d 39 33 38 30 2d 32 31 62 31 37 30 65 30 33  a-9380-21b170e03
12cd0 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 20 20  1e7'".          
12ce0 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
12cf0 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
12d00 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50          cd $S_FP
12d10 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20 20  _ORIG.          
12d20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
12d30 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20  with error.     
12d40 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d     fi.        #-
12d50 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20  -------.        
12d60 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22  if [ "$?" != "0"
12d70 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
12d80 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
12d90 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54           echo "T
12da0 68 69 73 20 73 63 72 69 70 74 20 69 73 20 66 6c  his script is fl
12db0 61 77 65 64 2e 22 0a 20 20 20 20 20 20 20 20 20  awed.".         
12dc0 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
12dd0 34 66 33 32 34 36 33 35 2d 62 39 38 65 2d 34 31  4f324635-b98e-41
12de0 39 38 2d 61 37 38 30 2d 32 31 62 31 37 30 65 30  98-a780-21b170e0
12df0 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 20  31e7'".         
12e00 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
12e10 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
12e20 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46           cd $S_F
12e30 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20  P_ORIG.         
12e40 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
12e50 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
12e60 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23      fi.        #
12e70 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66 69 0a  --------.    fi.
12e80 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
12e90 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f  ---------.    S_
12ea0 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f  FUNC_MMMV_SILKTO
12eb0 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54  RRENT_PACKAGER_T
12ec0 31 5f 42 41 53 48 5f 52 45 56 45 52 53 45 5f 53  1_BASH_REVERSE_S
12ed0 54 52 49 4e 47 5f 52 45 47 49 53 54 45 52 3d 22  TRING_REGISTER="
12ee0 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  ".    #--------.
12ef0 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e      if [ "$S_FUN
12f00 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45  C_MMMV_SILKTORRE
12f10 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42  NT_PACKAGER_T1_B
12f20 41 53 48 5f 52 45 56 45 52 53 45 5f 53 54 52 49  ASH_REVERSE_STRI
12f30 4e 47 5f 4d 4f 44 45 22 20 3d 3d 20 22 72 75 62  NG_MODE" == "rub
12f40 79 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  y" ]; then.     
12f50 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
12f60 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75 62 79 20   S_TMP_0="`ruby 
12f70 2d 65 20 5c 22 70 75 74 73 28 41 52 47 56 5b 30  -e \"puts(ARGV[0
12f80 5d 2e 74 6f 5f 73 2e 72 65 76 65 72 73 65 29 5c  ].to_s.reverse)\
12f90 22 20 22 24 53 5f 49 4e 22 20 32 3e 2f 64 65 76  " "$S_IN" 2>/dev
12fa0 2f 6e 75 6c 6c 60 22 0a 20 20 20 20 20 20 20 20  /null`".        
12fb0 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22  if [ "$?" != "0"
12fc0 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
12fd0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
12fe0 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54           echo "T
12ff0 68 65 20 63 6f 6e 73 6f 6c 65 20 61 70 70 6c 69  he console appli
13000 63 61 74 69 6f 6e 20 5c 22 72 75 62 79 5c 22 20  cation \"ruby\" 
13010 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
13020 68 6f 20 22 65 78 69 74 65 64 20 77 69 74 68 20  ho "exited with 
13030 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20 20 20 20  an error.".     
13040 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
13050 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
13060 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75  "----console--ou
13070 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d  tput--citation--
13080 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20 20 20 20  start-----".    
13090 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 60 72          echo "`r
130a0 75 62 79 20 2d 65 20 5c 22 70 75 74 73 28 27 24  uby -e \"puts('$
130b0 53 5f 49 4e 27 2e 72 65 76 65 72 73 65 29 5c 22  S_IN'.reverse)\"
130c0 60 22 20 23 20 77 69 74 68 20 74 68 65 20 73 74  `" # with the st
130d0 64 65 72 72 0a 20 20 20 20 20 20 20 20 20 20 20  derr.           
130e0 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f   echo "----conso
130f0 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61  le--output--cita
13100 74 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d  tion--end-------
13110 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
13120 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
13130 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 63    echo "GUID=='c
13140 63 64 38 32 38 31 36 2d 33 37 63 35 2d 34 30 35  cd82816-37c5-405
13150 63 2d 38 32 33 66 2d 32 31 62 31 37 30 65 30 33  c-823f-21b170e03
13160 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 20 20  1e7'".          
13170 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
13180 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
13190 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50          cd $S_FP
131a0 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20 20  _ORIG.          
131b0 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
131c0 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20  with error.     
131d0 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 53 5f     fi.        S_
131e0 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f  FUNC_MMMV_SILKTO
131f0 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54  RRENT_PACKAGER_T
13200 31 5f 42 41 53 48 5f 52 45 56 45 52 53 45 5f 53  1_BASH_REVERSE_S
13210 54 52 49 4e 47 5f 52 45 47 49 53 54 45 52 3d 22  TRING_REGISTER="
13220 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 66 69  $S_TMP_0".    fi
13230 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
13240 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23 20 66  ----------.} # f
13250 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72  unc_mmmv_silktor
13260 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31  rent_packager_t1
13270 5f 62 61 73 68 5f 72 65 76 65 72 73 65 5f 73 74  _bash_reverse_st
13280 72 69 6e 67 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  ring...#--------
13290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
132a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
132b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
132c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
132d0 2d 2d 0a 0a 23 20 41 73 20 6f 66 20 32 30 31 36  --..# As of 2016
132e0 20 74 68 65 20 6d 61 78 69 6d 75 6d 20 66 69 6c   the maximum fil
132f0 65 20 6e 61 6d 65 20 6c 65 6e 67 74 68 20 6f 6e  e name length on
13300 20 4c 69 6e 75 78 20 69 73 20 32 35 35 20 63 68   Linux is 255 ch
13310 61 72 61 63 74 65 72 73 2e 0a 23 20 41 74 0a 23  aracters..# At.#
13320 0a 23 20 20 20 20 68 74 74 70 3a 2f 2f 75 6e 69  .#    http://uni
13330 78 2e 73 74 61 63 6b 65 78 63 68 61 6e 67 65 2e  x.stackexchange.
13340 63 6f 6d 2f 71 75 65 73 74 69 6f 6e 73 2f 33 32  com/questions/32
13350 37 39 35 2f 77 68 61 74 2d 69 73 2d 74 68 65 2d  795/what-is-the-
13360 6d 61 78 69 6d 75 6d 2d 61 6c 6c 6f 77 65 64 2d  maximum-allowed-
13370 66 69 6c 65 6e 61 6d 65 2d 61 6e 64 2d 66 6f 6c  filename-and-fol
13380 64 65 72 2d 73 69 7a 65 2d 77 69 74 68 2d 65 63  der-size-with-ec
13390 72 79 70 74 66 73 0a 23 0a 23 20 74 68 65 20 65  ryptfs.#.# the e
133a0 43 72 79 70 74 66 73 20 72 65 6c 61 74 65 64 20  Cryptfs related 
133b0 72 65 63 6f 6d 6d 65 6e 64 61 74 69 6f 6e 20 69  recommendation i
133c0 73 20 74 6f 20 6b 65 65 70 20 74 68 65 20 6c 65  s to keep the le
133d0 6e 67 74 68 73 0a 23 20 6f 66 20 66 69 6c 65 20  ngths.# of file 
133e0 6e 61 6d 65 73 20 74 6f 20 6c 65 73 73 20 74 68  names to less th
133f0 61 6e 20 31 34 30 20 63 68 61 72 61 63 74 65 72  an 140 character
13400 73 2e 20 0a 23 0a 23 20 41 20 63 69 74 61 74 69  s. .#.# A citati
13410 6f 6e 20 66 72 6f 6d 20 0a 23 20 68 74 74 70 3a  on from .# http:
13420 2f 2f 77 69 6e 64 6f 77 73 2e 6d 69 63 72 6f 73  //windows.micros
13430 6f 66 74 2e 63 6f 6d 2f 65 6e 2d 75 73 2f 77 69  oft.com/en-us/wi
13440 6e 64 6f 77 73 2f 66 69 6c 65 2d 6e 61 6d 65 73  ndows/file-names
13450 2d 65 78 74 65 6e 73 69 6f 6e 73 2d 66 61 71 23  -extensions-faq#
13460 31 54 43 3d 77 69 6e 64 6f 77 73 2d 37 0a 23 20  1TC=windows-7.# 
13470 61 72 63 68 69 76 61 6c 20 63 6f 70 79 3a 20 68  archival copy: h
13480 74 74 70 73 3a 2f 2f 61 72 63 68 69 76 65 2e 69  ttps://archive.i
13490 73 2f 55 4b 42 6d 64 0a 23 20 20 20 20 20 22 57  s/UKBmd.#     "W
134a0 69 6e 64 6f 77 73 20 6c 69 6d 69 74 73 20 61 20  indows limits a 
134b0 73 69 6e 67 6c 65 20 70 61 74 68 20 74 6f 20 32  single path to 2
134c0 36 30 20 63 68 61 72 61 63 74 65 72 73 2e 22 0a  60 characters.".
134d0 23 0a 23 20 41 20 63 69 74 61 74 69 6f 6e 20 66  #.# A citation f
134e0 72 6f 6d 20 43 79 67 57 69 6e 20 6d 61 69 6c 69  rom CygWin maili
134f0 6e 67 20 6c 69 73 74 3a 0a 23 20 68 74 74 70 73  ng list:.# https
13500 3a 2f 2f 63 79 67 77 69 6e 2e 63 6f 6d 2f 6d 6c  ://cygwin.com/ml
13510 2f 63 79 67 77 69 6e 2f 32 30 30 34 2d 31 30 2f  /cygwin/2004-10/
13520 6d 73 67 30 31 33 32 33 2e 68 74 6d 6c 0a 23 20  msg01323.html.# 
13530 61 72 63 68 69 76 61 6c 20 63 6f 70 79 3a 20 68  archival copy: h
13540 74 74 70 73 3a 2f 2f 61 72 63 68 69 76 65 2e 69  ttps://archive.i
13550 73 2f 47 52 76 46 4b 0a 23 20 20 20 20 20 22 54  s/GRvFK.#     "T
13560 68 65 20 55 6e 69 63 6f 64 65 20 76 65 72 73 69  he Unicode versi
13570 6f 6e 73 20 6f 66 20 73 65 76 65 72 61 6c 20 66  ons of several f
13580 75 6e 63 74 69 6f 6e 73 20 70 65 72 6d 69 74 20  unctions permit 
13590 61 20 0a 23 20 20 20 20 20 6d 61 78 69 6d 75 6d  a .#     maximum
135a0 20 70 61 74 68 20 6c 65 6e 67 74 68 20 6f 66 20   path length of 
135b0 33 32 2c 37 36 37 20 63 68 61 72 61 63 74 65 72  32,767 character
135c0 73 2c 20 0a 23 20 20 20 20 20 63 6f 6d 70 6f 73  s, .#     compos
135d0 65 64 20 6f 66 20 63 6f 6d 70 6f 6e 65 6e 74 73  ed of components
135e0 20 75 70 20 74 6f 20 32 35 35 20 63 68 61 72 61   up to 255 chara
135f0 63 74 65 72 73 20 69 6e 20 6c 65 6e 67 74 68 2e  cters in length.
13600 20 0a 23 20 20 20 20 20 54 6f 20 73 70 65 63 69   .#     To speci
13610 66 79 20 73 75 63 68 20 61 20 70 61 74 68 2c 20  fy such a path, 
13620 75 73 65 20 74 68 65 20 22 5c 5c 3f 5c 22 20 70  use the "\\?\" p
13630 72 65 66 69 78 2e 20 46 6f 72 20 65 78 61 6d 70  refix. For examp
13640 6c 65 2c 20 0a 23 20 20 20 20 20 22 5c 5c 3f 5c  le, .#     "\\?\
13650 44 3a 5c 3c 70 61 74 68 3e 22 2e 20 54 6f 20 73  D:\<path>". To s
13660 70 65 63 69 66 79 20 73 75 63 68 20 61 20 55 4e  pecify such a UN
13670 43 20 70 61 74 68 2c 20 75 73 65 20 74 68 65 20  C path, use the 
13680 22 5c 5c 3f 5c 55 4e 43 5c 22 20 0a 23 20 20 20  "\\?\UNC\" .#   
13690 20 20 70 72 65 66 69 78 2e 20 46 6f 72 20 65 78    prefix. For ex
136a0 61 6d 70 6c 65 2c 20 22 5c 5c 3f 5c 55 4e 43 5c  ample, "\\?\UNC\
136b0 3c 73 65 72 76 65 72 3e 5c 3c 73 68 61 72 65 3e  <server>\<share>
136c0 22 2e 20 0a 23 20 20 20 20 20 4e 6f 74 65 20 74  ". .#     Note t
136d0 68 61 74 20 74 68 65 73 65 20 70 72 65 66 69 78  hat these prefix
136e0 65 73 20 61 72 65 20 6e 6f 74 20 75 73 65 64 20  es are not used 
136f0 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 70  as part of the p
13700 61 74 68 20 0a 23 20 20 20 20 20 69 74 73 65 6c  ath .#     itsel
13710 66 2e 20 54 68 65 79 20 69 6e 64 69 63 61 74 65  f. They indicate
13720 20 74 68 61 74 20 74 68 65 20 70 61 74 68 20 73   that the path s
13730 68 6f 75 6c 64 20 62 65 20 70 61 73 73 65 64 20  hould be passed 
13740 74 6f 20 74 68 65 20 0a 23 20 20 20 20 20 73 79  to the .#     sy
13750 73 74 65 6d 20 77 69 74 68 20 6d 69 6e 69 6d 61  stem with minima
13760 6c 20 6d 6f 64 69 66 69 63 61 74 69 6f 6e 2e 20  l modification. 
13770 41 6e 20 69 6d 70 6c 69 63 61 74 69 6f 6e 20 6f  An implication o
13780 66 20 74 68 69 73 20 69 73 20 0a 23 20 20 20 20  f this is .#    
13790 20 74 68 61 74 20 79 6f 75 20 63 61 6e 6e 6f 74   that you cannot
137a0 20 75 73 65 20 66 6f 72 77 61 72 64 20 73 6c 61   use forward sla
137b0 73 68 65 73 20 74 6f 20 72 65 70 72 65 73 65 6e  shes to represen
137c0 74 20 70 61 74 68 20 73 65 70 61 72 61 74 6f 72  t path separator
137d0 73 20 0a 23 20 20 20 20 20 6f 72 20 61 20 70 65  s .#     or a pe
137e0 72 69 6f 64 20 74 6f 20 72 65 70 72 65 73 65 6e  riod to represen
137f0 74 20 74 68 65 20 63 75 72 72 65 6e 74 20 64 69  t the current di
13800 72 65 63 74 6f 72 79 2e 22 0a 23 20 52 65 6c 61  rectory.".# Rela
13810 74 65 64 20 70 61 67 65 73 3a 0a 23 20 68 74 74  ted pages:.# htt
13820 70 73 3a 2f 2f 6d 73 64 6e 2e 6d 69 63 72 6f 73  ps://msdn.micros
13830 6f 66 74 2e 63 6f 6d 2f 65 6e 2d 75 73 2f 6c 69  oft.com/en-us/li
13840 62 72 61 72 79 2f 61 61 33 36 35 32 34 37 28 56  brary/aa365247(V
13850 53 2e 38 35 29 2e 61 73 70 78 0a 23 20 61 72 63  S.85).aspx.# arc
13860 68 69 76 61 6c 20 63 6f 70 79 3a 20 68 74 74 70  hival copy: http
13870 73 3a 2f 2f 61 72 63 68 69 76 65 2e 69 73 2f 70  s://archive.is/p
13880 38 39 31 79 0a 23 0a 23 20 54 6f 20 61 6c 6c 6f  891y.#.# To allo
13890 77 20 64 61 74 61 62 61 73 65 20 69 6e 64 65 78  w database index
138a0 65 73 20 74 68 61 74 20 73 74 6f 72 65 20 74 68  es that store th
138b0 65 20 0a 23 20 66 69 6c 65 20 6e 61 6d 65 73 20  e .# file names 
138c0 6f 66 20 74 68 65 20 62 6c 6f 67 73 20 0a 23 20  of the blogs .# 
138d0 74 6f 20 77 6f 72 6b 20 61 73 20 65 66 66 69 63  to work as effic
138e0 69 65 6e 74 6c 79 20 61 73 20 70 6f 73 73 69 62  iently as possib
138f0 6c 65 2c 20 74 68 65 20 66 69 72 73 74 0a 23 20  le, the first.# 
13900 63 68 61 72 61 63 74 65 72 73 20 6f 66 20 74 68  characters of th
13910 65 20 66 69 6c 65 20 6e 61 6d 65 20 73 68 6f 75  e file name shou
13920 6c 64 20 62 65 20 61 73 20 0a 23 20 75 6e 69 66  ld be as .# unif
13930 6f 72 6d 6c 79 20 72 61 6e 64 6f 6d 20 73 65 74  ormly random set
13940 20 6f 66 20 63 68 61 72 61 63 74 65 72 73 20 61   of characters a
13950 73 20 70 6f 73 73 69 62 6c 65 2e 0a 23 20 49 66  s possible..# If
13960 20 66 69 6c 65 20 6e 61 6d 65 20 73 74 61 72 74   file name start
13970 73 20 77 69 74 68 20 61 20 73 65 63 75 72 65 20  s with a secure 
13980 68 61 73 68 2c 20 74 68 65 6e 20 0a 23 20 74 68  hash, then .# th
13990 61 74 20 72 65 71 75 69 72 65 6d 65 6e 74 20 69  at requirement i
139a0 73 20 6d 65 74 2e 20 0a 23 0a 23 20 54 68 65 20  s met. .#.# The 
139b0 70 61 72 73 65 72 20 74 68 61 74 20 64 69 73 6d  parser that dism
139c0 61 6e 74 6c 65 73 20 74 68 65 20 66 69 6c 65 20  antles the file 
139d0 6e 61 6d 65 20 74 6f 20 72 65 6c 65 76 61 6e 74  name to relevant
139e0 20 63 6f 6d 70 6f 6e 65 6e 74 73 20 0a 23 20 73   components .# s
139f0 68 6f 75 6c 64 20 62 65 20 69 6d 70 6c 65 6d 65  hould be impleme
13a00 6e 74 61 62 6c 65 20 69 6e 20 64 69 66 66 65 72  ntable in differ
13a10 65 6e 74 20 70 72 6f 67 72 61 6d 6d 69 6e 67 20  ent programming 
13a20 6c 61 6e 67 75 61 67 65 73 0a 23 20 77 69 74 68  languages.# with
13a30 6f 75 74 20 69 6e 76 65 73 74 69 6e 67 20 63 6f  out investing co
13a40 6e 73 69 64 65 72 61 62 6c 65 20 61 6d 6f 75 6e  nsiderable amoun
13a50 74 20 6f 66 20 64 65 76 65 6c 6f 70 6d 65 6e 74  t of development
13a60 20 74 69 6d 65 2e 0a 23 20 54 68 65 20 73 79 6e   time..# The syn
13a70 74 61 78 20 6f 66 20 74 68 65 20 66 69 6c 65 20  tax of the file 
13a80 6e 61 6d 65 20 73 68 6f 75 6c 64 20 61 6c 73 6f  name should also
13a90 20 61 6c 6c 6f 77 20 74 68 65 0a 23 20 66 69 6c   allow the.# fil
13aa0 65 20 6e 61 6d 65 20 74 6f 20 62 65 20 70 61 72  e name to be par
13ab0 73 65 64 20 63 6f 6d 70 75 74 61 74 69 6f 6e 61  sed computationa
13ac0 6c 6c 79 20 63 68 65 61 70 6c 79 2e 0a 23 0a 23  lly cheaply..#.#
13ad0 20 41 73 20 6f 66 20 32 30 31 36 5f 30 35 20 74   As of 2016_05 t
13ae0 68 65 20 66 69 6c 65 20 65 78 74 65 6e 73 69 6f  he file extensio
13af0 6e 20 20 2e 73 74 62 6c 6f 62 20 73 65 65 6d 73  n  .stblob seems
13b00 20 74 6f 20 62 65 20 75 6e 75 73 65 64 2e 0a 23   to be unused..#
13b10 20 54 68 65 72 65 66 6f 72 65 20 74 68 65 20 22   Therefore the "
13b20 73 69 6c 6b 74 6f 72 72 65 6e 74 20 62 6c 6f 62  silktorrent blob
13b30 22 2c 20 2e 73 74 62 6c 6f 62 2c 20 63 61 6e 20  ", .stblob, can 
13b40 62 65 20 75 73 65 64 20 66 6f 72 20 74 68 65 20  be used for the 
13b50 0a 23 20 65 78 74 65 6e 73 69 6f 6e 20 6f 66 20  .# extension of 
13b60 74 68 65 20 62 6c 6f 62 20 66 69 6c 65 73 2e 0a  the blob files..
13b70 23 0a 23 20 43 6f 6d 70 72 65 73 73 69 6f 6e 20  #.# Compression 
13b80 6f 66 20 74 68 65 20 62 6c 6f 62 73 20 49 53 20  of the blobs IS 
13b90 4e 4f 54 20 41 4c 4c 4f 57 45 44 2c 20 62 65 63  NOT ALLOWED, bec
13ba0 61 75 73 65 20 74 68 65 20 0a 23 20 62 6c 6f 62  ause the .# blob
13bb0 73 20 6d 75 73 74 20 62 65 20 65 78 74 72 61 63  s must be extrac
13bc0 74 61 62 6c 65 20 77 69 74 68 6f 75 74 20 62 65  table without be
13bd0 63 6f 6d 69 6e 67 20 61 20 76 69 63 74 69 6d 20  coming a victim 
13be0 0a 23 20 6f 66 20 61 6e 20 61 74 74 61 63 6b 2c  .# of an attack,
13bf0 20 77 68 65 72 65 20 31 30 30 47 69 42 20 6f 66   where 100GiB of
13c00 20 7a 65 72 6f 73 20 69 73 20 70 61 63 6b 65 64   zeros is packed
13c10 20 74 6f 20 61 0a 23 20 73 6d 61 6c 6c 20 66 69   to a.# small fi
13c20 6c 65 2e 20 54 68 65 20 63 6f 6e 74 61 69 6e 65  le. The containe
13c30 72 20 66 6f 72 6d 61 74 20 69 73 20 74 68 65 20  r format is the 
13c40 74 61 72 20 66 6f 72 6d 61 74 2c 0a 23 20 77 69  tar format,.# wi
13c50 74 68 6f 75 74 20 61 6e 79 20 63 6f 6d 70 72 65  thout any compre
13c60 73 73 69 6f 6e 2e 0a 53 5f 46 55 4e 43 5f 4d 4d  ssion..S_FUNC_MM
13c70 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50  MV_SILKTORRENT_P
13c80 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f  ACKAGER_T1_BASH_
13c90 42 4c 4f 42 32 46 49 4c 45 4e 41 4d 45 5f 54 31  BLOB2FILENAME_T1
13ca0 5f 52 45 53 55 4c 54 3d 22 6e 6f 74 20 73 65 74  _RESULT="not set
13cb0 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b  ".func_mmmv_silk
13cc0 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72  torrent_packager
13cd0 5f 74 31 5f 62 61 73 68 5f 62 6c 6f 62 32 66 69  _t1_bash_blob2fi
13ce0 6c 65 6e 61 6d 65 5f 74 31 28 29 20 7b 20 0a 20  lename_t1() { . 
13cf0 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 30 3d     local S_FP_0=
13d00 22 24 31 22 20 23 20 50 61 74 68 20 74 6f 20 74  "$1" # Path to t
13d10 68 65 20 66 69 6c 65 2e 20 0a 20 20 20 20 23 2d  he file. .    #-
13d20 2d 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d  ---.    func_mmm
13d30 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61  v_silktorrent_pa
13d40 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 65  ckager_t1_bash_e
13d50 78 63 5f 61 73 73 65 72 74 5f 77 72 61 70 70 61  xc_assert_wrappa
13d60 62 6c 65 5f 66 69 6c 65 5f 65 78 69 73 74 73 5f  ble_file_exists_
13d70 74 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20  t1 "$S_FP_0".   
13d80 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23   #--------.    #
13d90 20 54 68 65 20 54 69 67 65 72 20 20 20 20 20 68   The Tiger     h
13da0 61 73 68 20 68 61 73 20 20 34 38 20 63 68 61 72  ash has  48 char
13db0 61 63 74 65 72 73 2e 0a 20 20 20 20 23 20 54 68  acters..    # Th
13dc0 65 20 57 68 69 72 6c 70 6f 6f 6c 20 68 61 73 68  e Whirlpool hash
13dd0 20 68 61 73 20 31 32 38 20 63 68 61 72 61 63 74   has 128 charact
13de0 65 72 73 2e 0a 20 20 20 20 23 20 54 68 65 20 53  ers..    # The S
13df0 48 41 2d 32 35 36 20 20 20 68 61 73 68 20 68 61  HA-256   hash ha
13e00 73 20 20 36 34 20 63 68 61 72 61 63 74 65 72 73  s  64 characters
13e10 2e 0a 20 20 20 20 23 0a 20 20 20 20 23 20 41 20  ..    #.    # A 
13e20 66 69 6c 65 20 73 69 7a 65 20 6f 66 20 31 54 69  file size of 1Ti
13e30 42 20 69 73 20 7e 31 30 5e 31 32 20 7e 20 31 33  B is ~10^12 ~ 13
13e40 20 63 68 61 72 61 63 74 65 72 73 0a 20 20 20 20   characters.    
13e50 23 20 41 20 66 69 6c 65 20 73 69 7a 65 20 6f 66  # A file size of
13e60 20 31 50 69 42 20 69 73 20 7e 31 30 5e 31 35 20   1PiB is ~10^15 
13e70 7e 20 31 34 20 63 68 61 72 61 63 74 65 72 73 0a  ~ 14 characters.
13e80 20 20 20 20 23 20 41 20 66 69 6c 65 20 73 69 7a      # A file siz
13e90 65 20 6f 66 20 31 45 69 42 20 69 73 20 7e 31 30  e of 1EiB is ~10
13ea0 5e 31 38 20 7e 20 31 39 20 63 68 61 72 61 63 74  ^18 ~ 19 charact
13eb0 65 72 73 0a 20 20 20 20 23 20 41 20 66 69 6c 65  ers.    # A file
13ec0 20 73 69 7a 65 20 6f 66 20 31 5a 69 42 20 69 73   size of 1ZiB is
13ed0 20 7e 31 30 5e 32 31 20 7e 20 32 32 20 63 68 61   ~10^21 ~ 22 cha
13ee0 72 61 63 74 65 72 73 0a 20 20 20 20 23 20 41 20  racters.    # A 
13ef0 66 69 6c 65 20 73 69 7a 65 20 6f 66 20 31 59 69  file size of 1Yi
13f00 42 20 69 73 20 7e 31 30 5e 32 34 20 7e 20 32 35  B is ~10^24 ~ 25
13f10 20 63 68 61 72 61 63 74 65 72 73 0a 20 20 20 20   characters.    
13f20 23 20 0a 20 20 20 20 23 20 54 68 65 20 6d 61 78  # .    # The max
13f30 2e 20 66 69 6c 65 20 6e 61 6d 65 20 6c 65 6e 67  . file name leng
13f40 74 68 20 6f 6e 20 4c 69 6e 75 78 20 61 6e 64 20  th on Linux and 
13f50 0a 20 20 20 20 23 20 57 69 6e 64 6f 77 73 20 28  .    # Windows (
13f60 55 6e 69 63 6f 64 65 20 41 50 49 29 20 69 73 20  Unicode API) is 
13f70 32 35 35 20 63 68 61 72 61 63 74 65 72 73 2e 0a  255 characters..
13f80 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 23 20      #----.    # 
13f90 54 68 65 20 63 68 61 72 61 63 74 65 72 20 62 75  The character bu
13fa0 64 67 65 74 3a 0a 20 20 20 20 23 20 20 20 20 20  dget:.    #     
13fb0 20 20 20 36 20 63 68 61 72 61 63 74 65 72 73 20     6 characters 
13fc0 2d 2d 2d 20 66 69 6c 65 20 6e 61 6d 65 20 66 6f  --- file name fo
13fd0 72 6d 61 74 20 74 79 70 65 20 49 44 20 0a 20 20  rmat type ID .  
13fe0 20 20 23 20 20 20 20 20 20 20 20 20 20 20 20 20    #             
13ff0 20 20 20 20 20 20 20 20 20 20 20 20 72 67 78 5f              rgx_
14000 69 6e 5f 72 75 62 79 3d 2f 76 5b 5c 64 5d 7b 34  in_ruby=/v[\d]{4
14010 7d 5b 5f 5d 2f 0a 20 20 20 20 23 20 65 63 68 6f  }[_]/.    # echo
14020 20 22 76 30 30 33 34 5f 73 32 33 34 32 5f 22 20   "v0034_s2342_" 
14030 7c 20 67 61 77 6b 20 27 7b 20 67 73 75 62 28 2f  | gawk '{ gsub(/
14040 5f 2f 2c 20 22 5f 5c 6e 22 29 3b 20 70 72 69 6e  _/, "_\n"); prin
14050 74 20 7d 27 20 7c 20 5c 0a 20 20 20 20 23 20 20  t }' | \.    #  
14060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14070 20 20 20 20 20 67 61 77 6b 20 27 2f 5e 76 5b 30       gawk '/^v[0
14080 2d 39 5d 7b 34 7d 5f 2f 20 7b 70 72 69 6e 74 66  -9]{4}_/ {printf
14090 20 22 25 73 22 2c 24 31 20 7d 27 20 7c 20 5c 0a   "%s",$1 }' | \.
140a0 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20 20      #           
140b0 20 20 20 20 20 20 20 20 20 20 20 20 67 61 77 6b              gawk
140c0 20 27 7b 67 73 75 62 28 2f 5b 76 5f 5d 2f 2c 22   '{gsub(/[v_]/,"
140d0 22 29 3b 70 72 69 6e 74 66 20 22 25 73 22 2c 20  ");printf "%s", 
140e0 24 31 20 7d 27 0a 20 20 20 20 23 0a 20 20 20 20  $1 }'.    #.    
140f0 23 20 20 20 6d 61 78 20 33 32 20 63 68 61 72 61  #   max 32 chara
14100 63 74 65 72 73 20 2d 2d 2d 20 66 69 6c 65 20 73  cters --- file s
14110 69 7a 65 20 20 20 20 0a 20 20 20 20 23 20 20 20  ize    .    #   
14120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14130 20 20 20 20 20 20 72 67 78 5f 69 6e 5f 72 75 62        rgx_in_rub
14140 79 3d 2f 73 5b 5c 64 5d 2b 5b 5f 5d 2f 0a 20 20  y=/s[\d]+[_]/.  
14150 20 20 23 20 20 20 20 20 20 20 20 20 20 20 20 20    #             
14160 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
14170 20 22 76 30 30 33 34 5f 22 20 7c 20 67 61 77 6b   "v0034_" | gawk
14180 20 27 2f 5e 76 5b 30 2d 39 5d 7b 34 7d 5f 2f 20   '/^v[0-9]{4}_/ 
14190 7b 70 72 69 6e 74 66 20 22 25 73 22 2c 24 31 20  {printf "%s",$1 
141a0 7d 27 0a 20 20 20 20 23 20 65 63 68 6f 20 22 76  }'.    # echo "v
141b0 30 30 33 34 5f 73 32 33 34 32 5f 22 20 7c 20 67  0034_s2342_" | g
141c0 61 77 6b 20 27 7b 20 67 73 75 62 28 2f 5f 2f 2c  awk '{ gsub(/_/,
141d0 20 22 5f 5c 6e 22 29 3b 20 70 72 69 6e 74 20 7d   "_\n"); print }
141e0 27 20 7c 20 5c 0a 20 20 20 20 23 20 20 20 20 20  ' | \.    #     
141f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14200 20 20 67 61 77 6b 20 27 2f 5e 73 5b 30 2d 39 5d    gawk '/^s[0-9]
14210 2b 5f 2f 20 7b 70 72 69 6e 74 66 20 22 25 73 22  +_/ {printf "%s"
14220 2c 24 31 20 7d 27 20 7c 20 5c 0a 20 20 20 20 23  ,$1 }' | \.    #
14230 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14240 20 20 20 20 20 20 20 67 61 77 6b 20 27 7b 67 73         gawk '{gs
14250 75 62 28 2f 5b 73 5f 5d 2f 2c 22 22 29 3b 70 72  ub(/[s_]/,"");pr
14260 69 6e 74 66 20 22 25 73 22 2c 20 24 31 20 7d 27  intf "%s", $1 }'
14270 0a 20 20 20 20 23 0a 20 20 20 20 23 0a 20 20 20  .    #.    #.   
14280 20 23 20 20 20 20 20 20 20 36 36 20 63 68 61 72   #       66 char
14290 61 63 74 65 72 73 20 2d 2d 2d 20 53 48 41 2d 32  acters --- SHA-2
142a0 35 36 20 20 0a 20 20 20 20 23 20 20 20 20 20 20  56  .    #      
142b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
142c0 20 20 20 72 67 78 5f 69 6e 5f 72 75 62 79 3d 2f     rgx_in_ruby=/
142d0 68 5b 5c 64 61 62 63 64 65 66 5d 7b 36 34 7d 5b  h[\dabcdef]{64}[
142e0 5f 5d 2f 0a 20 20 20 20 23 20 65 63 68 6f 20 22  _]/.    # echo "
142f0 68 60 73 68 61 32 35 36 73 75 6d 20 2f 64 65 76  h`sha256sum /dev
14300 2f 6e 75 6c 6c 20 7c 20 67 61 77 6b 20 27 2f 5b  /null | gawk '/[
14310 30 2d 39 61 62 63 64 65 66 5d 2f 20 7b 70 72 69  0-9abcdef]/ {pri
14320 6e 74 66 20 22 25 73 22 2c 24 31 7d 27 60 5f 22  ntf "%s",$1}'`_"
14330 20 7c 20 5c 0a 20 20 20 20 23 20 20 20 20 20 20   | \.    #      
14340 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14350 20 20 20 20 20 20 20 20 20 67 61 77 6b 20 27 2f           gawk '/
14360 5e 68 5b 30 2d 39 61 62 63 64 65 66 5d 2b 5f 2f  ^h[0-9abcdef]+_/
14370 20 7b 70 72 69 6e 74 66 20 22 25 73 22 2c 24 31   {printf "%s",$1
14380 20 7d 27 20 7c 20 5c 0a 20 20 20 20 23 20 20 20   }' | \.    #   
14390 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
143a0 20 20 20 20 20 20 20 20 20 20 20 20 67 61 77 6b              gawk
143b0 20 27 7b 67 73 75 62 28 2f 5b 68 5f 5d 2f 2c 22   '{gsub(/[h_]/,"
143c0 22 29 3b 70 72 69 6e 74 66 20 22 25 73 22 2c 20  ");printf "%s", 
143d0 24 31 20 7d 27 0a 20 20 20 20 23 0a 20 20 20 20  $1 }'.    #.    
143e0 23 0a 20 20 20 20 23 20 20 20 20 20 20 20 35 30  #.    #       50
143f0 20 63 68 61 72 61 63 74 65 72 73 20 2d 2d 2d 20   characters --- 
14400 54 69 67 65 72 0a 20 20 20 20 23 20 20 20 20 20  Tiger.    #     
14410 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14420 20 20 20 20 72 67 78 5f 69 6e 5f 72 75 62 79 3d      rgx_in_ruby=
14430 2f 69 5b 5c 64 61 62 63 64 65 66 5d 7b 34 38 7d  /i[\dabcdef]{48}
14440 24 2f 20 20 20 23 20 6c 61 63 6b 73 20 74 68 65  $/   # lacks the
14450 20 65 6e 64 69 6e 67 20 22 5f 22 20 0a 20 20 20   ending "_" .   
14460 20 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20   #              
14470 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14480 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14490 20 20 20 20 20 20 20 20 20 20 20 20 23 20 66 6f              # fo
144a0 72 20 64 62 20 69 6e 64 65 78 20 6f 70 74 69 6d  r db index optim
144b0 69 7a 61 74 69 6f 6e 0a 20 20 20 20 23 20 20 20  ization.    #   
144c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
144d0 20 20 20 20 20 20 54 68 65 20 67 61 77 6b 20 63        The gawk c
144e0 6f 64 65 20 69 73 20 61 73 20 77 69 74 68 20 74  ode is as with t
144f0 68 65 20 73 68 61 32 35 36 2c 20 0a 20 20 20 20  he sha256, .    
14500 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  #               
14510 20 20 20 20 20 20 20 20 20 20 65 78 63 65 70 74            except
14520 20 74 68 61 74 20 73 68 61 32 35 36 73 75 6d 2d   that sha256sum-
14530 3e 20 74 69 67 65 72 64 65 65 70 2c 20 22 5e 68  > tigerdeep, "^h
14540 22 2d 3e 22 5e 69 22 2c 0a 20 20 20 20 23 20 20  "->"^i",.    #  
14550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14560 20 20 20 20 20 20 20 22 5b 68 5f 5d 22 2d 3e 22         "[h_]"->"
14570 5b 69 5f 5d 22 0a 20 20 20 20 23 0a 20 20 20 20  [i_]".    #.    
14580 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20  #--------.    # 
14590 41 73 20 74 68 65 20 63 75 72 72 65 6e 74 20 76  As the current v
145a0 65 72 73 69 6f 6e 20 6f 66 20 74 68 69 73 20 73  ersion of this s
145b0 63 72 69 70 74 20 64 65 70 65 6e 64 73 20 6f 6e  cript depends on
145c0 20 52 75 62 79 20 61 6e 79 77 61 79 2c 0a 20 20   Ruby anyway,.  
145d0 20 20 23 20 74 68 65 20 67 61 77 6b 20 72 65 67    # the gawk reg
145e0 65 78 20 62 61 73 65 64 20 62 72 61 6e 63 68 65  ex based branche
145f0 73 20 74 68 61 74 20 61 72 65 20 72 65 61 6c 6c  s that are reall
14600 79 0a 20 20 20 20 23 20 63 6f 6d 70 6c 65 78 20  y.    # complex 
14610 61 6e 64 20 72 65 71 75 69 72 65 20 6d 75 6c 74  and require mult
14620 69 70 6c 65 20 67 61 77 6b 20 63 61 6c 6c 73 20  iple gawk calls 
14630 63 61 6e 20 62 65 20 6c 65 66 74 20 75 6e 69 6d  can be left unim
14640 70 6c 65 6d 65 6e 74 65 64 2e 0a 20 20 20 20 23  plemented..    #
14650 20 54 68 61 74 20 77 61 79 20 74 68 69 73 20 73   That way this s
14660 63 72 69 70 74 20 62 65 63 6f 6d 65 73 20 6d 6f  cript becomes mo
14670 72 65 20 73 75 63 63 69 6e 63 74 2e 0a 20 20 20  re succinct..   
14680 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   #--------------
14690 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66 75 6e 63 5f  ------.    func_
146a0 6d 6d 6d 76 5f 74 69 67 65 72 68 61 73 68 5f 74  mmmv_tigerhash_t
146b0 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20 20  1 "$S_FP_0".    
146c0 23 65 63 68 6f 20 22 20 20 20 20 20 20 20 54 69  #echo "       Ti
146d0 67 65 72 3a 20 24 53 5f 46 55 4e 43 5f 4d 4d 4d  ger: $S_FUNC_MMM
146e0 56 5f 54 49 47 45 52 48 41 53 48 5f 54 31 5f 52  V_TIGERHASH_T1_R
146f0 45 53 55 4c 54 22 0a 20 20 20 20 23 66 75 6e 63  ESULT".    #func
14700 5f 6d 6d 6d 76 5f 77 68 69 72 6c 70 6f 6f 6c 68  _mmmv_whirlpoolh
14710 61 73 68 5f 74 31 20 22 24 53 5f 46 50 5f 30 22  ash_t1 "$S_FP_0"
14720 0a 20 20 20 20 23 65 63 68 6f 20 22 20 20 20 57  .    #echo "   W
14730 68 69 72 6c 70 6f 6f 6c 3a 20 24 53 5f 46 55 4e  hirlpool: $S_FUN
14740 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c  C_MMMV_WHIRLPOOL
14750 48 41 53 48 5f 54 31 5f 52 45 53 55 4c 54 22 0a  HASH_T1_RESULT".
14760 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 68      func_mmmv_sh
14770 61 32 35 36 5f 74 31 20 22 24 53 5f 46 50 5f 30  a256_t1 "$S_FP_0
14780 22 0a 20 20 20 20 23 65 63 68 6f 20 22 20 20 20  ".    #echo "   
14790 20 20 20 53 48 41 32 35 36 3a 20 24 53 5f 46 55     SHA256: $S_FU
147a0 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54  NC_MMMV_SHA256_T
147b0 31 5f 52 45 53 55 4c 54 22 0a 20 20 20 20 66 75  1_RESULT".    fu
147c0 6e 63 5f 6d 6d 6d 76 5f 66 69 6c 65 73 69 7a 65  nc_mmmv_filesize
147d0 5f 74 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20  _t1 "$S_FP_0".  
147e0 20 20 23 65 63 68 6f 20 22 20 20 20 66 69 6c 65    #echo "   file
147f0 20 73 69 7a 65 3a 20 24 53 5f 46 55 4e 43 5f 4d   size: $S_FUNC_M
14800 4d 4d 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f  MMV_FILESIZE_T1_
14810 52 45 53 55 4c 54 22 0a 20 20 20 20 23 2d 2d 2d  RESULT".    #---
14820 2d 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61 6c 20  -----.    local 
14830 53 5f 4e 41 4d 45 5f 52 45 56 45 52 53 45 44 3d  S_NAME_REVERSED=
14840 22 62 6f 6c 62 74 73 2e 22 20 23 20 22 2e 73 74  "bolbts." # ".st
14850 62 6c 6f 62 22 2e 72 65 76 65 72 73 65 0a 20 20  blob".reverse.  
14860 20 20 6c 6f 63 61 6c 20 53 5f 30 3d 22 76 30 30    local S_0="v00
14870 30 31 5f 73 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56  01_s$S_FUNC_MMMV
14880 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 52 45 53  _FILESIZE_T1_RES
14890 55 4c 54 22 0a 20 20 20 20 53 5f 4e 41 4d 45 5f  ULT".    S_NAME_
148a0 52 45 56 45 52 53 45 44 3d 22 24 53 5f 4e 41 4d  REVERSED="$S_NAM
148b0 45 5f 52 45 56 45 52 53 45 44 24 53 5f 30 22 0a  E_REVERSED$S_0".
148c0 20 20 20 20 53 5f 30 3d 22 5f 68 24 53 5f 46 55      S_0="_h$S_FU
148d0 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54  NC_MMMV_SHA256_T
148e0 31 5f 52 45 53 55 4c 54 22 0a 20 20 20 20 53 5f  1_RESULT".    S_
148f0 4e 41 4d 45 5f 52 45 56 45 52 53 45 44 3d 22 24  NAME_REVERSED="$
14900 53 5f 4e 41 4d 45 5f 52 45 56 45 52 53 45 44 24  S_NAME_REVERSED$
14910 53 5f 30 22 0a 20 20 20 20 53 5f 30 3d 22 5f 69  S_0".    S_0="_i
14920 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47  $S_FUNC_MMMV_TIG
14930 45 52 48 41 53 48 5f 54 31 5f 52 45 53 55 4c 54  ERHASH_T1_RESULT
14940 22 0a 20 20 20 20 53 5f 4e 41 4d 45 5f 52 45 56  ".    S_NAME_REV
14950 45 52 53 45 44 3d 22 24 53 5f 4e 41 4d 45 5f 52  ERSED="$S_NAME_R
14960 45 56 45 52 53 45 44 24 53 5f 30 22 0a 20 20 20  EVERSED$S_0".   
14970 20 23 2d 2d 2d 2d 0a 20 20 20 20 53 5f 46 55 4e   #----.    S_FUN
14980 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45  C_MMMV_SILKTORRE
14990 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42  NT_PACKAGER_T1_B
149a0 41 53 48 5f 52 45 56 45 52 53 45 5f 53 54 52 49  ASH_REVERSE_STRI
149b0 4e 47 5f 52 45 47 49 53 54 45 52 3d 22 24 53 5f  NG_REGISTER="$S_
149c0 4e 41 4d 45 5f 52 45 56 45 52 53 45 44 22 0a 20  NAME_REVERSED". 
149d0 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c     func_mmmv_sil
149e0 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65  ktorrent_package
149f0 72 5f 74 31 5f 62 61 73 68 5f 72 65 76 65 72 73  r_t1_bash_revers
14a00 65 5f 73 74 72 69 6e 67 0a 20 20 20 20 53 5f 30  e_string.    S_0
14a10 3d 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53  ="$S_FUNC_MMMV_S
14a20 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41  ILKTORRENT_PACKA
14a30 47 45 52 5f 54 31 5f 42 41 53 48 5f 52 45 56 45  GER_T1_BASH_REVE
14a40 52 53 45 5f 53 54 52 49 4e 47 5f 52 45 47 49 53  RSE_STRING_REGIS
14a50 54 45 52 22 0a 20 20 20 20 53 5f 46 55 4e 43 5f  TER".    S_FUNC_
14a60 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54  MMMV_SILKTORRENT
14a70 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53  _PACKAGER_T1_BAS
14a80 48 5f 42 4c 4f 42 32 46 49 4c 45 4e 41 4d 45 5f  H_BLOB2FILENAME_
14a90 54 31 5f 52 45 53 55 4c 54 3d 22 24 53 5f 30 22  T1_RESULT="$S_0"
14aa0 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73  .} # func_mmmv_s
14ab0 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61  ilktorrent_packa
14ac0 67 65 72 5f 74 31 5f 62 61 73 68 5f 62 6c 6f 62  ger_t1_bash_blob
14ad0 32 66 69 6c 65 6e 61 6d 65 5f 74 31 0a 0a 0a 23  2filename_t1...#
14ae0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14af0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14b00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14b10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14b20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63  ----------..func
14b30 5f 6d 6d 6d 76 5f 64 65 6c 65 74 65 5f 74 6d 70  _mmmv_delete_tmp
14b40 5f 66 6f 6c 64 65 72 5f 74 31 28 29 7b 0a 20 20  _folder_t1(){.  
14b50 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 30 3d 22    local S_FP_0="
14b60 24 31 22 20 23 20 66 6f 6c 64 65 72 20 70 61 74  $1" # folder pat
14b70 68 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  h.    #--------.
14b80 20 20 20 20 69 66 20 5b 20 21 20 2d 65 20 22 24      if [ ! -e "$
14b90 53 5f 46 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a  S_FP_0" ]; then.
14ba0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
14bb0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
14bc0 69 73 20 73 63 72 69 70 74 20 69 73 20 66 6c 61  is script is fla
14bd0 77 65 64 2e 20 54 68 65 20 66 6f 6c 64 65 72 20  wed. The folder 
14be0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
14bf0 20 20 20 20 24 53 5f 46 50 5f 30 22 0a 20 20 20      $S_FP_0".   
14c00 20 20 20 20 20 65 63 68 6f 20 22 69 73 20 65 78       echo "is ex
14c10 70 65 63 74 65 64 20 74 6f 20 65 78 69 73 74 20  pected to exist 
14c20 64 75 72 69 6e 67 20 74 68 65 20 22 0a 20 20 20  during the ".   
14c30 20 20 20 20 20 65 63 68 6f 20 22 63 61 6c 6c 20       echo "call 
14c40 74 6f 20 74 68 69 73 20 66 75 6e 63 74 69 6f 6e  to this function
14c50 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
14c60 22 47 55 49 44 3d 3d 27 32 65 34 34 37 64 66 32  "GUID=='2e447df2
14c70 2d 35 33 32 31 2d 34 39 32 38 2d 62 37 33 66 2d  -5321-4928-b73f-
14c80 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20  21b170e031e7'". 
14c90 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
14ca0 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
14cb0 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
14cc0 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
14cd0 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
14ce0 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ror.    fi.    #
14cf0 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 54  --------.    # T
14d00 6f 20 61 76 6f 69 64 20 61 20 73 69 74 75 61 74  o avoid a situat
14d10 69 6f 6e 2c 20 77 68 65 72 65 20 64 75 65 20 74  ion, where due t
14d20 6f 20 73 6f 6d 65 20 0a 20 20 20 20 23 20 66 6c  o some .    # fl
14d30 61 77 20 74 68 65 20 68 6f 6d 65 20 66 6f 6c 64  aw the home fold
14d40 65 72 20 6f 72 20 73 6f 6d 65 74 68 69 6e 67 20  er or something 
14d50 65 6c 73 65 20 69 6d 70 6f 72 74 61 6e 74 20 0a  else important .
14d60 20 20 20 20 23 20 67 65 74 73 20 61 63 63 69 64      # gets accid
14d70 65 6e 74 61 6c 6c 79 20 72 65 63 75 72 73 69 76  entally recursiv
14d80 65 6c 79 20 64 65 6c 65 74 65 64 2c 20 0a 20 20  ely deleted, .  
14d90 20 20 23 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e    # the followin
14da0 67 20 74 65 73 74 20 74 72 61 6e 73 66 6f 72 6d  g test transform
14db0 73 20 74 68 65 20 70 61 74 68 20 66 72 6f 6d 20  s the path from 
14dc0 0a 20 20 20 20 23 20 2f 74 6d 70 2f 2e 2e 2f 68  .    # /tmp/../h
14dd0 6f 6d 65 2f 62 6c 61 62 6c 61 0a 20 20 20 20 23  ome/blabla.    #
14de0 20 74 6f 20 61 20 66 75 6c 6c 20 70 61 74 68 20   to a full path 
14df0 77 69 74 68 6f 75 74 20 74 68 65 20 64 6f 74 73  without the dots
14e00 20 61 6e 64 20 74 68 65 6e 20 73 74 75 64 69 65   and then studie
14e10 73 2c 20 77 68 65 74 68 65 72 0a 20 20 20 20 23  s, whether.    #
14e20 20 74 68 65 20 66 75 6c 6c 20 70 61 74 68 20 70   the full path p
14e30 6f 69 6e 74 73 20 74 6f 20 73 6f 6d 65 77 68 65  oints to somewhe
14e40 72 65 20 69 6e 20 74 68 65 20 2f 74 6d 70 0a 20  re in the /tmp. 
14e50 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 31 3d     local S_FP_1=
14e60 22 60 63 64 20 24 53 5f 46 50 5f 30 3b 20 70 77  "`cd $S_FP_0; pw
14e70 64 60 22 0a 20 20 20 20 69 66 20 5b 20 21 20 2d  d`".    if [ ! -
14e80 65 20 22 24 53 5f 46 50 5f 31 22 20 5d 3b 20 74  e "$S_FP_1" ]; t
14e90 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f  hen.        echo
14ea0 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
14eb0 20 22 54 68 69 73 20 73 63 72 69 70 74 20 69 73   "This script is
14ec0 20 66 6c 61 77 65 64 2e 20 54 68 65 20 66 6f 6c   flawed. The fol
14ed0 64 65 72 20 22 0a 20 20 20 20 20 20 20 20 65 63  der ".        ec
14ee0 68 6f 20 22 20 20 20 20 24 53 5f 46 50 5f 31 22  ho "    $S_FP_1"
14ef0 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69  .        echo "i
14f00 73 20 6d 69 73 73 69 6e 67 2e 22 0a 20 20 20 20  s missing.".    
14f10 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
14f20 27 36 61 61 62 31 64 31 30 2d 38 65 38 61 2d 34  '6aab1d10-8e8a-4
14f30 37 37 63 2d 62 32 33 66 2d 32 31 62 31 37 30 65  77c-b23f-21b170e
14f40 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
14f50 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
14f60 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64  #----.        cd
14f70 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20   $S_FP_ORIG.    
14f80 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
14f90 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
14fa0 20 66 69 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f   fi.    local S_
14fb0 54 4d 50 5f 30 3d 22 60 65 63 68 6f 20 5c 22 24  TMP_0="`echo \"$
14fc0 53 5f 46 50 5f 31 5c 22 20 7c 20 67 72 65 70 20  S_FP_1\" | grep 
14fd0 2d 45 20 5e 2f 68 6f 6d 65 20 60 22 0a 20 20 20  -E ^/home `".   
14fe0 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22   if [ "$S_TMP_0"
14ff0 20 21 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20   != "" ]; then. 
15000 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
15010 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 69         echo "Thi
15020 73 20 73 63 72 69 70 74 20 69 73 20 66 6c 61 77  s script is flaw
15030 65 64 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68  ed.".        ech
15040 6f 20 22 54 68 65 20 74 65 6d 70 6f 72 61 72 79  o "The temporary
15050 20 73 61 6e 64 62 6f 78 20 66 6f 6c 64 65 72 20   sandbox folder 
15060 6d 75 73 74 20 72 65 73 69 64 65 20 69 6e 20 2f  must reside in /
15070 74 6d 70 2e 22 0a 20 20 20 20 20 20 20 20 65 63  tmp.".        ec
15080 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
15090 68 6f 20 22 53 5f 46 50 5f 30 3d 3d 24 53 5f 46  ho "S_FP_0==$S_F
150a0 50 5f 30 22 0a 20 20 20 20 20 20 20 20 65 63 68  P_0".        ech
150b0 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
150c0 6f 20 22 53 5f 46 50 5f 31 3d 3d 24 53 5f 46 50  o "S_FP_1==$S_FP
150d0 5f 31 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  _1".        echo
150e0 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
150f0 20 22 53 5f 54 4d 50 5f 30 3d 3d 24 53 5f 54 4d   "S_TMP_0==$S_TM
15100 50 5f 30 22 0a 20 20 20 20 20 20 20 20 65 63 68  P_0".        ech
15110 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
15120 6f 20 22 47 55 49 44 3d 3d 27 65 31 30 35 30 64  o "GUID=='e1050d
15130 34 65 2d 33 34 66 64 2d 34 36 63 30 2d 62 34 32  4e-34fd-46c0-b42
15140 66 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22  f-21b170e031e7'"
15150 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
15160 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
15170 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
15180 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69  ORIG.        exi
15190 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
151a0 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20  error.    fi.   
151b0 20 23 20 4a 75 73 74 20 74 6f 20 62 65 20 73 75   # Just to be su
151c0 72 65 2c 20 74 68 65 20 73 61 6d 65 20 74 68 69  re, the same thi
151d0 6e 67 20 69 73 20 63 68 65 63 6b 65 64 20 62 79  ng is checked by
151e0 20 61 20 73 6c 69 67 68 74 6c 79 20 0a 20 20 20   a slightly .   
151f0 20 23 20 64 69 66 66 65 72 65 6e 74 20 72 65 67   # different reg
15200 65 78 20 61 6e 64 20 75 73 69 6e 67 20 74 68 65  ex and using the
15210 20 22 3d 3d 22 20 69 6e 20 73 74 65 61 64 20 6f   "==" in stead o
15220 66 20 74 68 65 20 22 21 3d 22 2e 0a 20 20 20 20  f the "!="..    
15230 53 5f 54 4d 50 5f 30 3d 22 60 65 63 68 6f 20 5c  S_TMP_0="`echo \
15240 22 24 53 5f 46 50 5f 31 5c 22 20 7c 20 67 72 65  "$S_FP_1\" | gre
15250 70 20 2d 45 20 5e 2f 74 6d 70 2f 60 22 20 0a 20  p -E ^/tmp/`" . 
15260 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f     if [ "$S_TMP_
15270 30 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e  0" == "" ]; then
15280 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
15290 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54  .        echo "T
152a0 68 69 73 20 73 63 72 69 70 74 20 69 73 20 66 6c  his script is fl
152b0 61 77 65 64 2e 22 0a 20 20 20 20 20 20 20 20 65  awed.".        e
152c0 63 68 6f 20 22 54 68 65 20 74 65 6d 70 6f 72 61  cho "The tempora
152d0 72 79 20 73 61 6e 64 62 6f 78 20 66 6f 6c 64 65  ry sandbox folde
152e0 72 20 6d 75 73 74 20 72 65 73 69 64 65 20 69 6e  r must reside in
152f0 20 2f 74 6d 70 2e 22 0a 20 20 20 20 20 20 20 20   /tmp.".        
15300 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
15310 65 63 68 6f 20 22 53 5f 46 50 5f 30 3d 3d 24 53  echo "S_FP_0==$S
15320 5f 46 50 5f 30 22 0a 20 20 20 20 20 20 20 20 65  _FP_0".        e
15330 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
15340 63 68 6f 20 22 53 5f 46 50 5f 31 3d 3d 24 53 5f  cho "S_FP_1==$S_
15350 46 50 5f 31 22 0a 20 20 20 20 20 20 20 20 65 63  FP_1".        ec
15360 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
15370 68 6f 20 22 53 5f 54 4d 50 5f 30 3d 3d 24 53 5f  ho "S_TMP_0==$S_
15380 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20 65  TMP_0".        e
15390 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
153a0 63 68 6f 20 22 47 55 49 44 3d 3d 27 35 62 31 33  cho "GUID=='5b13
153b0 36 32 37 31 2d 35 32 65 35 2d 34 63 33 30 2d 38  6271-52e5-4c30-8
153c0 31 32 66 2d 32 31 62 31 37 30 65 30 33 31 65 37  12f-21b170e031e7
153d0 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  '".        echo 
153e0 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  "".        #----
153f0 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
15400 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
15410 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
15420 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20  h error.    fi. 
15430 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
15440 20 72 6d 20 2d 66 72 20 24 53 5f 46 50 5f 31 0a   rm -fr $S_FP_1.
15450 20 20 20 20 69 66 20 5b 20 2d 65 20 22 24 53 5f      if [ -e "$S_
15460 46 50 5f 31 22 20 5d 3b 20 74 68 65 6e 0a 20 20  FP_1" ]; then.  
15470 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
15480 20 20 20 20 20 20 65 63 68 6f 20 22 53 6f 6d 65        echo "Some
15490 74 68 69 6e 67 20 77 65 6e 74 20 77 72 6f 6e 67  thing went wrong
154a0 2e 20 54 68 65 20 72 65 63 75 72 73 69 76 65 20  . The recursive 
154b0 64 65 6c 65 74 69 6f 6e 20 6f 66 20 74 68 65 20  deletion of the 
154c0 74 65 6d 70 6f 72 61 72 79 20 66 6f 6c 64 65 72  temporary folder
154d0 2c 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  , ".        echo
154e0 20 22 20 20 20 20 24 53 5f 46 50 5f 31 22 0a 20   "    $S_FP_1". 
154f0 20 20 20 20 20 20 20 65 63 68 6f 20 22 66 61 69         echo "fai
15500 6c 65 64 2e 22 0a 20 20 20 20 20 20 20 20 65 63  led.".        ec
15510 68 6f 20 22 47 55 49 44 3d 3d 27 34 30 66 30 34  ho "GUID=='40f04
15520 38 33 34 2d 64 66 35 61 2d 34 62 66 66 2d 38 32  834-df5a-4bff-82
15530 32 66 2d 32 31 62 31 37 30 65 30 33 31 65 37 27  2f-21b170e031e7'
15540 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
15550 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a  ".        #----.
15560 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50          cd $S_FP
15570 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78  _ORIG.        ex
15580 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
15590 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 7d 20   error.    fi.} 
155a0 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 64 65 6c 65  # func_mmmv_dele
155b0 74 65 5f 74 6d 70 5f 66 6f 6c 64 65 72 5f 74 31  te_tmp_folder_t1
155c0 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ...#------------
155d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
155e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
155f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15600 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
15610 23 20 54 68 72 6f 77 73 2c 20 69 66 20 74 68 65  # Throws, if the
15620 72 65 20 65 78 69 73 74 73 20 61 20 66 69 6c 65  re exists a file
15630 20 77 69 74 68 20 74 68 65 20 73 61 6d 65 20 70   with the same p
15640 61 74 68 2e 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 63  ath..func_mmmv_c
15650 72 65 61 74 65 5f 66 6f 6c 64 65 72 5f 69 66 5f  reate_folder_if_
15660 69 74 5f 64 6f 65 73 5f 6e 6f 74 5f 61 6c 72 65  it_does_not_alre
15670 61 64 79 5f 65 78 69 73 74 5f 74 31 28 29 7b 0a  ady_exist_t1(){.
15680 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 30      local S_FP_0
15690 3d 22 24 31 22 20 23 20 66 6f 6c 64 65 72 20 70  ="$1" # folder p
156a0 61 74 68 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  ath.    #-------
156b0 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46  -.    if [ "$S_F
156c0 50 5f 30 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68  P_0" == "" ]; th
156d0 65 6e 0a 20 20 20 20 20 20 20 20 23 20 55 73 69  en.        # Usi
156e0 6e 67 20 67 61 77 6b 20 61 6e 64 20 61 6c 69 6b  ng gawk and alik
156f0 65 20 74 6f 20 63 6f 76 65 72 20 61 6c 73 6f 20  e to cover also 
15700 63 61 73 65 73 2c 20 77 68 65 72 65 0a 20 20 20  cases, where.   
15710 20 20 20 20 20 23 20 24 53 5f 46 50 5f 30 3d 3d       # $S_FP_0==
15720 22 20 20 22 0a 20 20 20 20 20 20 20 20 23 20 69  "  ".        # i
15730 73 20 69 6e 74 65 6e 74 69 6f 6e 61 6c 6c 79 20  s intentionally 
15740 6c 65 66 74 20 6f 75 74 20 74 6f 20 61 76 6f 69  left out to avoi
15750 64 20 74 68 65 20 6f 76 65 72 68 65 61 64 2c 20  d the overhead, 
15760 62 75 74 0a 20 20 20 20 20 20 20 20 23 20 64 75  but.        # du
15770 65 20 74 6f 20 73 6f 6d 65 20 6c 75 63 6b 20 74  e to some luck t
15780 68 65 20 6d 6b 64 69 72 20 65 78 69 74 73 20 77  he mkdir exits w
15790 69 74 68 20 61 6e 20 65 72 72 6f 72 20 63 6f 64  ith an error cod
157a0 65 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 30  e greater than 0
157b0 2c 0a 20 20 20 20 20 20 20 20 23 20 69 66 20 69  ,.        # if i
157c0 74 20 6d 69 73 73 65 73 20 61 20 70 61 74 68 20  t misses a path 
157d0 61 72 67 75 6d 65 6e 74 2e 20 0a 20 20 20 20 20  argument. .     
157e0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
157f0 20 20 20 65 63 68 6f 20 22 53 5f 46 50 5f 30 3d     echo "S_FP_0=
15800 3d 5c 22 5c 22 22 0a 20 20 20 20 20 20 20 20 65  =\"\"".        e
15810 63 68 6f 20 22 47 55 49 44 3d 3d 27 31 31 30 63  cho "GUID=='110c
15820 36 30 31 32 2d 62 37 35 64 2d 34 63 32 33 2d 38  6012-b75d-4c23-8
15830 33 32 66 2d 32 31 62 31 37 30 65 30 33 31 65 37  32f-21b170e031e7
15840 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  '".        echo 
15850 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  "".        #----
15860 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
15870 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
15880 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
15890 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20  h error.    fi. 
158a0 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
158b0 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20  --------.    if 
158c0 5b 20 2d 65 20 22 24 53 5f 46 50 5f 30 22 20 5d  [ -e "$S_FP_0" ]
158d0 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 69  ; then.        i
158e0 66 20 5b 20 21 20 2d 64 20 22 24 53 5f 46 50 5f  f [ ! -d "$S_FP_
158f0 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
15900 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
15910 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
15920 22 54 68 65 20 70 61 74 68 20 74 68 61 74 20 69  "The path that i
15930 73 20 73 75 70 70 6f 73 65 20 74 6f 20 72 65 66  s suppose to ref
15940 65 72 65 6e 63 65 20 65 69 74 68 65 72 20 22 0a  erence either ".
15950 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
15960 20 22 61 6e 20 65 78 69 73 74 69 6e 67 20 66 6f   "an existing fo
15970 6c 64 65 72 20 6f 72 20 61 20 6e 6f 6e 2d 65 78  lder or a non-ex
15980 69 73 74 65 6e 74 20 66 6f 6c 64 65 72 2c 20 22  istent folder, "
15990 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
159a0 6f 20 22 72 65 66 65 72 65 6e 63 65 73 20 61 20  o "references a 
159b0 66 69 6c 65 2e 22 0a 20 20 20 20 20 20 20 20 20  file.".         
159c0 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
159d0 30 36 35 62 62 30 31 65 2d 63 37 37 63 2d 34 66  065bb01e-c77c-4f
159e0 36 37 2d 39 31 32 66 2d 32 31 62 31 37 30 65 30  67-912f-21b170e0
159f0 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 20  31e7'".         
15a00 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
15a10 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
15a20 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46           cd $S_F
15a30 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20  P_ORIG.         
15a40 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
15a50 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
15a60 20 20 20 20 66 69 0a 20 20 20 20 66 69 0a 20 20      fi.    fi.  
15a70 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
15a80 6d 6b 64 69 72 20 2d 70 20 24 53 5f 46 50 5f 30  mkdir -p $S_FP_0
15a90 0a 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21  .    if [ "$?" !
15aa0 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 20 0a 20  = "0" ]; then . 
15ab0 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
15ac0 20 20 20 20 20 20 20 65 63 68 6f 20 22 6d 6b 64         echo "mkd
15ad0 69 72 20 66 6f 72 20 70 61 74 68 20 22 0a 20 20  ir for path ".  
15ae0 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20        echo "    
15af0 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 20 20 20  $S_FP_0".       
15b00 20 65 63 68 6f 20 22 66 61 69 6c 65 64 2e 22 0a   echo "failed.".
15b10 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
15b20 49 44 3d 3d 27 31 31 65 61 39 34 62 34 2d 65 35  ID=='11ea94b4-e5
15b30 61 39 2d 34 38 39 31 2d 61 36 31 66 2d 32 31 62  a9-4891-a61f-21b
15b40 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  170e031e7'".    
15b50 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
15b60 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
15b70 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
15b80 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
15b90 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
15ba0 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
15bb0 2d 0a 20 20 20 20 69 66 20 5b 20 21 20 2d 65 20  -.    if [ ! -e 
15bc0 22 24 53 5f 46 50 5f 30 22 20 5d 3b 20 74 68 65  "$S_FP_0" ]; the
15bd0 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  n.        echo "
15be0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
15bf0 6d 6b 64 69 72 20 65 78 65 63 75 74 69 6f 6e 20  mkdir execution 
15c00 73 75 63 63 65 65 64 65 64 2c 20 62 75 74 20 66  succeeded, but f
15c10 6f 72 20 73 6f 6d 65 20 6f 74 68 65 72 20 72 65  or some other re
15c20 61 73 6f 6e 20 74 68 65 20 66 6f 6c 64 65 72 20  ason the folder 
15c30 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
15c40 20 20 20 20 24 53 5f 46 50 5f 30 22 0a 20 20 20      $S_FP_0".   
15c50 20 20 20 20 20 65 63 68 6f 20 22 64 6f 65 73 20       echo "does 
15c60 6e 6f 74 20 65 78 69 73 74 2e 22 0a 20 20 20 20  not exist.".    
15c70 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
15c80 27 39 61 65 37 39 65 31 30 2d 65 61 61 65 2d 34  '9ae79e10-eaae-4
15c90 32 33 33 2d 39 35 31 66 2d 32 31 62 31 37 30 65  233-951f-21b170e
15ca0 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
15cb0 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
15cc0 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64  #----.        cd
15cd0 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20   $S_FP_ORIG.    
15ce0 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
15cf0 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
15d00 20 66 69 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d   fi.} # func_mmm
15d10 76 5f 63 72 65 61 74 65 5f 66 6f 6c 64 65 72 5f  v_create_folder_
15d20 69 66 5f 69 74 5f 64 6f 65 73 5f 6e 6f 74 5f 61  if_it_does_not_a
15d30 6c 72 65 61 64 79 5f 65 78 69 73 74 5f 74 31 0a  lready_exist_t1.
15d40 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
15d50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15d60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15d70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15d80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53  -------------..S
15d90 5f 46 55 4e 43 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  _FUNC_FUNC_MMMV_
15da0 43 52 45 41 54 45 5f 54 4d 50 5f 46 4f 4c 44 45  CREATE_TMP_FOLDE
15db0 52 5f 54 31 5f 52 45 53 55 4c 54 3d 22 22 20 23  R_T1_RESULT="" #
15dc0 20 3d 3d 20 22 22 20 6f 6e 20 66 61 69 6c 75 72   == "" on failur
15dd0 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  e.              
15de0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
15df0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
15e00 20 20 23 20 6f 74 68 65 72 77 69 73 65 20 66 75    # otherwise fu
15e10 6c 6c 20 66 69 6c 65 20 70 61 74 68 0a 66 75 6e  ll file path.fun
15e20 63 5f 6d 6d 6d 76 5f 63 72 65 61 74 65 5f 74 6d  c_mmmv_create_tm
15e30 70 5f 66 6f 6c 64 65 72 5f 74 31 28 29 7b 0a 20  p_folder_t1(){. 
15e40 20 20 20 23 20 44 6f 65 73 20 6e 6f 74 20 74 61     # Does not ta
15e50 6b 65 20 61 6e 79 20 61 72 67 75 6d 65 6e 74 73  ke any arguments
15e60 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  ..    #--------.
15e70 20 20 20 20 23 66 75 6e 63 5f 6d 6d 6d 76 5f 65      #func_mmmv_e
15e80 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69 6f 6e  xc_hash_function
15e90 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63 61 74  _input_verificat
15ea0 69 6f 6e 5f 74 31 20 22 66 75 6e 63 5f 6d 6d 6d  ion_t1 "func_mmm
15eb0 76 5f 47 55 49 44 5f 74 31 22 20 22 24 31 22 0a  v_GUID_t1" "$1".
15ec0 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
15ed0 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f  ---------.    S_
15ee0 46 55 4e 43 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 43  FUNC_FUNC_MMMV_C
15ef0 52 45 41 54 45 5f 54 4d 50 5f 46 4f 4c 44 45 52  REATE_TMP_FOLDER
15f00 5f 54 31 5f 52 45 53 55 4c 54 3d 22 22 20 23 20  _T1_RESULT="" # 
15f10 76 61 6c 75 65 20 66 6f 72 20 66 61 69 6c 75 72  value for failur
15f20 65 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f  e.    func_mmmv_
15f30 47 55 49 44 5f 74 31 0a 20 20 20 20 69 66 20 5b  GUID_t1.    if [
15f40 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47   "$S_FUNC_MMMV_G
15f50 55 49 44 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d  UID_T1_RESULT" =
15f60 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  = "" ]; then.   
15f70 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
15f80 20 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20       echo "This 
15f90 73 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64  script is flawed
15fa0 2e 20 47 55 49 44 20 67 65 6e 65 72 61 74 69 6f  . GUID generatio
15fb0 6e 20 66 61 69 6c 65 64 20 61 6e 64 20 22 0a 20  n failed and ". 
15fc0 20 20 20 20 20 20 20 65 63 68 6f 20 22 74 68 65         echo "the
15fd0 20 47 55 49 44 20 67 65 6e 65 72 61 74 69 6f 6e   GUID generation
15fe0 20 66 75 6e 63 74 69 6f 6e 20 64 69 64 20 6e 6f   function did no
15ff0 74 20 74 68 72 6f 77 20 64 65 73 70 69 74 65 20  t throw despite 
16000 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
16010 74 68 65 20 66 61 63 74 20 74 68 61 74 20 69 74  the fact that it
16020 20 73 68 6f 75 6c 64 20 68 61 76 65 20 64 65 74   should have det
16030 65 63 74 65 64 20 69 74 73 20 6f 77 6e 20 66 61  ected its own fa
16040 69 6c 75 72 65 2e 22 0a 20 20 20 20 20 20 20 20  ilure.".        
16050 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 39 36 36  echo "GUID=='966
16060 34 62 33 33 63 2d 37 31 32 33 2d 34 38 32 62 2d  4b33c-7123-482b-
16070 62 31 31 66 2d 32 31 62 31 37 30 65 30 33 31 65  b11f-21b170e031e
16080 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
16090 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
160a0 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
160b0 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
160c0 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
160d0 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
160e0 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 6c 6f      #----.    lo
160f0 63 61 6c 20 53 5f 54 4d 50 5f 30 3d 22 2f 74 6d  cal S_TMP_0="/tm
16100 70 2f 74 6d 70 5f 73 69 6c 6b 74 6f 72 72 65 6e  p/tmp_silktorren
16110 74 5f 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47  t_$S_FUNC_MMMV_G
16120 55 49 44 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20  UID_T1_RESULT". 
16130 20 20 20 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69     # The followi
16140 6e 67 20 66 65 77 20 69 66 2d 63 6c 61 75 73 65  ng few if-clause
16150 73 20 66 6f 72 6d 20 61 20 73 68 6f 72 74 20 75  s form a short u
16160 6e 72 6f 6c 6c 65 64 20 6c 6f 6f 70 2e 20 54 68  nrolled loop. Th
16170 65 20 75 6e 72 6f 6c 6c 69 6e 67 20 0a 20 20 20  e unrolling .   
16180 20 23 20 69 73 20 66 6f 72 20 73 69 6d 70 6c 69   # is for simpli
16190 63 69 74 79 2c 20 62 65 63 61 75 73 65 20 69 74  city, because it
161a0 20 69 73 20 42 61 73 68 2c 20 77 68 65 72 65 20   is Bash, where 
161b0 6c 6f 6f 70 73 20 61 72 65 20 6e 61 73 74 79 2e  loops are nasty.
161c0 0a 20 20 20 20 69 66 20 5b 20 2d 65 20 22 24 53  .    if [ -e "$S
161d0 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a  _TMP_0" ]; then.
161e0 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d 6d          func_mmm
161f0 76 5f 47 55 49 44 5f 74 31 0a 20 20 20 20 20 20  v_GUID_t1.      
16200 20 20 53 5f 54 4d 50 5f 30 3d 22 2f 74 6d 70 2f    S_TMP_0="/tmp/
16210 74 6d 70 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f  tmp_silktorrent_
16220 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49  $S_FUNC_MMMV_GUI
16230 44 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20 20 20  D_T1_RESULT".   
16240 20 66 69 0a 20 20 20 20 69 66 20 5b 20 2d 65 20   fi.    if [ -e 
16250 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68  "$S_TMP_0" ]; th
16260 65 6e 0a 20 20 20 20 20 20 20 20 66 75 6e 63 5f  en.        func_
16270 6d 6d 6d 76 5f 47 55 49 44 5f 74 31 0a 20 20 20  mmmv_GUID_t1.   
16280 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 2f 74       S_TMP_0="/t
16290 6d 70 2f 74 6d 70 5f 73 69 6c 6b 74 6f 72 72 65  mp/tmp_silktorre
162a0 6e 74 5f 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  nt_$S_FUNC_MMMV_
162b0 47 55 49 44 5f 54 31 5f 52 45 53 55 4c 54 22 0a  GUID_T1_RESULT".
162c0 20 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20      fi.    if [ 
162d0 2d 65 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b  -e "$S_TMP_0" ];
162e0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 66 75   then.        fu
162f0 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74 31 0a  nc_mmmv_GUID_t1.
16300 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d          S_TMP_0=
16310 22 2f 74 6d 70 2f 74 6d 70 5f 73 69 6c 6b 74 6f  "/tmp/tmp_silkto
16320 72 72 65 6e 74 5f 24 53 5f 46 55 4e 43 5f 4d 4d  rrent_$S_FUNC_MM
16330 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45 53 55 4c  MV_GUID_T1_RESUL
16340 54 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66  T".    fi.    if
16350 20 5b 20 2d 65 20 22 24 53 5f 54 4d 50 5f 30 22   [ -e "$S_TMP_0"
16360 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
16370 20 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f   func_mmmv_GUID_
16380 74 31 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50  t1.        S_TMP
16390 5f 30 3d 22 2f 74 6d 70 2f 74 6d 70 5f 73 69 6c  _0="/tmp/tmp_sil
163a0 6b 74 6f 72 72 65 6e 74 5f 24 53 5f 46 55 4e 43  ktorrent_$S_FUNC
163b0 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45  _MMMV_GUID_T1_RE
163c0 53 55 4c 54 22 0a 20 20 20 20 66 69 0a 20 20 20  SULT".    fi.   
163d0 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20   #----.    if [ 
163e0 2d 65 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b  -e "$S_TMP_0" ];
163f0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
16400 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
16410 68 6f 20 22 54 68 69 73 20 73 63 72 69 70 74 20  ho "This script 
16420 66 61 69 6c 65 64 20 74 6f 20 67 65 6e 65 72 61  failed to genera
16430 74 65 20 61 20 6c 6f 63 61 6c 6c 79 20 75 6e 69  te a locally uni
16440 71 75 65 20 70 61 74 68 2e 22 0a 20 20 20 20 20  que path.".     
16450 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
16460 32 30 33 35 33 66 66 31 2d 61 63 37 64 2d 34 30  20353ff1-ac7d-40
16470 62 65 2d 62 31 31 66 2d 32 31 62 31 37 30 65 30  be-b11f-21b170e0
16480 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
16490 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
164a0 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
164b0 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
164c0 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
164d0 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
164e0 66 69 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  fi.    func_mmmv
164f0 5f 63 72 65 61 74 65 5f 66 6f 6c 64 65 72 5f 69  _create_folder_i
16500 66 5f 69 74 5f 64 6f 65 73 5f 6e 6f 74 5f 61 6c  f_it_does_not_al
16510 72 65 61 64 79 5f 65 78 69 73 74 5f 74 31 20 22  ready_exist_t1 "
16520 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 69 66  $S_TMP_0".    if
16530 20 5b 20 21 20 2d 65 20 22 24 53 5f 54 4d 50 5f   [ ! -e "$S_TMP_
16540 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
16550 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
16560 20 20 20 65 63 68 6f 20 22 6d 6b 64 69 72 20 66     echo "mkdir f
16570 6f 72 20 70 61 74 68 20 22 0a 20 20 20 20 20 20  or path ".      
16580 20 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 54    echo "    $S_T
16590 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20 65 63  MP_0".        ec
165a0 68 6f 20 22 66 61 69 6c 65 64 2e 22 0a 20 20 20  ho "failed.".   
165b0 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
165c0 3d 27 33 31 36 61 32 61 36 31 2d 33 32 65 32 2d  ='316a2a61-32e2-
165d0 34 61 30 65 2d 38 31 31 66 2d 32 31 62 31 37 30  4a0e-811f-21b170
165e0 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
165f0 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
16600 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63   #----.        c
16610 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
16620 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
16630 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
16640 20 20 66 69 0a 20 20 20 20 53 5f 46 55 4e 43 5f    fi.    S_FUNC_
16650 46 55 4e 43 5f 4d 4d 4d 56 5f 43 52 45 41 54 45  FUNC_MMMV_CREATE
16660 5f 54 4d 50 5f 46 4f 4c 44 45 52 5f 54 31 5f 52  _TMP_FOLDER_T1_R
16670 45 53 55 4c 54 3d 22 24 53 5f 54 4d 50 5f 30 22  ESULT="$S_TMP_0"
16680 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 63  .} # func_mmmv_c
16690 72 65 61 74 65 5f 74 6d 70 5f 66 6f 6c 64 65 72  reate_tmp_folder
166a0 5f 74 31 20 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  _t1 ...#--------
166b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
166c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
166d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
166e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
166f0 2d 2d 0a 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  --..S_FUNC_MMMV_
16700 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
16710 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 47 45 54  AGER_T1_BASH_GET
16720 5f 50 41 43 4b 45 54 5f 46 4f 52 4d 41 54 5f 56  _PACKET_FORMAT_V
16730 45 52 53 49 4f 4e 5f 54 31 5f 52 45 53 55 4c 54  ERSION_T1_RESULT
16740 3d 22 6e 6f 74 20 73 65 74 22 0a 66 75 6e 63 5f  ="not set".func_
16750 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74  mmmv_silktorrent
16760 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73  _packager_t1_bas
16770 68 5f 67 65 74 5f 70 61 63 6b 65 74 5f 66 6f 72  h_get_packet_for
16780 6d 61 74 5f 76 65 72 73 69 6f 6e 5f 74 31 28 29  mat_version_t1()
16790 20 7b 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f   { .    local S_
167a0 46 50 5f 30 3d 22 24 31 22 20 23 20 50 61 74 68  FP_0="$1" # Path
167b0 20 74 6f 20 74 68 65 20 66 69 6c 65 2e 20 0a 20   to the file. . 
167c0 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 23 20 49     #----.    # I
167d0 74 27 73 20 6e 6f 74 20 6e 65 63 65 73 73 61 72  t's not necessar
167e0 79 20 66 6f 72 20 74 68 65 20 66 69 6c 65 20 74  y for the file t
167f0 6f 20 61 63 74 75 61 6c 6c 79 20 65 78 69 73 74  o actually exist
16800 2c 0a 20 20 20 20 23 20 62 65 63 61 75 73 65 20  ,.    # because 
16810 74 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 6f 6e  this function on
16820 6c 79 20 61 6e 61 6c 79 7a 65 73 20 74 68 65 20  ly analyzes the 
16830 66 69 6c 65 20 70 61 74 68 20 73 74 72 69 6e 67  file path string
16840 2e 0a 20 20 20 20 23 20 66 75 6e 63 5f 6d 6d 6d  ..    # func_mmm
16850 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61  v_silktorrent_pa
16860 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 65  ckager_t1_bash_e
16870 78 63 5f 61 73 73 65 72 74 5f 77 72 61 70 70 61  xc_assert_wrappa
16880 62 6c 65 5f 66 69 6c 65 5f 65 78 69 73 74 73 5f  ble_file_exists_
16890 74 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20  t1 "$S_FP_0".   
168a0 20 69 66 20 5b 20 22 24 53 5f 46 50 5f 30 22 20   if [ "$S_FP_0" 
168b0 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20  == "" ]; then.  
168c0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
168d0 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
168e0 66 69 6c 65 20 70 61 74 68 20 63 61 6e 64 69 64  file path candid
168f0 61 74 65 20 6d 75 73 74 20 6e 6f 74 20 62 65 20  ate must not be 
16900 61 6e 20 65 6d 70 74 79 20 73 74 72 69 6e 67 2e  an empty string.
16910 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
16920 47 55 49 44 3d 3d 27 32 31 65 30 30 65 33 39 2d  GUID=='21e00e39-
16930 37 62 64 31 2d 34 35 39 35 2d 39 31 30 66 2d 32  7bd1-4595-910f-2
16940 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20  1b170e031e7'".  
16950 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
16960 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
16970 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
16980 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31  G.        exit 1
16990 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
169a0 6f 72 0a 20 20 20 20 66 69 20 0a 20 20 20 20 23  or.    fi .    #
169b0 2d 2d 2d 2d 0a 20 20 20 20 23 20 54 68 65 20 0a  ----.    # The .
169c0 20 20 20 20 23 0a 20 20 20 20 23 20 20 20 20 20      #.    #     
169d0 62 61 73 65 6e 61 6d 65 20 2f 74 6d 70 2f 66 6f  basename /tmp/fo
169e0 6f 2f 0a 20 20 20 20 23 0a 20 20 20 20 23 20 72  o/.    #.    # r
169f0 65 74 75 72 6e 73 0a 20 20 20 20 23 0a 20 20 20  eturns.    #.   
16a00 20 23 20 20 20 20 20 66 6f 6f 0a 20 20 20 20 23   #     foo.    #
16a10 0a 20 20 20 20 23 20 54 68 61 74 20 69 73 20 74  .    # That is t
16a20 6f 20 73 61 79 2c 20 74 68 65 20 22 62 61 73 65  o say, the "base
16a30 6e 61 6d 65 22 20 69 67 6e 6f 72 65 73 20 74 68  name" ignores th
16a40 65 20 72 69 67 68 74 6d 6f 73 74 20 73 6c 61 73  e rightmost slas
16a50 68 2e 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20  h..    #----.   
16a60 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 30 3d 22   local S_TMP_0="
16a70 60 72 75 62 79 20 2d 65 20 5c 22 5c 0a 20 20 20  `ruby -e \"\.   
16a80 20 20 20 20 20 73 3d 27 6e 6f 73 6c 61 73 68 27       s='noslash'
16a90 3b 5c 0a 20 20 20 20 20 20 20 20 69 66 28 28 27  ;\.        if(('
16aa0 24 53 5f 46 50 5f 30 27 2e 72 65 76 65 72 73 65  $S_FP_0'.reverse
16ab0 29 5b 30 2e 2e 30 5d 3d 3d 27 2f 27 29 20 74 68  )[0..0]=='/') th
16ac0 65 6e 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20  en \.           
16ad0 20 73 3d 27 73 6c 61 73 68 5f 70 72 65 73 65 6e   s='slash_presen
16ae0 74 27 3b 5c 0a 20 20 20 20 20 20 20 20 65 6e 64  t';\.        end
16af0 3b 5c 0a 20 20 20 20 20 20 20 20 70 75 74 73 28  ;\.        puts(
16b00 73 29 3b 5c 0a 20 20 20 20 20 20 20 20 5c 22 60  s);\.        \"`
16b10 22 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 54  ".    if [ "$S_T
16b20 4d 50 5f 30 22 20 21 3d 20 22 6e 6f 73 6c 61 73  MP_0" != "noslas
16b30 68 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  h" ]; then.     
16b40 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
16b50 20 20 20 65 63 68 6f 20 22 54 68 65 20 70 61 74     echo "The pat
16b60 68 20 63 61 6e 64 69 64 61 74 65 20 6d 75 73 74  h candidate must
16b70 20 6e 6f 74 20 65 6e 64 20 77 69 74 68 20 61 20   not end with a 
16b80 73 6c 61 73 68 2e 22 0a 20 20 20 20 20 20 20 20  slash.".        
16b90 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
16ba0 65 63 68 6f 20 22 20 20 20 20 53 5f 46 50 5f 30  echo "    S_FP_0
16bb0 3d 3d 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 20  ==$S_FP_0".     
16bc0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
16bd0 20 20 20 65 63 68 6f 20 22 20 20 20 20 53 5f 54     echo "    S_T
16be0 4d 50 5f 30 3d 3d 24 53 5f 54 4d 50 5f 30 22 0a  MP_0==$S_TMP_0".
16bf0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
16c00 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
16c10 49 44 3d 3d 27 62 35 31 31 61 61 66 63 2d 37 64  ID=='b511aafc-7d
16c20 32 65 2d 34 66 31 37 2d 62 35 30 66 2d 32 31 62  2e-4f17-b50f-21b
16c30 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  170e031e7'".    
16c40 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
16c50 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
16c60 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
16c70 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
16c80 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
16c90 0a 20 20 20 20 66 69 0a 20 20 20 20 62 61 73 65  .    fi.    base
16ca0 6e 61 6d 65 20 24 53 5f 46 50 5f 30 20 31 3e 2f  name $S_FP_0 1>/
16cb0 64 65 76 2f 6e 75 6c 6c 20 23 20 74 6f 20 73 65  dev/null # to se
16cc0 74 20 61 20 76 61 6c 75 65 20 74 6f 20 74 68 65  t a value to the
16cd0 20 24 3f 20 69 6e 20 74 68 69 73 20 73 63 6f 70   $? in this scop
16ce0 65 20 0a 20 20 20 20 69 66 20 5b 20 22 24 3f 22  e .    if [ "$?"
16cf0 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a   != "0" ]; then.
16d00 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
16d10 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
16d20 65 20 63 6f 6d 6d 61 6e 64 20 22 0a 20 20 20 20  e command ".    
16d30 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
16d40 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 62 61      echo "    ba
16d50 73 65 6e 61 6d 65 20 24 53 5f 46 50 5f 30 20 22  sename $S_FP_0 "
16d60 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
16d70 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 65  .        echo "e
16d80 78 69 74 65 64 20 77 69 74 68 20 61 6e 20 65 72  xited with an er
16d90 72 6f 72 2e 22 0a 20 20 20 20 20 20 20 20 65 63  ror.".        ec
16da0 68 6f 20 22 47 55 49 44 3d 3d 27 64 35 38 63 65  ho "GUID=='d58ce
16db0 38 61 35 2d 36 35 63 35 2d 34 64 34 33 2d 39 35  8a5-65c5-4d43-95
16dc0 30 66 2d 32 31 62 31 37 30 65 30 33 31 65 37 27  0f-21b170e031e7'
16dd0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
16de0 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a  ".        #----.
16df0 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50          cd $S_FP
16e00 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78  _ORIG.        ex
16e10 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
16e20 20 65 72 72 6f 72 0a 20 20 20 20 66 69 20 0a 20   error.    fi . 
16e30 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 62 61 73     S_TMP_0="`bas
16e40 65 6e 61 6d 65 20 24 53 5f 46 50 5f 30 60 22 0a  ename $S_FP_0`".
16e50 20 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50      if [ "$S_TMP
16e60 5f 30 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65  _0" == "" ]; the
16e70 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  n.        echo "
16e80 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
16e90 54 68 65 20 66 69 6c 65 20 70 61 74 68 20 63 61  The file path ca
16ea0 6e 64 69 64 61 74 65 20 6d 75 73 74 20 62 65 20  ndidate must be 
16eb0 61 20 73 74 72 69 6e 67 20 74 68 61 74 20 22 0a  a string that ".
16ec0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69 73          echo "is
16ed0 20 6e 6f 74 20 61 6e 20 65 6d 70 74 79 20 73 74   not an empty st
16ee0 72 69 6e 67 20 61 66 74 65 72 20 22 0a 20 20 20  ring after ".   
16ef0 20 20 20 20 20 65 63 68 6f 20 22 61 6c 6c 20 6f       echo "all o
16f00 66 20 74 68 65 20 73 70 61 63 65 73 20 61 6e 64  f the spaces and
16f10 20 74 61 62 73 20 68 61 76 65 20 62 65 65 6e 20   tabs have been 
16f20 72 65 6d 6f 76 65 64 20 66 72 6f 6d 20 69 74 2e  removed from it.
16f30 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
16f40 47 55 49 44 3d 3d 27 64 30 61 64 38 35 32 63 2d  GUID=='d0ad852c-
16f50 33 39 66 39 2d 34 39 64 36 2d 39 31 30 66 2d 32  39f9-49d6-910f-2
16f60 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20  1b170e031e7'".  
16f70 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
16f80 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
16f90 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
16fa0 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31  G.        exit 1
16fb0 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
16fc0 6f 72 0a 20 20 20 20 66 69 20 0a 20 20 20 20 23  or.    fi .    #
16fd0 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 46  --------.    S_F
16fe0 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52  UNC_MMMV_SILKTOR
16ff0 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31  RENT_PACKAGER_T1
17000 5f 42 41 53 48 5f 47 45 54 5f 50 41 43 4b 45 54  _BASH_GET_PACKET
17010 5f 46 4f 52 4d 41 54 5f 56 45 52 53 49 4f 4e 5f  _FORMAT_VERSION_
17020 54 31 5f 52 45 53 55 4c 54 3d 22 22 0a 20 20 20  T1_RESULT="".   
17030 20 6c 6f 63 61 6c 20 53 5f 4f 55 54 3d 22 75 6e   local S_OUT="un
17040 73 75 70 70 6f 72 74 65 64 5f 62 79 5f 74 68 69  supported_by_thi
17050 73 5f 73 63 72 69 70 74 5f 76 65 72 73 69 6f 6e  s_script_version
17060 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  ".    #--------.
17070 20 20 20 20 23 20 49 6e 20 52 75 62 79 0a 20 20      # In Ruby.  
17080 20 20 23 20 20 20 20 20 22 66 6f 6f 2e 73 74 62    #     "foo.stb
17090 6c 6f 62 22 5b 30 2e 2e 28 2d 38 29 5d 3d 3d 22  lob"[0..(-8)]=="
170a0 66 6f 6f 22 0a 20 20 20 20 23 20 20 20 20 20 22  foo".    #     "
170b0 66 6f 6f 2e 73 74 62 6c 6f 62 22 5b 28 2d 39 39  foo.stblob"[(-99
170c0 29 2e 2e 28 2d 31 29 5d 3d 3d 6e 69 6c 0a 20 20  )..(-1)]==nil.  
170d0 20 20 23 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53    # .    local S
170e0 5f 54 4d 50 5f 31 3d 22 60 72 75 62 79 20 2d 65  _TMP_1="`ruby -e
170f0 20 5c 22 5c 0a 20 20 20 20 20 20 20 20 78 3d 27   \"\.        x='
17100 24 53 5f 54 4d 50 5f 30 27 5b 30 2e 2e 28 2d 38  $S_TMP_0'[0..(-8
17110 29 5d 3b 5c 0a 20 20 20 20 20 20 20 20 69 66 28  )];\.        if(
17120 78 21 3d 6e 69 6c 29 20 74 68 65 6e 5c 0a 20 20  x!=nil) then\.  
17130 20 20 20 20 20 20 20 20 20 20 6d 64 3d 78 2e 72            md=x.r
17140 65 76 65 72 73 65 2e 6d 61 74 63 68 28 2f 76 5b  everse.match(/v[
17150 5c 5c 64 5d 2b 2f 29 3b 5c 0a 20 20 20 20 20 20  \\d]+/);\.      
17160 20 20 20 20 20 20 69 66 28 6d 64 21 3d 6e 69 6c        if(md!=nil
17170 29 20 74 68 65 6e 5c 0a 20 20 20 20 20 20 20 20  ) then\.        
17180 20 20 20 20 20 20 20 20 73 5f 30 3d 28 6d 64 5b          s_0=(md[
17190 30 5d 2e 74 6f 5f 73 29 5b 31 2e 2e 28 2d 31 29  0].to_s)[1..(-1)
171a0 5d 3b 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20  ];\.            
171b0 20 20 20 20 70 72 69 6e 74 28 73 5f 30 2e 73 75      print(s_0.su
171c0 62 28 2f 5e 5b 30 5d 2b 2f 2c 27 27 29 29 3b 5c  b(/^[0]+/,''));\
171d0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6e 64  .            end
171e0 3b 5c 0a 20 20 20 20 20 20 20 20 65 6e 64 3b 5c  ;\.        end;\
171f0 0a 20 20 20 20 20 20 20 20 5c 22 60 22 0a 20 20  .        \"`".  
17200 20 20 23 20 65 63 68 6f 20 22 24 53 5f 54 4d 50    # echo "$S_TMP
17210 5f 30 22 0a 20 20 20 20 23 20 65 63 68 6f 20 22  _0".    # echo "
17220 24 53 5f 54 4d 50 5f 31 22 0a 20 20 20 20 23 2d  $S_TMP_1".    #-
17230 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ---.    if [ "$S
17240 5f 54 4d 50 5f 31 22 20 21 3d 20 22 22 20 5d 3b  _TMP_1" != "" ];
17250 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f   then.        S_
17260 4f 55 54 3d 22 73 69 6c 6b 74 6f 72 72 65 6e 74  OUT="silktorrent
17270 5f 70 61 63 6b 65 74 5f 66 6f 72 6d 61 74 5f 76  _packet_format_v
17280 65 72 73 69 6f 6e 5f 24 53 5f 54 4d 50 5f 31 22  ersion_$S_TMP_1"
17290 0a 20 20 20 20 66 69 20 0a 20 20 20 20 53 5f 46  .    fi .    S_F
172a0 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52  UNC_MMMV_SILKTOR
172b0 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31  RENT_PACKAGER_T1
172c0 5f 42 41 53 48 5f 47 45 54 5f 50 41 43 4b 45 54  _BASH_GET_PACKET
172d0 5f 46 4f 52 4d 41 54 5f 56 45 52 53 49 4f 4e 5f  _FORMAT_VERSION_
172e0 54 31 5f 52 45 53 55 4c 54 3d 22 24 53 5f 4f 55  T1_RESULT="$S_OU
172f0 54 22 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76  T".} # func_mmmv
17300 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  _silktorrent_pac
17310 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 67 65  kager_t1_bash_ge
17320 74 5f 70 61 63 6b 65 74 5f 66 6f 72 6d 61 74 5f  t_packet_format_
17330 76 65 72 73 69 6f 6e 5f 74 31 0a 0a 0a 23 2d 2d  version_t1...#--
17340 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17350 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17360 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17370 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17380 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55 4e 43  --------..S_FUNC
17390 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e  _MMMV_SILKTORREN
173a0 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41  T_PACKAGER_T1_BA
173b0 53 48 5f 56 45 52 49 46 59 5f 46 49 4c 45 5f 4e  SH_VERIFY_FILE_N
173c0 41 4d 45 5f 54 31 5f 52 45 53 55 4c 54 3d 22 6e  AME_T1_RESULT="n
173d0 6f 74 20 73 65 74 22 0a 66 75 6e 63 5f 6d 6d 6d  ot set".func_mmm
173e0 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61  v_silktorrent_pa
173f0 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 76  ckager_t1_bash_v
17400 65 72 69 66 79 5f 66 69 6c 65 5f 6e 61 6d 65 5f  erify_file_name_
17410 74 31 28 29 20 7b 20 0a 20 20 20 20 6c 6f 63 61  t1() { .    loca
17420 6c 20 53 5f 46 50 5f 30 3d 22 24 31 22 20 23 20  l S_FP_0="$1" # 
17430 50 61 74 68 20 74 6f 20 74 68 65 20 66 69 6c 65  Path to the file
17440 2e 20 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20  . .    #----.   
17450 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74   func_mmmv_silkt
17460 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f  orrent_packager_
17470 74 31 5f 62 61 73 68 5f 65 78 63 5f 61 73 73 65  t1_bash_exc_asse
17480 72 74 5f 77 72 61 70 70 61 62 6c 65 5f 66 69 6c  rt_wrappable_fil
17490 65 5f 65 78 69 73 74 73 5f 74 31 20 22 24 53 5f  e_exists_t1 "$S_
174a0 46 50 5f 30 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d  FP_0".    #-----
174b0 2d 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d  ---.    func_mmm
174c0 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61  v_silktorrent_pa
174d0 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 67  ckager_t1_bash_g
174e0 65 74 5f 70 61 63 6b 65 74 5f 66 6f 72 6d 61 74  et_packet_format
174f0 5f 76 65 72 73 69 6f 6e 5f 74 31 20 22 24 53 5f  _version_t1 "$S_
17500 46 50 5f 30 22 0a 20 20 20 20 6c 6f 63 61 6c 20  FP_0".    local 
17510 53 5f 50 41 43 4b 45 54 5f 46 4f 52 4d 41 54 3d  S_PACKET_FORMAT=
17520 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49  "$S_FUNC_MMMV_SI
17530 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47  LKTORRENT_PACKAG
17540 45 52 5f 54 31 5f 42 41 53 48 5f 47 45 54 5f 50  ER_T1_BASH_GET_P
17550 41 43 4b 45 54 5f 46 4f 52 4d 41 54 5f 56 45 52  ACKET_FORMAT_VER
17560 53 49 4f 4e 5f 54 31 5f 52 45 53 55 4c 54 22 0a  SION_T1_RESULT".
17570 20 20 20 20 69 66 20 5b 20 22 24 53 5f 50 41 43      if [ "$S_PAC
17580 4b 45 54 5f 46 4f 52 4d 41 54 22 20 3d 3d 20 22  KET_FORMAT" == "
17590 75 6e 73 75 70 70 6f 72 74 65 64 5f 62 79 5f 74  unsupported_by_t
175a0 68 69 73 5f 73 63 72 69 70 74 5f 76 65 72 73 69  his_script_versi
175b0 6f 6e 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  on" ]; then.    
175c0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
175d0 20 20 20 20 65 63 68 6f 20 22 54 68 65 72 65 20      echo "There 
175e0 65 78 69 73 74 73 20 61 20 70 6f 73 73 69 62 69  exists a possibi
175f0 6c 69 74 79 20 74 68 61 74 20 74 68 65 20 22 0a  lity that the ".
17600 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 53 69          echo "Si
17610 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63 6b 65 74  lktorrent packet
17620 20 63 61 6e 64 69 64 61 74 65 20 69 73 20 61 63   candidate is ac
17630 74 75 61 6c 6c 79 20 4f 4b 2c 20 62 75 74 20 22  tually OK, but "
17640 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 74  .        echo "t
17650 68 69 73 20 69 73 20 61 6e 20 6f 6c 64 65 72 20  his is an older 
17660 76 65 72 73 69 6f 6e 20 6f 66 20 74 68 65 20 53  version of the S
17670 69 6c 6b 74 6f 72 72 65 6e 74 20 69 6d 70 6c 65  ilktorrent imple
17680 6d 65 6e 74 61 74 69 6f 6e 20 61 6e 64 20 22 0a  mentation and ".
17690 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 74 68          echo "th
176a0 65 20 6f 6c 64 65 72 20 76 65 72 73 69 6f 6e 20  e older version 
176b0 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74  does not support
176c0 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
176d0 22 6e 65 77 65 72 20 53 69 6c 6b 74 6f 72 72 65  "newer Silktorre
176e0 6e 74 20 70 61 63 6b 65 74 20 66 6f 72 6d 61 74  nt packet format
176f0 73 2e 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  s. ".        ech
17700 6f 20 22 54 68 65 20 66 69 6c 65 20 70 61 74 68  o "The file path
17710 20 6f 66 20 74 68 65 20 53 69 6c 6b 74 6f 72 72   of the Silktorr
17720 65 6e 74 20 70 61 63 6b 65 74 20 63 61 6e 64 69  ent packet candi
17730 64 61 74 65 3a 22 0a 20 20 20 20 20 20 20 20 65  date:".        e
17740 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
17750 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50 5f 30  cho "    $S_FP_0
17760 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
17770 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
17780 47 55 49 44 3d 3d 27 64 39 63 63 38 31 65 33 2d  GUID=='d9cc81e3-
17790 36 36 38 32 2d 34 30 39 37 2d 38 31 30 66 2d 32  6682-4097-810f-2
177a0 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20  1b170e031e7'".  
177b0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
177c0 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
177d0 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
177e0 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31  G.        exit 1
177f0 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
17800 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  or.    fi.    #-
17810 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61  -------.    loca
17820 6c 20 53 5f 54 4d 50 5f 31 3d 22 22 0a 20 20 20  l S_TMP_1="".   
17830 20 69 66 20 5b 20 22 24 53 5f 50 41 43 4b 45 54   if [ "$S_PACKET
17840 5f 46 4f 52 4d 41 54 22 20 3d 3d 20 22 73 69 6c  _FORMAT" == "sil
17850 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 65 74 5f  ktorrent_packet_
17860 66 6f 72 6d 61 74 5f 76 65 72 73 69 6f 6e 5f 31  format_version_1
17870 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
17880 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b    func_mmmv_silk
17890 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72  torrent_packager
178a0 5f 74 31 5f 62 61 73 68 5f 62 6c 6f 62 32 66 69  _t1_bash_blob2fi
178b0 6c 65 6e 61 6d 65 5f 74 31 20 22 24 53 5f 46 50  lename_t1 "$S_FP
178c0 5f 30 22 0a 20 20 20 20 20 20 20 20 23 65 63 68  _0".        #ech
178d0 6f 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  o "$S_FUNC_MMMV_
178e0 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
178f0 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 42 4c 4f  AGER_T1_BASH_BLO
17900 42 32 46 49 4c 45 4e 41 4d 45 5f 54 31 5f 52 45  B2FILENAME_T1_RE
17910 53 55 4c 54 22 0a 20 20 20 20 20 20 20 20 53 5f  SULT".        S_
17920 54 4d 50 5f 31 3d 22 24 53 5f 46 55 4e 43 5f 4d  TMP_1="$S_FUNC_M
17930 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  MMV_SILKTORRENT_
17940 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48  PACKAGER_T1_BASH
17950 5f 42 4c 4f 42 32 46 49 4c 45 4e 41 4d 45 5f 54  _BLOB2FILENAME_T
17960 31 5f 52 45 53 55 4c 54 22 0a 20 20 20 20 66 69  1_RESULT".    fi
17970 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69  .    #----.    i
17980 66 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20 3d  f [ "$S_TMP_1" =
17990 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  = "" ]; then.   
179a0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
179b0 20 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20       echo "This 
179c0 73 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64  script is flawed
179d0 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
179e0 22 49 74 20 73 68 6f 75 6c 64 20 68 61 76 65 20  "It should have 
179f0 74 68 72 6f 77 6e 20 62 65 66 6f 72 65 20 74 68  thrown before th
17a00 65 20 63 6f 6e 74 72 6f 6c 20 66 6c 6f 77 20 72  e control flow r
17a10 65 61 63 68 65 73 20 74 68 69 73 20 6c 69 6e 65  eaches this line
17a20 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
17a30 22 47 55 49 44 3d 3d 27 37 33 63 65 34 34 35 63  "GUID=='73ce445c
17a40 2d 39 33 31 38 2d 34 39 62 61 2d 38 31 66 65 2d  -9318-49ba-81fe-
17a50 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20  21b170e031e7'". 
17a60 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
17a70 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
17a80 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
17a90 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
17aa0 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
17ab0 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ror.    fi.    #
17ac0 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63  --------.    loc
17ad0 61 6c 20 53 5f 54 4d 50 5f 30 3d 22 60 62 61 73  al S_TMP_0="`bas
17ae0 65 6e 61 6d 65 20 24 53 5f 46 50 5f 30 60 22 20  ename $S_FP_0`" 
17af0 23 20 54 68 65 20 53 5f 54 4d 50 5f 30 20 6d 75  # The S_TMP_0 mu
17b00 73 74 20 62 65 20 65 76 61 6c 75 61 74 65 64 20  st be evaluated 
17b10 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
17b20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17b30 20 20 20 20 20 20 20 20 23 20 61 66 74 65 72 20          # after 
17b40 74 68 65 20 76 61 72 69 6f 75 73 20 66 75 6e 63  the various func
17b50 74 69 6f 6e 73 20 74 6f 20 0a 20 20 20 20 20 20  tions to .      
17b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17b70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17b80 20 23 20 63 6f 75 6e 74 65 72 20 61 20 73 69 74   # counter a sit
17b90 75 61 74 69 6f 6e 2c 20 77 68 65 72 65 20 0a 20  uation, where . 
17ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17bb0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17bc0 20 20 20 20 20 20 23 20 74 68 65 20 53 5f 54 4d        # the S_TM
17bd0 50 5f 30 20 69 73 20 6f 76 65 72 77 72 69 74 74  P_0 is overwritt
17be0 65 6e 20 0a 20 20 20 20 20 20 20 20 20 20 20 20  en .            
17bf0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17c00 20 20 20 20 20 20 20 20 20 20 20 23 20 62 79 20             # by 
17c10 74 68 65 20 6e 61 6d 65 2d 63 61 6c 63 20 66 75  the name-calc fu
17c20 6e 63 74 69 6f 6e 20 0a 20 20 20 20 20 20 20 20  nction .        
17c30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17c40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23                 #
17c50 20 6f 72 20 62 79 20 6f 6e 65 20 6f 66 20 74 68   or by one of th
17c60 65 20 73 75 62 2d 66 75 6e 63 74 69 6f 6e 73 0a  e sub-functions.
17c70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17c80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17c90 20 20 20 20 20 20 20 23 20 6f 66 20 74 68 65 20         # of the 
17ca0 6e 61 6d 65 2d 63 61 6c 63 20 66 75 6e 63 74 69  name-calc functi
17cb0 6f 6e 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20  on..            
17cc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17cd0 20 20 20 20 20 20 20 20 20 20 20 23 20 54 68 65             # The
17ce0 20 66 6c 61 77 20 6f 63 63 75 72 73 2c 20 77 68   flaw occurs, wh
17cf0 65 6e 20 74 68 65 20 0a 20 20 20 20 20 20 20 20  en the .        
17d00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17d10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23                 #
17d20 20 53 5f 54 4d 50 5f 30 20 69 73 20 75 73 65 64   S_TMP_0 is used
17d30 20 77 69 74 68 69 6e 20 74 68 65 20 0a 20 20 20   within the .   
17d40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17d50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17d60 20 20 20 20 23 20 6e 61 6d 65 2d 63 61 6c 63 20      # name-calc 
17d70 66 75 6e 63 74 69 6f 6e 20 77 69 74 68 6f 75 74  function without
17d80 20 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20    .             
17d90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17da0 20 20 20 20 20 20 20 20 20 20 23 20 64 65 63 6c            # decl
17db0 61 72 69 6e 67 20 69 74 20 74 6f 20 62 65 20 61  aring it to be a
17dc0 20 6c 6f 63 61 6c 0a 20 20 20 20 20 20 20 20 20   local.         
17dd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17de0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20                # 
17df0 76 61 72 69 61 62 6c 65 2e 0a 20 20 20 20 23 2d  variable..    #-
17e00 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 65 63 68  -------.    #ech
17e10 6f 20 22 53 5f 46 50 5f 30 3d 3d 24 53 5f 46 50  o "S_FP_0==$S_FP
17e20 5f 30 22 0a 20 20 20 20 23 65 63 68 6f 20 22 53  _0".    #echo "S
17e30 5f 54 4d 50 5f 30 3d 3d 24 53 5f 54 4d 50 5f 30  _TMP_0==$S_TMP_0
17e40 22 0a 20 20 20 20 23 65 63 68 6f 20 22 53 5f 54  ".    #echo "S_T
17e50 4d 50 5f 31 3d 3d 24 53 5f 54 4d 50 5f 31 22 0a  MP_1==$S_TMP_1".
17e60 20 20 20 20 6c 6f 63 61 6c 20 53 5f 4f 55 54 3d      local S_OUT=
17e70 22 22 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  "".    if [ "$S_
17e80 54 4d 50 5f 31 22 20 3d 3d 20 22 24 53 5f 54 4d  TMP_1" == "$S_TM
17e90 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  P_0" ]; then.   
17ea0 20 20 20 20 20 53 5f 4f 55 54 3d 22 76 65 72 69       S_OUT="veri
17eb0 66 69 63 61 74 69 6f 6e 5f 70 61 73 73 65 64 22  fication_passed"
17ec0 0a 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20  .    else.      
17ed0 20 20 53 5f 4f 55 54 3d 22 76 65 72 69 66 69 63    S_OUT="verific
17ee0 61 74 69 6f 6e 5f 66 61 69 6c 65 64 22 0a 20 20  ation_failed".  
17ef0 20 20 66 69 0a 20 20 20 20 53 5f 46 55 4e 43 5f    fi.    S_FUNC_
17f00 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54  MMMV_SILKTORRENT
17f10 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53  _PACKAGER_T1_BAS
17f20 48 5f 56 45 52 49 46 59 5f 46 49 4c 45 5f 4e 41  H_VERIFY_FILE_NA
17f30 4d 45 5f 54 31 5f 52 45 53 55 4c 54 3d 22 24 53  ME_T1_RESULT="$S
17f40 5f 4f 55 54 22 0a 7d 20 23 20 66 75 6e 63 5f 6d  _OUT".} # func_m
17f50 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f  mmv_silktorrent_
17f60 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68  packager_t1_bash
17f70 5f 76 65 72 69 66 79 5f 66 69 6c 65 5f 6e 61 6d  _verify_file_nam
17f80 65 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  e_t1...#--------
17f90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17fa0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17fb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17fc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17fd0 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69  --..func_mmmv_si
17fe0 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67  lktorrent_packag
17ff0 65 72 5f 74 31 5f 62 61 73 68 5f 74 65 73 74 5f  er_t1_bash_test_
18000 31 28 29 20 7b 20 0a 20 20 20 20 6c 6f 63 61 6c  1() { .    local
18010 20 53 5f 46 50 5f 30 3d 22 24 31 22 20 23 20 50   S_FP_0="$1" # P
18020 61 74 68 20 74 6f 20 74 68 65 20 66 69 6c 65 2e  ath to the file.
18030 20 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20   .    #----.    
18040 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
18050 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74  rrent_packager_t
18060 31 5f 62 61 73 68 5f 65 78 63 5f 61 73 73 65 72  1_bash_exc_asser
18070 74 5f 77 72 61 70 70 61 62 6c 65 5f 66 69 6c 65  t_wrappable_file
18080 5f 65 78 69 73 74 73 5f 74 31 20 22 24 53 5f 46  _exists_t1 "$S_F
18090 50 5f 30 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  P_0".    #------
180a0 2d 2d 0a 20 20 20 20 65 63 68 6f 20 22 22 0a 20  --.    echo "". 
180b0 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 66 75 6e     #----.    fun
180c0 63 5f 6d 6d 6d 76 5f 74 69 67 65 72 68 61 73 68  c_mmmv_tigerhash
180d0 5f 74 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20  _t1 "$S_FP_0".  
180e0 20 20 65 63 68 6f 20 22 20 20 20 20 20 20 20 54    echo "       T
180f0 69 67 65 72 3a 20 24 53 5f 46 55 4e 43 5f 4d 4d  iger: $S_FUNC_MM
18100 4d 56 5f 54 49 47 45 52 48 41 53 48 5f 54 31 5f  MV_TIGERHASH_T1_
18110 52 45 53 55 4c 54 22 0a 20 20 20 20 66 75 6e 63  RESULT".    func
18120 5f 6d 6d 6d 76 5f 77 68 69 72 6c 70 6f 6f 6c 68  _mmmv_whirlpoolh
18130 61 73 68 5f 74 31 20 22 24 53 5f 46 50 5f 30 22  ash_t1 "$S_FP_0"
18140 0a 20 20 20 20 65 63 68 6f 20 22 20 20 20 57 68  .    echo "   Wh
18150 69 72 6c 70 6f 6f 6c 3a 20 24 53 5f 46 55 4e 43  irlpool: $S_FUNC
18160 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c 48  _MMMV_WHIRLPOOLH
18170 41 53 48 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20  ASH_T1_RESULT". 
18180 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 68 61     func_mmmv_sha
18190 32 35 36 5f 74 31 20 22 24 53 5f 46 50 5f 30 22  256_t1 "$S_FP_0"
181a0 0a 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 20  .    echo "     
181b0 20 53 48 41 32 35 36 3a 20 24 53 5f 46 55 4e 43   SHA256: $S_FUNC
181c0 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54 31 5f  _MMMV_SHA256_T1_
181d0 52 45 53 55 4c 54 22 0a 20 20 20 20 66 75 6e 63  RESULT".    func
181e0 5f 6d 6d 6d 76 5f 66 69 6c 65 73 69 7a 65 5f 74  _mmmv_filesize_t
181f0 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20 20  1 "$S_FP_0".    
18200 65 63 68 6f 20 22 20 20 20 66 69 6c 65 20 73 69  echo "   file si
18210 7a 65 3a 20 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56  ze: $S_FUNC_MMMV
18220 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 52 45 53  _FILESIZE_T1_RES
18230 55 4c 54 22 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20  ULT".    #----. 
18240 20 20 20 65 63 68 6f 20 22 22 0a 7d 20 23 20 66     echo "".} # f
18250 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72  unc_mmmv_silktor
18260 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31  rent_packager_t1
18270 5f 62 61 73 68 5f 74 65 73 74 5f 31 0a 0a 0a 23  _bash_test_1...#
18280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
182a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
182b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
182c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63  ----------..func
182d0 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
182e0 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61  t_packager_t1_ba
182f0 73 68 5f 77 72 61 70 5f 74 31 28 29 20 7b 0a 20  sh_wrap_t1() {. 
18300 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 30 3d     local S_FP_0=
18310 22 24 31 22 20 23 20 50 61 74 68 20 74 6f 20 74  "$1" # Path to t
18320 68 65 20 66 69 6c 65 2e 20 0a 20 20 20 20 23 2d  he file. .    #-
18330 2d 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d  ---.    func_mmm
18340 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61  v_silktorrent_pa
18350 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 65  ckager_t1_bash_e
18360 78 63 5f 61 73 73 65 72 74 5f 77 72 61 70 70 61  xc_assert_wrappa
18370 62 6c 65 5f 66 69 6c 65 5f 65 78 69 73 74 73 5f  ble_file_exists_
18380 74 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20  t1 "$S_FP_0".   
18390 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66   #--------.    f
183a0 75 6e 63 5f 6d 6d 6d 76 5f 63 72 65 61 74 65 5f  unc_mmmv_create_
183b0 74 6d 70 5f 66 6f 6c 64 65 72 5f 74 31 0a 20 20  tmp_folder_t1.  
183c0 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f    if [ "$S_FUNC_
183d0 46 55 4e 43 5f 4d 4d 4d 56 5f 43 52 45 41 54 45  FUNC_MMMV_CREATE
183e0 5f 54 4d 50 5f 46 4f 4c 44 45 52 5f 54 31 5f 52  _TMP_FOLDER_T1_R
183f0 45 53 55 4c 54 22 20 3d 3d 20 22 22 20 5d 3b 20  ESULT" == "" ]; 
18400 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68  then.        ech
18410 6f 20 22 54 68 69 73 20 73 63 72 69 70 74 20 69  o "This script i
18420 73 20 66 6c 61 77 65 64 2c 20 62 65 63 61 75 73  s flawed, becaus
18430 65 20 74 68 65 20 66 6f 6c 64 65 72 20 22 0a 20  e the folder ". 
18440 20 20 20 20 20 20 20 65 63 68 6f 20 22 63 72 65         echo "cre
18450 61 74 69 6f 6e 20 66 75 6e 63 74 69 6f 6e 20 73  ation function s
18460 68 6f 75 6c 64 20 68 61 76 65 20 74 68 72 6f 77  hould have throw
18470 6e 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  n ".        echo
18480 20 22 62 65 66 6f 72 65 20 74 68 65 20 63 6f 6e   "before the con
18490 74 72 6f 6c 20 66 6c 6f 77 20 72 65 61 63 68 65  trol flow reache
184a0 73 20 74 68 69 73 20 62 72 61 6e 63 68 2e 22 20  s this branch." 
184b0 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47  .        echo "G
184c0 55 49 44 3d 3d 27 35 31 36 62 39 62 37 38 2d 66  UID=='516b9b78-f
184d0 65 39 38 2d 34 66 30 64 2d 39 35 66 65 2d 32 31  e98-4f0d-95fe-21
184e0 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  b170e031e7'".   
184f0 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
18500 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
18510 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20  .        exit 1 
18520 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
18530 72 0a 20 20 20 20 66 69 0a 20 20 20 20 6c 6f 63  r.    fi.    loc
18540 61 6c 20 53 5f 46 50 5f 54 4d 50 5f 30 3d 22 24  al S_FP_TMP_0="$
18550 53 5f 46 55 4e 43 5f 46 55 4e 43 5f 4d 4d 4d 56  S_FUNC_FUNC_MMMV
18560 5f 43 52 45 41 54 45 5f 54 4d 50 5f 46 4f 4c 44  _CREATE_TMP_FOLD
18570 45 52 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20 20  ER_T1_RESULT".  
18580 20 20 69 66 20 5b 20 21 20 2d 65 20 22 24 53 5f    if [ ! -e "$S_
18590 46 50 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68 65  FP_TMP_0" ]; the
185a0 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  n.        echo "
185b0 54 68 69 73 20 73 63 72 69 70 74 20 69 73 20 66  This script is f
185c0 6c 61 77 65 64 2e 22 0a 20 20 20 20 20 20 20 20  lawed.".        
185d0 65 63 68 6f 20 22 4d 61 79 20 62 65 20 73 6f 6d  echo "May be som
185e0 65 20 6f 74 68 65 72 20 74 68 72 65 61 64 20 64  e other thread d
185f0 65 6c 65 74 65 64 20 74 68 65 20 66 6f 6c 64 65  eleted the folde
18600 72 20 6f 72 22 0a 20 20 20 20 20 20 20 20 65 63  r or".        ec
18610 68 6f 20 22 74 68 65 20 66 6f 6c 64 65 72 20 63  ho "the folder c
18620 72 65 61 74 69 6f 6e 20 66 75 6e 63 74 69 6f 6e  reation function
18630 20 72 65 74 75 72 6e 65 64 20 61 20 76 61 6c 69   returned a vali
18640 64 20 70 61 74 68 2c 20 62 75 74 22 0a 20 20 20  d path, but".   
18650 20 20 20 20 20 65 63 68 6f 20 22 64 69 64 20 6e       echo "did n
18660 6f 74 20 61 63 74 75 61 6c 6c 79 20 63 72 65 61  ot actually crea
18670 74 65 20 74 68 65 20 66 6f 6c 64 65 72 20 74 68  te the folder th
18680 61 74 20 69 74 20 77 61 73 20 73 75 70 70 6f 73  at it was suppos
18690 65 64 20 63 72 65 61 74 65 2e 22 0a 20 20 20 20  ed create.".    
186a0 20 20 20 20 65 63 68 6f 20 22 53 5f 46 50 5f 54      echo "S_FP_T
186b0 4d 50 5f 30 3d 3d 24 53 5f 46 50 5f 54 4d 50 5f  MP_0==$S_FP_TMP_
186c0 30 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  0".        echo 
186d0 22 47 55 49 44 3d 3d 27 65 63 62 65 63 64 34 31  "GUID=='ecbecd41
186e0 2d 61 36 31 35 2d 34 32 36 31 2d 38 32 66 65 2d  -a615-4261-82fe-
186f0 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20  21b170e031e7'". 
18700 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
18710 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
18720 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
18730 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
18740 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ror.    fi.    #
18750 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63  --------.    loc
18760 61 6c 20 53 5f 54 4d 50 5f 30 3d 22 22 20 23 20  al S_TMP_0="" # 
18770 64 65 63 6c 61 72 61 74 69 6f 6e 0a 20 20 20 20  declaration.    
18780 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 31 3d 22 22  local S_TMP_1=""
18790 20 23 20 64 65 63 6c 61 72 61 74 69 6f 6e 0a 20   # declaration. 
187a0 20 20 20 6c 6f 63 61 6c 20 53 5f 46 4e 5f 43 55     local S_FN_CU
187b0 53 54 4f 4d 5f 48 45 41 44 45 52 53 3d 22 63 75  STOM_HEADERS="cu
187c0 73 74 6f 6d 5f 68 65 61 64 65 72 73 22 0a 20 20  stom_headers".  
187d0 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 54 4d 50    local S_FP_TMP
187e0 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
187f0 4b 45 54 3d 22 24 53 5f 46 50 5f 54 4d 50 5f 30  KET="$S_FP_TMP_0
18800 2f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  /silktorrent_pac
18810 6b 65 74 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53  ket".    local S
18820 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52 52  _FP_TMP_SILKTORR
18830 45 4e 54 5f 50 41 43 4b 45 54 5f 54 41 52 3d 22  ENT_PACKET_TAR="
18840 24 53 5f 46 50 5f 54 4d 50 5f 30 2f 73 69 6c 6b  $S_FP_TMP_0/silk
18850 74 6f 72 72 65 6e 74 5f 70 61 63 6b 65 74 2e 74  torrent_packet.t
18860 61 72 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f  ar".    local S_
18870 46 50 5f 54 4d 50 5f 50 41 59 4c 4f 41 44 3d 22  FP_TMP_PAYLOAD="
18880 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f  $S_FP_TMP_SILKTO
18890 52 52 45 4e 54 5f 50 41 43 4b 45 54 2f 70 61 79  RRENT_PACKET/pay
188a0 6c 6f 61 64 22 0a 20 20 20 20 6c 6f 63 61 6c 20  load".    local 
188b0 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44 45 52 3d  S_FP_TMP_HEADER=
188c0 22 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54  "$S_FP_TMP_SILKT
188d0 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 2f 68 65  ORRENT_PACKET/he
188e0 61 64 65 72 22 0a 20 20 20 20 6c 6f 63 61 6c 20  ader".    local 
188f0 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44 45 52 5f  S_FP_TMP_HEADER_
18900 53 41 4c 54 5f 54 58 54 3d 22 24 53 5f 46 50 5f  SALT_TXT="$S_FP_
18910 54 4d 50 5f 48 45 41 44 45 52 2f 73 69 6c 6b 74  TMP_HEADER/silkt
18920 6f 72 72 65 6e 74 5f 73 61 6c 74 2e 74 78 74 22  orrent_salt.txt"
18930 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 63  .    func_mmmv_c
18940 72 65 61 74 65 5f 66 6f 6c 64 65 72 5f 69 66 5f  reate_folder_if_
18950 69 74 5f 64 6f 65 73 5f 6e 6f 74 5f 61 6c 72 65  it_does_not_alre
18960 61 64 79 5f 65 78 69 73 74 5f 74 31 20 22 24 53  ady_exist_t1 "$S
18970 5f 46 50 5f 54 4d 50 5f 50 41 59 4c 4f 41 44 22  _FP_TMP_PAYLOAD"
18980 20 23 20 75 73 65 73 20 6d 6b 64 69 72 20 2d 70   # uses mkdir -p
18990 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 63  .    func_mmmv_c
189a0 72 65 61 74 65 5f 66 6f 6c 64 65 72 5f 69 66 5f  reate_folder_if_
189b0 69 74 5f 64 6f 65 73 5f 6e 6f 74 5f 61 6c 72 65  it_does_not_alre
189c0 61 64 79 5f 65 78 69 73 74 5f 74 31 20 22 24 53  ady_exist_t1 "$S
189d0 5f 46 50 5f 54 4d 50 5f 48 45 41 44 45 52 22 0a  _FP_TMP_HEADER".
189e0 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
189f0 20 20 53 5f 54 4d 50 5f 30 3d 22 60 70 77 64 60    S_TMP_0="`pwd`
18a00 2f 24 53 5f 46 4e 5f 43 55 53 54 4f 4d 5f 48 45  /$S_FN_CUSTOM_HE
18a10 41 44 45 52 53 22 0a 20 20 20 20 69 66 20 5b 20  ADERS".    if [ 
18a20 2d 65 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b  -e "$S_TMP_0" ];
18a30 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 69 66   then.        if
18a40 20 5b 20 21 20 2d 64 20 22 24 53 5f 54 4d 50 5f   [ ! -d "$S_TMP_
18a50 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
18a60 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
18a70 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
18a80 22 54 68 65 20 22 0a 20 20 20 20 20 20 20 20 20  "The ".         
18a90 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
18aa0 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20         echo "   
18ab0 20 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20   $S_TMP_0".     
18ac0 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
18ad0 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
18ae0 22 65 78 69 73 74 73 2c 20 62 75 74 20 69 74 20  "exists, but it 
18af0 69 73 20 6e 6f 74 20 61 20 66 6f 6c 64 65 72 2e  is not a folder.
18b00 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
18b10 68 6f 20 22 47 55 49 44 3d 3d 27 34 34 39 39 31  ho "GUID=='44991
18b20 30 35 66 2d 30 36 64 37 2d 34 37 37 61 2d 61 33  05f-06d7-477a-a3
18b30 66 65 2d 32 31 62 31 37 30 65 30 33 31 65 37 27  fe-21b170e031e7'
18b40 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
18b50 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
18b60 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
18b70 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
18b80 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78  G.            ex
18b90 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
18ba0 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66   error.        f
18bb0 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a  i.        #----.
18bc0 20 20 20 20 20 20 20 20 23 20 4e 75 6d 62 65 72          # Number
18bd0 20 6f 66 20 66 69 6c 65 73 2f 66 6f 6c 64 65 72   of files/folder
18be0 73 20 69 6e 20 74 68 65 20 24 53 5f 54 4d 50 5f  s in the $S_TMP_
18bf0 30 2c 20 69 66 20 63 6f 75 6e 74 65 64 20 6e 6f  0, if counted no
18c00 6e 2d 72 65 63 75 72 73 69 76 65 6c 79 2e 0a 20  n-recursively.. 
18c10 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 31 3d 22         S_TMP_1="
18c20 60 63 64 20 24 53 5f 54 4d 50 5f 30 3b 20 72 75  `cd $S_TMP_0; ru
18c30 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 44 69  by -e \"print(Di
18c40 72 3a 3a 67 6c 6f 62 28 27 2a 27 29 2e 73 69 7a  r::glob('*').siz
18c50 65 2e 74 6f 5f 73 29 5c 22 60 22 20 0a 20 20 20  e.to_s)\"`" .   
18c60 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
18c70 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f     if [ "$S_TMP_
18c80 31 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e  1" == "" ]; then
18c90 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
18ca0 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
18cb0 20 65 63 68 6f 20 22 54 68 69 73 20 73 63 72 69   echo "This scri
18cc0 70 74 20 69 73 20 66 6c 61 77 65 64 2e 22 0a 20  pt is flawed.". 
18cd0 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
18ce0 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  "".            e
18cf0 63 68 6f 20 22 20 20 20 20 70 77 64 3d 60 70 77  cho "    pwd=`pw
18d00 64 60 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  d`".            
18d10 65 63 68 6f 20 22 20 20 20 20 53 5f 54 4d 50 5f  echo "    S_TMP_
18d20 30 3d 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20  0=$S_TMP_0".    
18d30 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
18d40 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
18d50 20 22 47 55 49 44 3d 3d 27 34 35 38 38 66 36 62   "GUID=='4588f6b
18d60 37 2d 38 62 37 61 2d 34 35 33 31 2d 62 31 66 65  7-8b7a-4531-b1fe
18d70 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a  -21b170e031e7'".
18d80 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
18d90 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
18da0 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20  #----.          
18db0 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
18dc0 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74              exit
18dd0 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
18de0 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a  rror.        fi.
18df0 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
18e00 5f 54 4d 50 5f 31 22 20 21 3d 20 22 30 22 20 5d  _TMP_1" != "0" ]
18e10 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20  ; then.         
18e20 20 20 20 63 70 20 2d 66 20 2d 52 20 24 53 5f 54     cp -f -R $S_T
18e30 4d 50 5f 30 20 24 53 5f 46 50 5f 54 4d 50 5f 48  MP_0 $S_FP_TMP_H
18e40 45 41 44 45 52 2f 0a 20 20 20 20 20 20 20 20 20  EADER/.         
18e50 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20     if [ "$?" != 
18e60 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  "0" ]; then.    
18e70 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
18e80 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
18e90 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 72 65      echo "The re
18ea0 63 75 72 73 69 76 65 20 63 6f 70 79 69 6e 67 20  cursive copying 
18eb0 6f 66 20 74 68 65 20 66 6f 6c 64 65 72 20 22 0a  of the folder ".
18ec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
18ed0 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
18ee0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
18ef0 20 20 24 53 5f 54 4d 50 5f 30 20 22 0a 20 20 20    $S_TMP_0 ".   
18f00 20 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68               ech
18f10 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
18f20 20 20 20 20 20 65 63 68 6f 20 22 66 61 69 6c 65       echo "faile
18f30 64 20 77 69 74 68 20 61 6e 20 65 72 72 6f 72 20  d with an error 
18f40 63 6f 64 65 20 6f 66 20 24 3f 2e 22 0a 20 20 20  code of $?.".   
18f50 20 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68               ech
18f60 6f 20 22 47 55 49 44 3d 3d 27 61 34 62 38 61 65  o "GUID=='a4b8ae
18f70 32 30 2d 66 64 64 62 2d 34 32 34 33 2d 38 34 65  20-fddb-4243-84e
18f80 65 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22  e-21b170e031e7'"
18f90 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
18fa0 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
18fb0 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20           #----. 
18fc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63                 c
18fd0 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
18fe0 20 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69               exi
18ff0 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
19000 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 20 20  error.          
19010 20 20 66 69 0a 20 20 20 20 20 20 20 20 66 69 0a    fi.        fi.
19020 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
19030 2d 2d 2d 2d 0a 20 20 20 20 23 20 53 61 6c 74 69  ----.    # Salti
19040 6e 67 20 6d 61 6b 65 73 20 73 75 72 65 20 74 68  ng makes sure th
19050 61 74 20 69 74 20 69 73 20 6e 6f 74 20 70 6f 73  at it is not pos
19060 73 69 62 6c 65 20 74 6f 20 0a 20 20 20 20 23 20  sible to .    # 
19070 63 6f 6e 63 6c 75 64 65 20 74 68 65 20 70 61 79  conclude the pay
19080 6c 6f 61 64 20 62 69 74 73 74 72 65 61 6d 20 66  load bitstream f
19090 72 6f 6d 20 74 68 65 20 0a 20 20 20 20 23 20 53  rom the .    # S
190a0 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63 6b 65  ilktorrent packe
190b0 74 20 28 66 69 6c 65 29 20 6e 61 6d 65 2c 20 66  t (file) name, f
190c0 6f 72 63 69 6e 67 20 63 65 6e 73 6f 72 69 6e 67  orcing censoring
190d0 0a 20 20 20 20 23 20 70 61 72 74 69 65 73 20 74  .    # parties t
190e0 6f 20 64 6f 77 6e 6c 6f 61 64 20 70 61 63 6b 61  o download packa
190f0 67 65 73 20 0a 20 20 20 20 23 20 74 68 61 74 20  ges .    # that 
19100 74 68 65 79 20 61 72 65 20 6e 6f 74 20 6c 6f 6f  they are not loo
19110 6b 69 6e 67 20 66 6f 72 20 61 6e 64 20 61 6c 6c  king for and all
19120 6f 77 69 6e 67 0a 20 20 20 20 23 20 63 65 6e 73  owing.    # cens
19130 6f 72 73 68 69 70 20 64 6f 64 67 65 72 73 20 74  orship dodgers t
19140 6f 20 70 75 62 6c 69 73 68 20 74 68 65 20 73 61  o publish the sa
19150 6d 65 20 70 61 79 6c 6f 61 64 20 62 69 74 73 74  me payload bitst
19160 72 65 61 6d 0a 20 20 20 20 23 20 69 6e 20 6d 75  ream.    # in mu
19170 6c 74 69 70 6c 65 2c 20 64 69 66 66 65 72 65 74  ltiple, differet
19180 2c 20 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61  , Silktorrent pa
19190 63 6b 61 67 65 73 2e 0a 20 20 20 20 66 75 6e 63  ckages..    func
191a0 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74 31 0a 20 20  _mmmv_GUID_t1.  
191b0 20 20 65 63 68 6f 20 22 24 53 5f 46 55 4e 43 5f    echo "$S_FUNC_
191c0 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45 53  MMMV_GUID_T1_RES
191d0 55 4c 54 22 20 3e 3e 20 24 53 5f 46 50 5f 54 4d  ULT" >> $S_FP_TM
191e0 50 5f 48 45 41 44 45 52 5f 53 41 4c 54 5f 54 58  P_HEADER_SALT_TX
191f0 54 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f  T.    func_mmmv_
19200 47 55 49 44 5f 74 31 0a 20 20 20 20 65 63 68 6f  GUID_t1.    echo
19210 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47   "$S_FUNC_MMMV_G
19220 55 49 44 5f 54 31 5f 52 45 53 55 4c 54 22 20 3e  UID_T1_RESULT" >
19230 3e 20 24 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44  > $S_FP_TMP_HEAD
19240 45 52 5f 53 41 4c 54 5f 54 58 54 0a 20 20 20 20  ER_SALT_TXT.    
19250 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74  func_mmmv_GUID_t
19260 31 0a 20 20 20 20 65 63 68 6f 20 22 24 53 5f 46  1.    echo "$S_F
19270 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31  UNC_MMMV_GUID_T1
19280 5f 52 45 53 55 4c 54 22 20 3e 3e 20 24 53 5f 46  _RESULT" >> $S_F
19290 50 5f 54 4d 50 5f 48 45 41 44 45 52 5f 53 41 4c  P_TMP_HEADER_SAL
192a0 54 5f 54 58 54 0a 20 20 20 20 66 75 6e 63 5f 6d  T_TXT.    func_m
192b0 6d 6d 76 5f 47 55 49 44 5f 74 31 0a 20 20 20 20  mmv_GUID_t1.    
192c0 65 63 68 6f 20 22 24 53 5f 46 55 4e 43 5f 4d 4d  echo "$S_FUNC_MM
192d0 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45 53 55 4c  MV_GUID_T1_RESUL
192e0 54 22 20 3e 3e 20 24 53 5f 46 50 5f 54 4d 50 5f  T" >> $S_FP_TMP_
192f0 48 45 41 44 45 52 5f 53 41 4c 54 5f 54 58 54 0a  HEADER_SALT_TXT.
19300 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55      func_mmmv_GU
19310 49 44 5f 74 31 0a 20 20 20 20 65 63 68 6f 20 22  ID_t1.    echo "
19320 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49  $S_FUNC_MMMV_GUI
19330 44 5f 54 31 5f 52 45 53 55 4c 54 22 20 3e 3e 20  D_T1_RESULT" >> 
19340 24 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44 45 52  $S_FP_TMP_HEADER
19350 5f 53 41 4c 54 5f 54 58 54 0a 20 20 20 20 66 75  _SALT_TXT.    fu
19360 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74 31 0a  nc_mmmv_GUID_t1.
19370 20 20 20 20 65 63 68 6f 20 22 24 53 5f 46 55 4e      echo "$S_FUN
19380 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52  C_MMMV_GUID_T1_R
19390 45 53 55 4c 54 22 20 3e 3e 20 24 53 5f 46 50 5f  ESULT" >> $S_FP_
193a0 54 4d 50 5f 48 45 41 44 45 52 5f 53 41 4c 54 5f  TMP_HEADER_SALT_
193b0 54 58 54 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  TXT.    #-------
193c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
193d0 2d 2d 0a 20 20 20 20 23 20 54 68 65 20 66 69 6c  --.    # The fil
193e0 65 20 73 69 7a 65 2f 53 69 6c 6b 74 6f 72 72 65  e size/Silktorre
193f0 6e 74 20 70 61 6b 63 6b 65 74 20 73 69 7a 65 20  nt pakcket size 
19400 6d 75 73 74 20 61 6c 73 6f 20 62 65 20 73 61 6c  must also be sal
19410 74 65 64 2e 0a 20 20 20 20 69 66 20 5b 20 22 24  ted..    if [ "$
19420 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41  S_SILKTORRENT_PA
19430 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e  CKAGER_T1_ACTION
19440 5f 57 41 52 50 5f 4e 52 41 4e 44 22 20 21 3d 20  _WARP_NRAND" != 
19450 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  "" ]; then.     
19460 20 20 20 72 75 62 79 20 2d 65 20 5c 0a 20 20 20     ruby -e \.   
19470 20 20 20 20 20 20 20 20 20 22 52 61 6e 64 6f 6d           "Random
19480 2e 6e 65 77 5f 73 65 65 64 3b 69 3d 30 3b 5c 0a  .new_seed;i=0;\.
19490 20 20 20 20 20 20 20 20 20 20 20 20 20 70 75 74               put
194a0 73 20 27 27 3b 5c 0a 20 20 20 20 20 20 20 20 20  s '';\.         
194b0 20 20 20 20 28 31 30 2b 24 53 5f 53 49 4c 4b 54      (10+$S_SILKT
194c0 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
194d0 54 31 5f 41 43 54 49 4f 4e 5f 57 41 52 50 5f 4e  T1_ACTION_WARP_N
194e0 52 41 4e 44 29 2e 74 69 6d 65 73 7b 5c 0a 20 20  RAND).times{\.  
194f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69                 i
19500 3d 69 2b 31 3b 5c 0a 20 20 20 20 20 20 20 20 20  =i+1;\.         
19510 20 20 20 20 20 20 20 20 70 72 69 6e 74 28 72 61          print(ra
19520 6e 64 28 31 30 2a 2a 36 29 2e 74 6f 5f 73 28 31  nd(10**6).to_s(1
19530 36 29 29 3b 5c 0a 20 20 20 20 20 20 20 20 20 20  6));\.          
19540 20 20 20 20 20 20 20 69 66 28 28 69 25 31 30 29         if((i%10)
19550 3d 3d 30 29 20 74 68 65 6e 20 5c 0a 20 20 20 20  ==0) then \.    
19560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19570 20 70 75 74 73 20 27 27 3b 5c 0a 20 20 20 20 20   puts '';\.     
19580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19590 69 3d 30 3b 5c 0a 20 20 20 20 20 20 20 20 20 20  i=0;\.          
195a0 20 20 20 20 20 20 20 65 6e 64 3b 5c 0a 20 20 20         end;\.   
195b0 20 20 20 20 20 20 20 20 20 20 7d 22 20 5c 0a 20            }" \. 
195c0 20 20 20 20 20 20 20 20 20 20 20 20 3e 3e 20 24              >> $
195d0 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44 45 52 5f  S_FP_TMP_HEADER_
195e0 53 41 4c 54 5f 54 58 54 0a 20 20 20 20 65 6c 73  SALT_TXT.    els
195f0 65 20 0a 20 20 20 20 20 20 20 20 72 75 62 79 20  e .        ruby 
19600 2d 65 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20  -e \.           
19610 20 22 52 61 6e 64 6f 6d 2e 6e 65 77 5f 73 65 65   "Random.new_see
19620 64 3b 69 3d 30 3b 5c 0a 20 20 20 20 20 20 20 20  d;i=0;\.        
19630 20 20 20 20 20 70 75 74 73 20 27 27 3b 5c 0a 20       puts '';\. 
19640 20 20 20 20 20 20 20 20 20 20 20 20 72 61 6e 64              rand
19650 28 31 30 2a 2a 36 29 2e 74 69 6d 65 73 7b 5c 0a  (10**6).times{\.
19660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19670 20 69 3d 69 2b 31 3b 5c 0a 20 20 20 20 20 20 20   i=i+1;\.       
19680 20 20 20 20 20 20 20 20 20 20 70 72 69 6e 74 28            print(
19690 72 61 6e 64 28 31 30 2a 2a 36 29 2e 74 6f 5f 73  rand(10**6).to_s
196a0 28 31 36 29 29 3b 5c 0a 20 20 20 20 20 20 20 20  (16));\.        
196b0 20 20 20 20 20 20 20 20 20 69 66 28 28 69 25 31           if((i%1
196c0 30 29 3d 3d 30 29 20 74 68 65 6e 20 5c 0a 20 20  0)==0) then \.  
196d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
196e0 20 20 20 70 75 74 73 20 27 27 3b 5c 0a 20 20 20     puts '';\.   
196f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19700 20 20 69 3d 30 3b 5c 0a 20 20 20 20 20 20 20 20    i=0;\.        
19710 20 20 20 20 20 20 20 20 20 65 6e 64 3b 5c 0a 20           end;\. 
19720 20 20 20 20 20 20 20 20 20 20 20 20 7d 22 20 5c              }" \
19730 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 3e 3e  .             >>
19740 20 24 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44 45   $S_FP_TMP_HEADE
19750 52 5f 53 41 4c 54 5f 54 58 54 0a 20 20 20 20 66  R_SALT_TXT.    f
19760 69 0a 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20  i.    if [ "$?" 
19770 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20  != "0" ]; then. 
19780 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
19790 20 20 20 20 20 20 20 65 63 68 6f 20 22 53 61 6c         echo "Sal
197a0 74 69 6e 67 20 66 61 69 6c 65 64 2e 20 5c 24 3f  ting failed. \$?
197b0 3d 3d 24 3f 22 0a 20 20 20 20 20 20 20 20 65 63  ==$?".        ec
197c0 68 6f 20 22 47 55 49 44 3d 3d 27 64 32 35 63 37  ho "GUID=='d25c7
197d0 34 66 64 2d 64 30 61 38 2d 34 63 63 39 2d 39 34  4fd-d0a8-4cc9-94
197e0 65 65 2d 32 31 62 31 37 30 65 30 33 31 65 37 27  ee-21b170e031e7'
197f0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
19800 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a  ".        #----.
19810 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50          cd $S_FP
19820 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78  _ORIG.        ex
19830 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
19840 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20   error.    fi.  
19850 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
19860 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20  ------------.   
19870 20 63 70 20 2d 66 20 24 53 5f 46 50 5f 30 20 24   cp -f $S_FP_0 $
19880 53 5f 46 50 5f 54 4d 50 5f 50 41 59 4c 4f 41 44  S_FP_TMP_PAYLOAD
19890 2f 0a 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20  /.    if [ "$?" 
198a0 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20  != "0" ]; then. 
198b0 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
198c0 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65         echo "The
198d0 20 63 6f 6d 6d 61 6e 64 20 22 0a 20 20 20 20 20   command ".     
198e0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
198f0 20 20 20 65 63 68 6f 20 22 20 20 20 20 63 70 20     echo "    cp 
19900 2d 66 20 5c 24 53 5f 46 50 5f 30 20 5c 24 53 5f  -f \$S_FP_0 \$S_
19910 46 50 5f 54 4d 50 5f 50 41 59 4c 4f 41 44 2f 20  FP_TMP_PAYLOAD/ 
19920 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
19930 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
19940 66 61 69 6c 65 64 2e 20 45 69 74 68 65 72 20 74  failed. Either t
19950 68 69 73 20 73 63 72 69 70 74 20 69 73 20 66 6c  his script is fl
19960 61 77 65 64 20 6f 72 20 73 6f 6d 65 74 68 69 6e  awed or somethin
19970 67 20 65 6c 73 65 20 77 65 6e 74 20 77 72 6f 6e  g else went wron
19980 67 2e 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  g. ".        ech
19990 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
199a0 6f 20 22 20 20 20 20 53 5f 46 50 5f 30 3d 3d 24  o "    S_FP_0==$
199b0 53 5f 46 50 5f 30 22 0a 20 20 20 20 20 20 20 20  S_FP_0".        
199c0 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
199d0 65 63 68 6f 20 22 20 20 20 20 53 5f 46 50 5f 54  echo "    S_FP_T
199e0 4d 50 5f 50 41 59 4c 4f 41 44 3d 24 53 5f 46 50  MP_PAYLOAD=$S_FP
199f0 5f 54 4d 50 5f 50 41 59 4c 4f 41 44 22 0a 20 20  _TMP_PAYLOAD".  
19a00 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
19a10 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
19a20 3d 3d 27 35 32 31 37 33 36 32 65 2d 36 30 34 33  =='5217362e-6043
19a30 2d 34 62 63 32 2d 39 34 65 65 2d 32 31 62 31 37  -4bc2-94ee-21b17
19a40 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
19a50 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
19a60 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
19a70 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20  cd $S_FP_ORIG.  
19a80 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
19a90 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
19aa0 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
19ab0 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f  ---.    local S_
19ac0 46 50 5f 54 4d 50 5f 4f 52 49 47 5f 30 3d 22 60  FP_TMP_ORIG_0="`
19ad0 70 77 64 60 22 0a 20 20 20 20 63 64 20 24 53 5f  pwd`".    cd $S_
19ae0 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45  FP_TMP_SILKTORRE
19af0 4e 54 5f 50 41 43 4b 45 54 2f 2e 2e 20 0a 20 20  NT_PACKET/.. .  
19b00 20 20 74 61 72 20 2d 63 66 20 24 53 5f 46 50 5f    tar -cf $S_FP_
19b10 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  TMP_SILKTORRENT_
19b20 50 41 43 4b 45 54 5f 54 41 52 20 2e 2f 60 62 61  PACKET_TAR ./`ba
19b30 73 65 6e 61 6d 65 20 24 53 5f 46 50 5f 54 4d 50  sename $S_FP_TMP
19b40 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
19b50 4b 45 54 60 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  KET` 2>/dev/null
19b60 0a 20 20 20 20 63 64 20 24 53 5f 46 50 5f 54 4d  .    cd $S_FP_TM
19b70 50 5f 4f 52 49 47 5f 30 0a 20 20 20 20 69 66 20  P_ORIG_0.    if 
19b80 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b  [ "$?" != "0" ];
19b90 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
19ba0 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
19bb0 68 6f 20 22 54 68 65 20 63 6f 6d 6d 61 6e 64 20  ho "The command 
19bc0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
19bd0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
19be0 20 20 20 20 74 61 72 20 2d 63 66 20 5c 24 53 5f      tar -cf \$S_
19bf0 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45  FP_TMP_SILKTORRE
19c00 4e 54 5f 50 41 43 4b 45 54 5f 54 41 52 20 5c 24  NT_PACKET_TAR \$
19c10 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52  S_FP_TMP_SILKTOR
19c20 52 45 4e 54 5f 50 41 43 4b 45 54 20 22 0a 20 20  RENT_PACKET ".  
19c30 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
19c40 20 20 20 20 20 20 65 63 68 6f 20 22 66 61 69 6c        echo "fail
19c50 65 64 2e 20 45 69 74 68 65 72 20 74 68 69 73 20  ed. Either this 
19c60 73 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64  script is flawed
19c70 20 6f 72 20 73 6f 6d 65 74 68 69 6e 67 20 65 6c   or something el
19c80 73 65 20 77 65 6e 74 20 77 72 6f 6e 67 2e 20 22  se went wrong. "
19c90 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
19ca0 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
19cb0 20 20 20 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b     S_FP_TMP_SILK
19cc0 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 3d 24  TORRENT_PACKET=$
19cd0 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52  S_FP_TMP_SILKTOR
19ce0 52 45 4e 54 5f 50 41 43 4b 45 54 22 0a 20 20 20  RENT_PACKET".   
19cf0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
19d00 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 53       echo "    S
19d10 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52 52  _FP_TMP_SILKTORR
19d20 45 4e 54 5f 50 41 43 4b 45 54 5f 54 41 52 3d 3d  ENT_PACKET_TAR==
19d30 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f  $S_FP_TMP_SILKTO
19d40 52 52 45 4e 54 5f 50 41 43 4b 45 54 5f 54 41 52  RRENT_PACKET_TAR
19d50 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
19d60 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
19d70 47 55 49 44 3d 3d 27 31 65 63 63 38 61 65 33 2d  GUID=='1ecc8ae3-
19d80 31 36 66 31 2d 34 62 37 62 2d 39 31 65 65 2d 32  16f1-4b7b-91ee-2
19d90 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20  1b170e031e7'".  
19da0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
19db0 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
19dc0 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
19dd0 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31  G.        exit 1
19de0 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
19df0 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  or.    fi.    #-
19e00 2d 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d  ---.    func_mmm
19e10 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61  v_silktorrent_pa
19e20 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 62  ckager_t1_bash_b
19e30 6c 6f 62 32 66 69 6c 65 6e 61 6d 65 5f 74 31 20  lob2filename_t1 
19e40 22 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54  "$S_FP_TMP_SILKT
19e50 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 5f 54 41  ORRENT_PACKET_TA
19e60 52 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46  R".    local S_F
19e70 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e  P_TMP_SILKTORREN
19e80 54 5f 50 41 43 4b 45 54 5f 50 55 42 4c 49 53 48  T_PACKET_PUBLISH
19e90 49 4e 47 4e 41 4d 45 3d 22 24 53 5f 46 50 5f 4f  INGNAME="$S_FP_O
19ea0 52 49 47 2f 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56  RIG/$S_FUNC_MMMV
19eb0 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
19ec0 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 42 4c  KAGER_T1_BASH_BL
19ed0 4f 42 32 46 49 4c 45 4e 41 4d 45 5f 54 31 5f 52  OB2FILENAME_T1_R
19ee0 45 53 55 4c 54 22 0a 20 20 20 20 23 2d 2d 2d 2d  ESULT".    #----
19ef0 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 54 68 65 20  -----.    # The 
19f00 32 3e 20 2f 64 65 76 2f 6e 75 6c 6c 20 70 61 72  2> /dev/null par
19f10 74 20 69 73 20 64 75 65 20 73 6f 6d 65 20 77 65  t is due some we
19f20 69 72 64 20 74 6f 20 42 53 44 20 70 65 63 75 6c  ird to BSD pecul
19f30 69 61 72 69 74 79 2e 20 0a 20 20 20 20 23 20 54  iarity. .    # T
19f40 68 65 20 61 63 74 75 61 6c 20 73 75 63 63 65 73  he actual succes
19f50 73 2f 66 61 69 6c 75 72 65 20 6f 66 20 74 68 65  s/failure of the
19f60 20 6d 76 20 63 6f 6d 6d 61 6e 64 20 69 73 20 74   mv command is t
19f70 65 73 74 65 64 20 61 66 74 65 72 0a 20 20 20 20  ested after.    
19f80 23 20 69 74 73 20 65 78 65 63 75 74 69 6f 6e 20  # its execution 
19f90 61 6e 79 77 61 79 2e 0a 20 20 20 20 6d 76 20 2d  anyway..    mv -
19fa0 66 20 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b  f $S_FP_TMP_SILK
19fb0 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 5f 54  TORRENT_PACKET_T
19fc0 41 52 20 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c  AR $S_FP_TMP_SIL
19fd0 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 5f  KTORRENT_PACKET_
19fe0 50 55 42 4c 49 53 48 49 4e 47 4e 41 4d 45 20 32  PUBLISHINGNAME 2
19ff0 3e 20 2f 64 65 76 2f 6e 75 6c 6c 0a 20 20 20 20  > /dev/null.    
1a000 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69  #---------.    i
1a010 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20  f [ "$?" != "0" 
1a020 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
1a030 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
1a040 65 63 68 6f 20 22 53 6f 6d 65 74 68 69 6e 67 20  echo "Something 
1a050 77 65 6e 74 20 77 72 6f 6e 67 2e 22 0a 20 20 20  went wrong.".   
1a060 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 72       echo "The r
1a070 65 6e 61 6d 69 6e 67 20 61 6e 64 20 63 6f 70 79  enaming and copy
1a080 69 6e 67 20 6f 66 20 22 0a 20 20 20 20 20 20 20  ing of ".       
1a090 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50   echo "    $S_FP
1a0a0 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54  _TMP_SILKTORRENT
1a0b0 5f 50 41 43 4b 45 54 5f 54 41 52 20 22 0a 20 20  _PACKET_TAR ".  
1a0c0 20 20 20 20 20 20 65 63 68 6f 20 22 74 6f 20 22        echo "to "
1a0d0 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
1a0e0 20 20 20 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c     $S_FP_TMP_SIL
1a0f0 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 5f  KTORRENT_PACKET_
1a100 50 55 42 4c 49 53 48 49 4e 47 4e 41 4d 45 20 22  PUBLISHINGNAME "
1a110 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 66  .        echo "f
1a120 61 69 6c 65 64 2e 22 0a 20 20 20 20 20 20 20 20  ailed.".        
1a130 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 32 34 61  echo "GUID=='24a
1a140 64 62 61 62 35 2d 32 37 32 34 2d 34 62 35 36 2d  dbab5-2724-4b56-
1a150 62 31 65 65 2d 32 31 62 31 37 30 65 30 33 31 65  b1ee-21b170e031e
1a160 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
1a170 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
1a180 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
1a190 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
1a1a0 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
1a1b0 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
1a1c0 20 20 20 20 69 66 20 5b 20 21 20 2d 65 20 22 24      if [ ! -e "$
1a1d0 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52  S_FP_TMP_SILKTOR
1a1e0 52 45 4e 54 5f 50 41 43 4b 45 54 5f 50 55 42 4c  RENT_PACKET_PUBL
1a1f0 49 53 48 49 4e 47 4e 41 4d 45 22 20 5d 3b 20 74  ISHINGNAME" ]; t
1a200 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f  hen.        echo
1a210 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
1a220 20 22 53 6f 6d 65 74 68 69 6e 67 20 77 65 6e 74   "Something went
1a230 20 77 72 6f 6e 67 2e 22 0a 20 20 20 20 20 20 20   wrong.".       
1a240 20 65 63 68 6f 20 22 54 68 65 20 72 65 6e 61 6d   echo "The renam
1a250 69 6e 67 20 61 6e 64 20 63 6f 70 79 69 6e 67 20  ing and copying 
1a260 6f 66 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  of ".        ech
1a270 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
1a280 6f 20 22 20 20 20 20 24 53 5f 46 50 5f 54 4d 50  o "    $S_FP_TMP
1a290 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
1a2a0 4b 45 54 5f 54 41 52 20 22 0a 20 20 20 20 20 20  KET_TAR ".      
1a2b0 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
1a2c0 20 20 65 63 68 6f 20 22 74 6f 20 22 0a 20 20 20    echo "to ".   
1a2d0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
1a2e0 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 24       echo "    $
1a2f0 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52  S_FP_TMP_SILKTOR
1a300 52 45 4e 54 5f 50 41 43 4b 45 54 5f 50 55 42 4c  RENT_PACKET_PUBL
1a310 49 53 48 49 4e 47 4e 41 4d 45 20 22 0a 20 20 20  ISHINGNAME ".   
1a320 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
1a330 20 20 20 20 20 65 63 68 6f 20 22 66 61 69 6c 65       echo "faile
1a340 64 2e 20 54 68 65 20 6d 76 20 63 6f 6d 6d 61 6e  d. The mv comman
1a350 64 20 73 75 63 63 65 65 64 2c 20 62 75 74 20 66  d succeed, but f
1a360 6f 72 20 73 6f 6d 65 20 72 65 61 73 6f 6e 20 22  or some reason "
1a370 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 74  .        echo "t
1a380 68 65 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 66  he destination f
1a390 69 6c 65 20 64 6f 65 73 20 6e 6f 74 20 65 78 69  ile does not exi
1a3a0 73 74 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68  st.".        ech
1a3b0 6f 20 22 47 55 49 44 3d 3d 27 36 32 34 39 38 30  o "GUID=='624980
1a3c0 35 64 2d 33 39 37 30 2d 34 61 65 30 2d 38 33 64  5d-3970-4ae0-83d
1a3d0 65 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22  e-21b170e031e7'"
1a3e0 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
1a3f0 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
1a400 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
1a410 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69  ORIG.        exi
1a420 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
1a430 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20  error.    fi.   
1a440 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66   #--------.    f
1a450 75 6e 63 5f 6d 6d 6d 76 5f 64 65 6c 65 74 65 5f  unc_mmmv_delete_
1a460 74 6d 70 5f 66 6f 6c 64 65 72 5f 74 31 20 22 24  tmp_folder_t1 "$
1a470 53 5f 46 50 5f 54 4d 50 5f 30 22 0a 20 20 20 20  S_FP_TMP_0".    
1a480 69 66 20 5b 20 2d 65 20 22 24 53 5f 46 50 5f 54  if [ -e "$S_FP_T
1a490 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  MP_0" ]; then.  
1a4a0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
1a4b0 20 20 20 20 20 20 65 63 68 6f 20 22 53 6f 6d 65        echo "Some
1a4c0 74 68 69 6e 67 20 77 65 6e 74 20 77 72 6f 6e 67  thing went wrong
1a4d0 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
1a4e0 22 54 68 65 20 64 65 6c 65 74 69 6f 6e 20 6f 66  "The deletion of
1a4f0 20 74 68 65 20 74 65 6d 70 6f 72 61 72 79 20 66   the temporary f
1a500 6f 6c 64 65 72 2c 20 22 0a 20 20 20 20 20 20 20  older, ".       
1a510 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
1a520 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50   echo "    $S_FP
1a530 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20  _TMP_0".        
1a540 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
1a550 65 63 68 6f 20 22 66 61 69 6c 65 64 2e 22 0a 20  echo "failed.". 
1a560 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
1a570 44 3d 3d 27 32 62 35 65 61 37 36 61 2d 39 63 62  D=='2b5ea76a-9cb
1a580 63 2d 34 62 31 37 2d 61 34 64 65 2d 32 31 62 31  c-4b17-a4de-21b1
1a590 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
1a5a0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
1a5b0 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
1a5c0 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
1a5d0 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
1a5e0 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
1a5f0 20 20 20 20 66 69 0a 7d 20 23 20 66 75 6e 63 5f      fi.} # func_
1a600 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74  mmmv_silktorrent
1a610 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73  _packager_t1_bas
1a620 68 5f 77 72 61 70 5f 74 31 0a 0a 0a 23 2d 2d 2d  h_wrap_t1...#---
1a630 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a640 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a650 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a660 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a670 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d  -------..func_mm
1a680 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70  mv_silktorrent_p
1a690 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f  ackager_t1_bash_
1a6a0 75 6e 77 72 61 70 5f 74 31 28 29 20 7b 0a 20 20  unwrap_t1() {.  
1a6b0 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 30 3d 22    local S_FP_0="
1a6c0 24 31 22 20 23 20 50 61 74 68 20 74 6f 20 74 68  $1" # Path to th
1a6d0 65 20 66 69 6c 65 2e 20 0a 20 20 20 20 23 2d 2d  e file. .    #--
1a6e0 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  --.    func_mmmv
1a6f0 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  _silktorrent_pac
1a700 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 65 78  kager_t1_bash_ex
1a710 63 5f 61 73 73 65 72 74 5f 77 72 61 70 70 61 62  c_assert_wrappab
1a720 6c 65 5f 66 69 6c 65 5f 65 78 69 73 74 73 5f 74  le_file_exists_t
1a730 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20 20  1 "$S_FP_0".    
1a740 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66 75  #--------.    fu
1a750 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72  nc_mmmv_silktorr
1a760 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f  ent_packager_t1_
1a770 62 61 73 68 5f 76 65 72 69 66 79 5f 66 69 6c 65  bash_verify_file
1a780 5f 6e 61 6d 65 5f 74 31 20 22 24 53 5f 46 50 5f  _name_t1 "$S_FP_
1a790 30 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 50  0".    local S_P
1a7a0 41 43 4b 45 54 5f 46 4f 52 4d 41 54 3d 22 24 53  ACKET_FORMAT="$S
1a7b0 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54  _FUNC_MMMV_SILKT
1a7c0 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
1a7d0 54 31 5f 42 41 53 48 5f 47 45 54 5f 50 41 43 4b  T1_BASH_GET_PACK
1a7e0 45 54 5f 46 4f 52 4d 41 54 5f 56 45 52 53 49 4f  ET_FORMAT_VERSIO
1a7f0 4e 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20 20 20  N_T1_RESULT".   
1a800 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d   if [ "$S_FUNC_M
1a810 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  MMV_SILKTORRENT_
1a820 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48  PACKAGER_T1_BASH
1a830 5f 56 45 52 49 46 59 5f 46 49 4c 45 5f 4e 41 4d  _VERIFY_FILE_NAM
1a840 45 5f 54 31 5f 52 45 53 55 4c 54 22 20 21 3d 20  E_T1_RESULT" != 
1a850 22 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 70 61  "verification_pa
1a860 73 73 65 64 22 20 5d 3b 20 74 68 65 6e 0a 20 20  ssed" ]; then.  
1a870 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
1a880 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
1a890 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63 6b  Silktorrent pack
1a8a0 65 74 20 63 61 6e 64 69 64 61 74 65 2c 20 22 0a  et candidate, ".
1a8b0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
1a8c0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
1a8d0 20 20 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 20    $S_FP_0".     
1a8e0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
1a8f0 20 20 20 65 63 68 6f 20 22 66 61 69 6c 65 64 20     echo "failed 
1a900 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63 6b  Silktorrent pack
1a910 65 74 20 6e 61 6d 65 20 76 65 72 69 66 69 63 61  et name verifica
1a920 74 69 6f 6e 2e 22 0a 20 20 20 20 20 20 20 20 65  tion.".        e
1a930 63 68 6f 20 22 54 68 65 72 65 20 65 78 69 73 74  cho "There exist
1a940 73 20 61 20 70 6f 73 73 69 62 69 6c 69 74 79 20  s a possibility 
1a950 74 68 61 74 20 74 68 65 20 22 0a 20 20 20 20 20  that the ".     
1a960 20 20 20 65 63 68 6f 20 22 53 69 6c 6b 74 6f 72     echo "Silktor
1a970 72 65 6e 74 20 70 61 63 6b 65 74 20 63 61 6e 64  rent packet cand
1a980 69 64 61 74 65 20 69 73 20 61 63 74 75 61 6c 6c  idate is actuall
1a990 79 20 4f 4b 2c 20 62 75 74 20 22 0a 20 20 20 20  y OK, but ".    
1a9a0 20 20 20 20 65 63 68 6f 20 22 74 68 69 73 20 69      echo "this i
1a9b0 73 20 61 6e 20 6f 6c 64 65 72 20 76 65 72 73 69  s an older versi
1a9c0 6f 6e 20 6f 66 20 74 68 65 20 53 69 6c 6b 74 6f  on of the Silkto
1a9d0 72 72 65 6e 74 20 69 6d 70 6c 65 6d 65 6e 74 61  rrent implementa
1a9e0 74 69 6f 6e 20 61 6e 64 20 22 0a 20 20 20 20 20  tion and ".     
1a9f0 20 20 20 65 63 68 6f 20 22 74 68 69 73 2c 20 74     echo "this, t
1aa00 68 65 20 6f 6c 64 65 72 2c 20 76 65 72 73 69 6f  he older, versio
1aa10 6e 20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f  n does not suppo
1aa20 72 74 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  rt ".        ech
1aa30 6f 20 22 6e 65 77 65 72 20 53 69 6c 6b 74 6f 72  o "newer Silktor
1aa40 72 65 6e 74 20 70 61 63 6b 65 74 20 66 6f 72 6d  rent packet form
1aa50 61 74 73 2e 20 22 0a 20 20 20 20 20 20 20 20 65  ats. ".        e
1aa60 63 68 6f 20 22 47 55 49 44 3d 3d 27 34 39 36 33  cho "GUID=='4963
1aa70 63 31 61 64 2d 66 33 62 34 2d 34 34 38 62 2d 62  c1ad-f3b4-448b-b
1aa80 33 64 65 2d 32 31 62 31 37 30 65 30 33 31 65 37  3de-21b170e031e7
1aa90 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  '".        echo 
1aaa0 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  "".        #----
1aab0 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
1aac0 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
1aad0 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
1aae0 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20  h error.    fi. 
1aaf0 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
1ab00 20 6c 6f 63 61 6c 20 53 42 5f 46 4f 52 4d 41 54   local SB_FORMAT
1ab10 5f 42 52 41 4e 43 48 5f 45 58 49 53 54 53 5f 49  _BRANCH_EXISTS_I
1ab20 4e 5f 54 48 49 53 5f 46 55 4e 43 54 49 4f 4e 3d  N_THIS_FUNCTION=
1ab30 22 66 22 0a 20 20 20 20 69 66 20 5b 20 22 24 53  "f".    if [ "$S
1ab40 5f 50 41 43 4b 45 54 5f 46 4f 52 4d 41 54 22 20  _PACKET_FORMAT" 
1ab50 3d 3d 20 22 73 69 6c 6b 74 6f 72 72 65 6e 74 5f  == "silktorrent_
1ab60 70 61 63 6b 65 74 5f 66 6f 72 6d 61 74 5f 76 65  packet_format_ve
1ab70 72 73 69 6f 6e 5f 31 22 20 5d 3b 20 74 68 65 6e  rsion_1" ]; then
1ab80 0a 20 20 20 20 20 20 20 20 53 42 5f 46 4f 52 4d  .        SB_FORM
1ab90 41 54 5f 42 52 41 4e 43 48 5f 45 58 49 53 54 53  AT_BRANCH_EXISTS
1aba0 5f 49 4e 5f 54 48 49 53 5f 46 55 4e 43 54 49 4f  _IN_THIS_FUNCTIO
1abb0 4e 3d 22 74 22 0a 20 20 20 20 20 20 20 20 23 2d  N="t".        #-
1abc0 2d 2d 2d 0a 20 20 20 20 20 20 20 20 6c 6f 63 61  ---.        loca
1abd0 6c 20 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54  l S_FP_TMP_SILKT
1abe0 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 3d 22 60  ORRENT_PACKET="`
1abf0 70 77 64 60 2f 73 69 6c 6b 74 6f 72 72 65 6e 74  pwd`/silktorrent
1ac00 5f 70 61 63 6b 65 74 22 0a 20 20 20 20 20 20 20  _packet".       
1ac10 20 69 66 20 5b 20 2d 65 20 24 53 5f 46 50 5f 54   if [ -e $S_FP_T
1ac20 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50  MP_SILKTORRENT_P
1ac30 41 43 4b 45 54 20 5d 3b 20 74 68 65 6e 0a 20 20  ACKET ]; then.  
1ac40 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
1ac50 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
1ac60 68 6f 20 22 54 6f 20 61 76 6f 69 64 20 61 63 63  ho "To avoid acc
1ac70 69 64 65 6e 74 61 6c 20 64 65 6c 65 74 69 6f 6e  idental deletion
1ac80 20 6f 66 20 66 69 6c 65 73 2c 20 22 0a 20 20 20   of files, ".   
1ac90 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 61           echo "a
1aca0 6e 64 20 73 6f 6d 65 20 6f 74 68 65 72 20 74 79  nd some other ty
1acb0 70 65 73 20 6f 66 20 66 6c 61 77 73 2c 20 22 0a  pes of flaws, ".
1acc0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
1acd0 20 22 74 68 65 72 65 20 69 73 20 61 20 72 65 71   "there is a req
1ace0 75 69 72 65 6d 65 6e 74 20 74 68 61 74 20 74 68  uirement that th
1acf0 65 20 66 6f 6c 64 65 72 20 22 0a 20 20 20 20 20  e folder ".     
1ad00 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
1ad10 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
1ad20 22 20 20 20 20 2e 2f 73 69 6c 6b 74 6f 72 72 65  "    ./silktorre
1ad30 6e 74 5f 70 61 63 6b 65 74 22 0a 20 20 20 20 20  nt_packet".     
1ad40 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
1ad50 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
1ad60 22 6d 75 73 74 20 62 65 20 65 78 70 6c 69 63 69  "must be explici
1ad70 74 6c 79 20 64 65 6c 65 74 65 64 20 62 65 66 6f  tly deleted befo
1ad80 72 65 20 63 61 6c 6c 69 6e 67 20 74 68 69 73 20  re calling this 
1ad90 73 63 72 69 70 74 2e 22 0a 20 20 20 20 20 20 20  script.".       
1ada0 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
1adb0 3d 27 32 33 63 34 35 61 61 34 2d 61 31 31 61 2d  ='23c45aa4-a11a-
1adc0 34 34 36 35 2d 62 38 64 65 2d 32 31 62 31 37 30  4465-b8de-21b170
1add0 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
1ade0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
1adf0 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20           #----. 
1ae00 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53             cd $S
1ae10 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
1ae20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
1ae30 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
1ae40 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20        fi.       
1ae50 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 74   #----.        t
1ae60 61 72 20 2d 78 66 20 24 53 5f 46 50 5f 30 20 32  ar -xf $S_FP_0 2
1ae70 3e 2f 64 65 76 2f 6e 75 6c 6c 0a 20 20 20 20 20  >/dev/null.     
1ae80 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20     if [ "$?" != 
1ae90 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  "0" ]; then.    
1aea0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
1aeb0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
1aec0 20 22 53 6f 6d 65 74 68 69 6e 67 20 77 65 6e 74   "Something went
1aed0 20 77 72 6f 6e 67 2e 20 54 68 65 20 63 6f 6d 6d   wrong. The comm
1aee0 61 6e 64 20 22 0a 20 20 20 20 20 20 20 20 20 20  and ".          
1aef0 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
1af00 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20        echo "    
1af10 74 61 72 20 2d 78 66 20 24 53 5f 46 50 5f 30 22  tar -xf $S_FP_0"
1af20 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
1af30 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
1af40 20 65 63 68 6f 20 22 65 78 69 74 65 64 20 77 69   echo "exited wi
1af50 74 68 20 61 6e 20 65 72 72 6f 72 20 63 6f 64 65  th an error code
1af60 2c 20 77 68 69 63 68 20 69 73 20 24 3f 20 2e 22  , which is $? ."
1af70 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
1af80 6f 20 22 47 55 49 44 3d 3d 27 61 34 38 62 65 30  o "GUID=='a48be0
1af90 30 33 2d 34 35 39 37 2d 34 31 37 31 2d 62 35 64  03-4597-4171-b5d
1afa0 65 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22  e-21b170e031e7'"
1afb0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
1afc0 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
1afd0 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20   #----.         
1afe0 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
1aff0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69  .            exi
1b000 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
1b010 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69  error.        fi
1b020 0a 20 20 20 20 20 20 20 20 72 6d 20 2d 66 20 24  .        rm -f $
1b030 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52  S_FP_TMP_SILKTOR
1b040 52 45 4e 54 5f 50 41 43 4b 45 54 2f 68 65 61 64  RENT_PACKET/head
1b050 65 72 2f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 73  er/silktorrent_s
1b060 61 6c 74 2e 74 78 74 0a 20 20 20 20 20 20 20 20  alt.txt.        
1b070 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66  #----.        if
1b080 20 5b 20 21 20 2d 65 20 24 53 5f 46 50 5f 54 4d   [ ! -e $S_FP_TM
1b090 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41  P_SILKTORRENT_PA
1b0a0 43 4b 45 54 20 5d 3b 20 74 68 65 6e 0a 20 20 20  CKET ]; then.   
1b0b0 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
1b0c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
1b0d0 6f 20 22 53 6f 6d 65 74 68 69 6e 67 20 77 65 6e  o "Something wen
1b0e0 74 20 77 72 6f 6e 67 2e 20 22 0a 20 20 20 20 20  t wrong. ".     
1b0f0 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65         echo "The
1b100 20 75 6e 70 61 63 6b 69 6e 67 20 6f 66 20 74 68   unpacking of th
1b110 65 20 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61  e Silktorrent pa
1b120 63 6b 65 74 20 77 69 74 68 20 74 68 65 20 70 61  cket with the pa
1b130 74 68 20 6f 66 20 22 0a 20 20 20 20 20 20 20 20  th of ".        
1b140 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
1b150 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
1b160 20 20 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 20    $S_FP_0".     
1b170 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
1b180 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
1b190 22 66 61 69 6c 65 64 2e 20 54 68 65 20 66 6f 6c  "failed. The fol
1b1a0 64 65 72 20 5c 22 73 69 6c 6b 74 6f 72 72 65 6e  der \"silktorren
1b1b0 74 5f 70 61 63 6b 65 74 5c 22 20 22 0a 20 20 20  t_packet\" ".   
1b1c0 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69           echo "i
1b1d0 73 20 6d 69 73 73 69 6e 67 20 61 66 74 65 72 20  s missing after 
1b1e0 74 68 65 20 5c 22 74 61 72 5c 22 20 65 78 69 74  the \"tar\" exit
1b1f0 65 64 20 77 69 74 68 6f 75 74 20 61 6e 79 20 65  ed without any e
1b200 72 72 6f 72 73 2e 22 0a 20 20 20 20 20 20 20 20  rrors.".        
1b210 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
1b220 27 66 64 31 33 65 36 35 34 2d 35 34 64 63 2d 34  'fd13e654-54dc-4
1b230 66 63 30 2d 38 34 63 65 2d 32 31 62 31 37 30 65  fc0-84ce-21b170e
1b240 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
1b250 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
1b260 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
1b270 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f            cd $S_
1b280 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
1b290 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
1b2a0 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
1b2b0 20 20 20 20 20 66 69 0a 20 20 20 20 66 69 20 23       fi.    fi #
1b2c0 20 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63   silktorrent_pac
1b2d0 6b 65 74 5f 66 6f 72 6d 61 74 5f 76 65 72 73 69  ket_format_versi
1b2e0 6f 6e 5f 31 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  on_1.    #------
1b2f0 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 42  --.    if [ "$SB
1b300 5f 46 4f 52 4d 41 54 5f 42 52 41 4e 43 48 5f 45  _FORMAT_BRANCH_E
1b310 58 49 53 54 53 5f 49 4e 5f 54 48 49 53 5f 46 55  XISTS_IN_THIS_FU
1b320 4e 43 54 49 4f 4e 22 20 21 3d 20 22 74 22 20 5d  NCTION" != "t" ]
1b330 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65  ; then.        e
1b340 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
1b350 63 68 6f 20 22 54 68 69 73 20 73 63 72 69 70 74  cho "This script
1b360 20 69 73 20 66 6c 61 77 65 64 2e 22 0a 20 20 20   is flawed.".   
1b370 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 72 65       echo "There
1b380 20 69 73 20 61 74 20 6c 65 61 73 74 20 6f 6e 65   is at least one
1b390 20 62 72 61 6e 63 68 20 6d 69 73 73 69 6e 67 20   branch missing 
1b3a0 66 72 6f 6d 20 74 68 69 73 20 66 75 6e 63 74 69  from this functi
1b3b0 6f 6e 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68  on.".        ech
1b3c0 6f 20 22 47 55 49 44 3d 3d 27 31 65 34 38 64 39  o "GUID=='1e48d9
1b3d0 37 62 2d 30 63 66 64 2d 34 31 39 66 2d 61 32 63  7b-0cfd-419f-a2c
1b3e0 65 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22  e-21b170e031e7'"
1b3f0 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
1b400 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
1b410 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
1b420 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69  ORIG.        exi
1b430 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
1b440 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20  error.    fi.   
1b450 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23 20 66   #--------.} # f
1b460 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72  unc_mmmv_silktor
1b470 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31  rent_packager_t1
1b480 5f 62 61 73 68 5f 75 6e 77 72 61 70 5f 74 31 0a  _bash_unwrap_t1.
1b490 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
1b4a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b4b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b4c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b4d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66  -------------..f
1b4e0 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72  unc_mmmv_silktor
1b4f0 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31  rent_packager_t1
1b500 5f 62 61 73 68 5f 76 65 72 69 66 79 5f 70 61 63  _bash_verify_pac
1b510 6b 65 74 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f  ket_name_format_
1b520 76 31 28 29 7b 0a 20 20 20 20 6c 6f 63 61 6c 20  v1(){.    local 
1b530 53 5f 50 41 43 4b 45 54 5f 4e 41 4d 45 5f 43 41  S_PACKET_NAME_CA
1b540 4e 44 49 44 41 54 45 3d 22 24 31 22 20 0a 20 20  NDIDATE="$1" .  
1b550 20 20 69 66 20 5b 20 22 24 53 5f 50 41 43 4b 45    if [ "$S_PACKE
1b560 54 5f 4e 41 4d 45 5f 43 41 4e 44 49 44 41 54 45  T_NAME_CANDIDATE
1b570 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a  " == "" ]; then.
1b580 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
1b590 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
1b5a0 69 73 20 73 63 72 69 70 74 20 69 73 20 66 6c 61  is script is fla
1b5b0 77 65 64 2e 22 0a 20 20 20 20 20 20 20 20 65 63  wed.".        ec
1b5c0 68 6f 20 22 49 6e 70 75 74 20 76 65 72 69 66 69  ho "Input verifi
1b5d0 63 61 74 69 6f 6e 20 73 68 6f 75 6c 64 20 68 61  cation should ha
1b5e0 76 65 20 63 61 75 67 68 74 20 74 68 65 20 22 0a  ve caught the ".
1b5f0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 5c 22          echo "\"
1b600 5c 22 20 63 61 73 65 20 62 65 66 6f 72 65 20 74  \" case before t
1b610 68 65 20 63 6f 6e 74 72 6f 6c 20 66 6c 6f 77 20  he control flow 
1b620 72 65 61 63 68 65 73 20 74 68 69 73 20 6c 69 6e  reaches this lin
1b630 65 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  e.".        echo
1b640 20 22 47 55 49 44 3d 3d 27 65 34 35 35 65 63 34   "GUID=='e455ec4
1b650 61 2d 65 34 37 62 2d 34 33 30 30 2d 62 32 63 65  a-e47b-4300-b2ce
1b660 2d 32 31 62 31 37 30 65 30 33 31 65 37 27 22 0a  -21b170e031e7'".
1b670 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
1b680 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
1b690 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f        cd $S_FP_O
1b6a0 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74  RIG.        exit
1b6b0 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
1b6c0 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20  rror.    fi.    
1b6d0 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 6c 6f  #--------.    lo
1b6e0 63 61 6c 20 53 5f 4f 55 54 3d 22 76 65 72 69 66  cal S_OUT="verif
1b6f0 69 63 61 74 69 6f 6e 5f 66 61 69 6c 65 64 22 20  ication_failed" 
1b700 23 20 6f 70 70 6f 73 69 74 65 3a 20 22 76 65 72  # opposite: "ver
1b710 69 66 69 63 61 74 69 6f 6e 5f 70 61 73 73 65 64  ification_passed
1b720 22 0a 0a 20 20 20 20 23 20 20 20 20 20 20 20 20  "..    #        
1b730 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b740 20 72 67 78 5f 69 6e 5f 72 75 62 79 3d 2f 76 5b   rgx_in_ruby=/v[
1b750 5c 64 5d 7b 34 7d 5b 5f 5d 2f 0a 20 20 20 20 23  \d]{4}[_]/.    #
1b760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b770 20 20 20 20 20 20 20 20 20 72 67 78 5f 69 6e 5f           rgx_in_
1b780 72 75 62 79 3d 2f 73 5b 5c 64 5d 2b 5b 5f 5d 2f  ruby=/s[\d]+[_]/
1b790 0a 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20  .    #          
1b7a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72                 r
1b7b0 67 78 5f 69 6e 5f 72 75 62 79 3d 2f 68 5b 5c 64  gx_in_ruby=/h[\d
1b7c0 61 62 63 64 65 66 5d 7b 36 34 7d 5b 5f 5d 2f 0a  abcdef]{64}[_]/.
1b7d0 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20 20      #           
1b7e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 67                rg
1b7f0 78 5f 69 6e 5f 72 75 62 79 3d 2f 69 5b 5c 64 61  x_in_ruby=/i[\da
1b800 62 63 64 65 66 5d 7b 34 38 7d 24 2f 20 20 20 23  bcdef]{48}$/   #
1b810 20 6c 61 63 6b 73 20 74 68 65 20 65 6e 64 69 6e   lacks the endin
1b820 67 20 22 5f 22 20 0a 20 20 20 20 23 20 20 20 20  g "_" .    #    
1b830 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b850 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b860 20 20 20 20 20 20 23 20 66 6f 72 20 64 62 20 69        # for db i
1b870 6e 64 65 78 20 6f 70 74 69 6d 69 7a 61 74 69 6f  ndex optimizatio
1b880 6e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  n.    #---------
1b890 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b8a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b8b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b8c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b8d0 2d 2d 2d 2d 2d 0a 20 20 20 20 23 6c 6f 63 61 6c  -----.    #local
1b8e0 20 53 5f 52 55 42 59 5f 52 45 47 45 58 3d 22 2f   S_RUBY_REGEX="/
1b8f0 5e 58 5b 5c 5c 64 61 62 63 64 65 66 5d 7b 34 38  ^X[\\dabcdef]{48
1b900 7d 69 5b 5f 5d 5b 5c 5c 64 61 62 63 64 65 66 5d  }i[_][\\dabcdef]
1b910 7b 36 34 7d 68 5b 5f 5d 5b 5c 5c 64 5d 2b 73 5b  {64}h[_][\\d]+s[
1b920 5f 5d 5b 5c 5c 64 5d 7b 34 7d 76 2e 73 74 62 6c  _][\\d]{4}v.stbl
1b930 6f 62 58 5c 24 2f 22 0a 20 20 20 20 23 20 20 20  obX\$/".    #   
1b940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b950 20 20 20 20 20 20 20 20 20 20 54 69 67 65 72 20            Tiger 
1b960 20 20 20 20 20 20 20 20 20 20 20 20 53 48 41 2d              SHA-
1b970 32 35 36 20 20 20 20 20 20 20 73 69 7a 65 20 20  256       size  
1b980 20 20 20 76 65 72 73 69 6f 6e 0a 20 20 20 20 6c     version.    l
1b990 6f 63 61 6c 20 53 5f 52 55 42 59 5f 52 45 47 45  ocal S_RUBY_REGE
1b9a0 58 3d 22 2f 5e 58 5b 5c 5c 64 61 62 63 64 65 66  X="/^X[\\dabcdef
1b9b0 5d 7b 34 38 7d 69 5b 5f 5d 5b 5c 5c 64 61 62 63  ]{48}i[_][\\dabc
1b9c0 64 65 66 5d 7b 36 34 7d 68 5b 5f 5d 5b 5c 5c 64  def]{64}h[_][\\d
1b9d0 5d 2b 73 5b 5f 5d 31 30 30 30 76 2e 73 74 62 6c  ]+s[_]1000v.stbl
1b9e0 6f 62 58 5c 24 2f 22 0a 20 20 20 20 23 2d 2d 2d  obX\$/".    #---
1b9f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ba00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ba10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ba20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ba30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20  -----------.    
1ba40 23 20 74 65 73 74 20 63 61 73 65 73 3a 20 0a 20  # test cases: . 
1ba50 20 20 20 23 20 20 20 20 20 72 75 62 79 20 2d 65     #     ruby -e
1ba60 20 22 70 75 74 73 28 41 52 47 56 5b 30 5d 29 22   "puts(ARGV[0])"
1ba70 20 61 61 5c 20 62 62 0a 20 20 20 20 23 20 20 20   aa\ bb.    #   
1ba80 20 20 70 72 69 6e 74 66 20 25 73 20 22 25 71 22    printf %s "%q"
1ba90 20 22 41 41 20 42 42 20 43 43 20 24 5e 20 5c 20   "AA BB CC $^ \ 
1baa0 2f 20 27 5c 60 5c 22 20 3c 3e 28 29 5b 5d 3b 2e  / '\`\" <>()[];.
1bab0 7b 7d 22 20 7c 20 78 61 72 67 73 20 72 75 62 79  {}" | xargs ruby
1bac0 20 2d 65 20 22 70 75 74 73 28 41 52 47 56 5b 30   -e "puts(ARGV[0
1bad0 5d 29 22 0a 20 20 20 20 23 20 0a 20 20 20 20 23  ])".    # .    #
1bae0 20 54 68 65 20 53 5f 50 41 43 4b 45 54 5f 4e 41   The S_PACKET_NA
1baf0 4d 45 5f 43 41 4e 44 49 44 41 54 45 20 6d 69 67  ME_CANDIDATE mig
1bb00 68 74 20 63 6f 6e 74 61 69 6e 20 76 61 72 69 6f  ht contain vario
1bb10 75 73 20 71 75 6f 74 61 74 69 6f 6e 20 6d 61 72  us quotation mar
1bb20 6b 73 2e 0a 20 20 20 20 23 20 49 66 20 69 74 20  ks..    # If it 
1bb30 64 6f 65 73 2c 20 74 68 65 6e 20 68 6f 70 65 66  does, then hopef
1bb40 75 6c 6c 79 20 69 74 20 63 72 61 73 68 65 73 20  ully it crashes 
1bb50 61 74 20 6c 65 61 73 74 20 73 6f 6d 65 74 68 69  at least somethi
1bb60 6e 67 20 73 6f 20 74 68 61 74 0a 20 20 20 20 23  ng so that.    #
1bb70 20 74 68 65 20 63 72 61 73 68 20 63 61 6e 20 62   the crash can b
1bb80 65 20 64 65 74 65 63 74 65 64 20 66 72 6f 6d 20  e detected from 
1bb90 74 68 65 20 22 24 3f 22 2e 20 0a 20 20 20 20 23  the "$?". .    #
1bba0 20 54 68 65 20 73 75 72 72 6f 75 6e 64 69 6e 67   The surrounding
1bbb0 20 58 2d 65 73 2c 20 58 3c 70 61 63 6b 65 74 20   X-es, X<packet 
1bbc0 6e 61 6d 65 20 63 61 6e 64 69 64 61 74 65 20 73  name candidate s
1bbd0 74 72 69 6e 67 3e 58 2c 20 0a 20 20 20 20 23 20  tring>X, .    # 
1bbe0 61 72 65 20 74 6f 20 63 6f 75 6e 74 65 72 20 61  are to counter a
1bbf0 20 73 69 74 75 61 74 69 6f 6e 2c 20 77 68 65 72   situation, wher
1bc00 65 20 74 68 65 20 66 69 6c 65 20 6e 61 6d 65 20  e the file name 
1bc10 63 61 6e 64 69 64 61 74 65 20 65 6e 64 73 0a 20  candidate ends. 
1bc20 20 20 20 23 20 77 69 74 68 20 61 20 73 70 61 63     # with a spac
1bc30 65 2c 20 6c 69 6b 65 20 22 66 6f 6f 20 22 20 61  e, like "foo " a
1bc40 6e 64 20 74 68 65 20 42 61 73 68 20 72 65 61 64  nd the Bash read
1bc50 73 20 74 68 65 20 63 6f 6e 73 6f 6c 65 0a 20 20  s the console.  
1bc60 20 20 23 20 61 72 67 75 6d 65 6e 74 20 69 6e 20    # argument in 
1bc70 61 73 20 22 66 6f 6f 22 20 69 6e 20 73 74 65 61  as "foo" in stea
1bc80 64 20 6f 66 20 74 68 65 20 22 66 6f 6f 20 22 2e  d of the "foo ".
1bc90 20 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20   .    #----.    
1bca0 23 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 30 3d 22  #local S_TMP_0="
1bcb0 60 70 72 69 6e 74 66 20 20 5c 22 25 71 5c 22 20  `printf  \"%q\" 
1bcc0 5c 22 27 24 53 5f 50 41 43 4b 45 54 5f 4e 41 4d  \"'$S_PACKET_NAM
1bcd0 45 5f 43 41 4e 44 49 44 41 54 45 27 5c 22 20 7c  E_CANDIDATE'\" |
1bce0 20 78 61 72 67 73 20 72 75 62 79 20 2d 65 20 5c   xargs ruby -e \
1bcf0 22 20 5c 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f  " \.    local S_
1bd00 54 4d 50 5f 30 3d 22 60 72 75 62 79 20 2d 65 20  TMP_0="`ruby -e 
1bd10 5c 22 20 5c 0a 20 20 20 20 20 20 20 20 73 5f 69  \" \.        s_i
1bd20 6e 3d 41 52 47 56 5b 30 5d 3b 5c 0a 20 20 20 20  n=ARGV[0];\.    
1bd30 20 20 20 20 72 67 78 3d 24 53 5f 52 55 42 59 5f      rgx=$S_RUBY_
1bd40 52 45 47 45 58 3b 5c 0a 20 20 20 20 20 20 20 20  REGEX;\.        
1bd50 6d 64 3d 73 5f 69 6e 2e 6d 61 74 63 68 28 72 67  md=s_in.match(rg
1bd60 78 29 3b 5c 0a 20 20 20 20 20 20 20 20 73 5f 6f  x);\.        s_o
1bd70 75 74 3d 27 6e 6f 5f 6d 61 74 63 68 27 3b 5c 0a  ut='no_match';\.
1bd80 20 20 20 20 20 20 20 20 69 66 28 6d 64 21 3d 6e          if(md!=n
1bd90 69 6c 29 20 74 68 65 6e 20 5c 0a 20 20 20 20 20  il) then \.     
1bda0 20 20 20 20 20 20 20 73 5f 6f 75 74 3d 27 6d 61         s_out='ma
1bdb0 74 63 68 27 3b 5c 0a 20 20 20 20 20 20 20 20 65  tch';\.        e
1bdc0 6e 64 3b 5c 0a 20 20 20 20 20 20 20 20 70 72 69  nd;\.        pri
1bdd0 6e 74 66 28 73 5f 6f 75 74 29 3b 5c 0a 20 20 20  ntf(s_out);\.   
1bde0 20 20 20 20 20 5c 22 20 5c 22 24 53 5f 50 41 43       \" \"$S_PAC
1bdf0 4b 45 54 5f 4e 41 4d 45 5f 43 41 4e 44 49 44 41  KET_NAME_CANDIDA
1be00 54 45 5c 22 20 60 22 0a 20 20 20 20 23 2d 2d 2d  TE\" `".    #---
1be10 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20  -.    if [ "$?" 
1be20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20  != "0" ]; then. 
1be30 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
1be40 20 20 20 20 20 20 20 65 63 68 6f 20 22 53 6f 6d         echo "Som
1be50 65 74 68 69 6e 67 20 77 65 6e 74 20 77 72 6f 6e  ething went wron
1be60 67 2e 20 5c 24 3f 3d 3d 24 3f 20 22 0a 20 20 20  g. \$?==$? ".   
1be70 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 53       echo "    S
1be80 5f 50 41 43 4b 45 54 5f 4e 41 4d 45 5f 43 41 4e  _PACKET_NAME_CAN
1be90 44 49 44 41 54 45 3d 3d 24 53 5f 50 41 43 4b 45  DIDATE==$S_PACKE
1bea0 54 5f 4e 41 4d 45 5f 43 41 4e 44 49 44 41 54 45  T_NAME_CANDIDATE
1beb0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
1bec0 47 55 49 44 3d 3d 27 31 34 65 37 39 30 37 32 2d  GUID=='14e79072-
1bed0 34 30 64 62 2d 34 66 36 31 2d 39 66 63 65 2d 32  40db-4f61-9fce-2
1bee0 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20  1b170e031e7'".  
1bef0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
1bf00 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
1bf10 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
1bf20 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31  G.        exit 1
1bf30 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
1bf40 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  or.    fi.    #-
1bf50 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 49 66  -------.    # If
1bf60 20 74 68 65 20 66 69 6c 65 20 6e 61 6d 65 20 73   the file name s
1bf70 74 61 72 74 73 20 6c 69 6b 65 20 22 2e 2f 66 6f  tarts like "./fo
1bf80 6f 22 20 69 6e 20 73 74 65 61 64 20 6f 66 20 22  o" in stead of "
1bf90 66 6f 6f 22 2c 20 0a 20 20 20 20 23 20 74 68 65  foo", .    # the
1bfa0 6e 20 74 68 65 20 76 65 72 69 66 69 63 61 74 69  n the verificati
1bfb0 6f 6e 20 61 6c 73 6f 20 66 61 69 6c 73 2c 20 0a  on also fails, .
1bfc0 20 20 20 20 23 20 65 78 61 63 74 6c 79 20 61 73      # exactly as
1bfd0 20 65 78 70 65 63 74 65 64 20 61 6e 64 20 64 65   expected and de
1bfe0 6d 61 6e 64 65 64 20 62 79 20 74 68 65 20 73 70  manded by the sp
1bff0 65 63 2e 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ec..    if [ "$S
1c000 5f 54 4d 50 5f 30 22 20 3d 3d 20 22 6d 61 74 63  _TMP_0" == "matc
1c010 68 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  h" ]; then.     
1c020 20 20 20 53 5f 4f 55 54 3d 22 76 65 72 69 66 69     S_OUT="verifi
1c030 63 61 74 69 6f 6e 5f 70 61 73 73 65 64 22 20 23  cation_passed" #
1c040 20 6f 70 70 6f 73 69 74 65 3a 20 22 76 65 72 69   opposite: "veri
1c050 66 69 63 61 74 69 6f 6e 5f 66 61 69 6c 65 64 22  fication_failed"
1c060 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
1c070 2d 2d 2d 2d 2d 0a 20 20 20 20 65 63 68 6f 20 22  -----.    echo "
1c080 24 53 5f 4f 55 54 22 0a 7d 20 23 20 66 75 6e 63  $S_OUT".} # func
1c090 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
1c0a0 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61  t_packager_t1_ba
1c0b0 73 68 5f 76 65 72 69 66 79 5f 70 61 63 6b 65 74  sh_verify_packet
1c0c0 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f 76 31 0a  _name_format_v1.
1c0d0 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
1c0e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c0f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c100 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c110 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 23  -------------..#
1c120 20 54 68 65 20 0a 53 5f 53 49 4c 4b 54 4f 52 52   The .S_SILKTORR
1c130 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f  ENT_PACKAGER_T1_
1c140 41 43 54 49 4f 4e 3d 22 22 20 23 20 69 73 20 67  ACTION="" # is g
1c150 6c 6f 62 61 6c 20 74 6f 20 61 6c 6c 6f 77 20 69  lobal to allow i
1c160 74 20 74 6f 20 62 65 20 75 73 65 64 20 69 6e 20  t to be used in 
1c170 74 68 65 20 0a 20 20 20 20 20 20 20 20 20 20 20  the .           
1c180 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1c190 20 20 20 20 20 20 20 20 20 23 20 65 72 72 6f 72           # error
1c1a0 20 6d 65 73 73 61 67 65 73 20 6f 66 20 64 69 66   messages of dif
1c1b0 66 65 72 65 6e 74 20 66 75 6e 63 74 69 6f 6e 73  ferent functions
1c1c0 2e 0a 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  ..S_SILKTORRENT_
1c1d0 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49  PACKAGER_T1_ACTI
1c1e0 4f 4e 5f 57 41 52 50 5f 4e 52 41 4e 44 3d 22 22  ON_WARP_NRAND=""
1c1f0 20 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   ..#------------
1c200 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c210 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c220 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c230 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
1c240 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74  .func_mmmv_silkt
1c250 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f  orrent_packager_
1c260 74 31 5f 62 61 73 68 5f 64 65 74 65 72 6d 69 6e  t1_bash_determin
1c270 65 5f 61 63 74 69 6f 6e 28 29 20 7b 20 0a 20 20  e_action() { .  
1c280 20 20 6c 6f 63 61 6c 20 53 5f 41 52 47 56 5f 30    local S_ARGV_0
1c290 3d 22 24 31 22 20 23 20 52 75 62 79 20 73 74 79  ="$1" # Ruby sty
1c2a0 6c 65 20 41 52 47 56 2c 20 30 20 69 73 20 74 68  le ARGV, 0 is th
1c2b0 65 20 66 69 72 73 74 20 63 6f 6d 6d 61 6e 64 20  e first command 
1c2c0 6c 69 6e 65 20 61 72 67 75 6d 65 6e 74 2e 0a 20  line argument.. 
1c2d0 20 20 20 6c 6f 63 61 6c 20 53 5f 41 52 47 56 5f     local S_ARGV_
1c2e0 31 3d 22 24 32 22 20 0a 20 20 20 20 6c 6f 63 61  1="$2" .    loca
1c2f0 6c 20 53 5f 41 52 47 56 5f 32 3d 22 24 33 22 20  l S_ARGV_2="$3" 
1c300 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 41 52 47  .    local S_ARG
1c310 56 5f 33 3d 22 24 34 22 20 0a 20 20 20 20 23 2d  V_3="$4" .    #-
1c320 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
1c330 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20   "$S_ARGV_0" == 
1c340 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  "" ]; then.     
1c350 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c     func_mmmv_sil
1c360 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65  ktorrent_package
1c370 72 5f 74 31 5f 62 61 73 68 5f 70 72 69 6e 74 5f  r_t1_bash_print_
1c380 68 65 6c 70 5f 6d 73 67 5f 74 31 0a 20 20 20 20  help_msg_t1.    
1c390 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
1c3a0 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
1c3b0 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
1c3c0 20 65 78 69 74 20 77 69 74 68 20 61 6e 20 65 72   exit with an er
1c3d0 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ror.    fi.    #
1c3e0 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53  ----.    local S
1c3f0 42 5f 30 3d 22 66 22 0a 20 20 20 20 69 66 20 5b  B_0="f".    if [
1c400 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20   "$S_ARGV_0" == 
1c410 22 68 65 6c 70 22 20 5d 3b 20 74 68 65 6e 0a 20  "help" ]; then. 
1c420 20 20 20 20 20 20 20 53 42 5f 30 3d 22 74 22 0a         SB_0="t".
1c430 20 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20      fi.    if [ 
1c440 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22  "$S_ARGV_0" == "
1c450 2d 2d 68 65 6c 70 22 20 5d 3b 20 74 68 65 6e 0a  --help" ]; then.
1c460 20 20 20 20 20 20 20 20 53 42 5f 30 3d 22 74 22          SB_0="t"
1c470 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b  .    fi.    if [
1c480 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20   "$S_ARGV_0" == 
1c490 22 3f 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  "?" ]; then.    
1c4a0 20 20 20 20 53 42 5f 30 3d 22 74 22 0a 20 20 20      SB_0="t".   
1c4b0 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53   fi.    if [ "$S
1c4c0 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 3f 22  _ARGV_0" == "-?"
1c4d0 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1c4e0 20 53 42 5f 30 3d 22 74 22 0a 20 20 20 20 66 69   SB_0="t".    fi
1c4f0 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52  .    if [ "$S_AR
1c500 47 56 5f 30 22 20 3d 3d 20 22 68 22 20 5d 3b 20  GV_0" == "h" ]; 
1c510 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f  then.        SB_
1c520 30 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20  0="t".    fi.   
1c530 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30   if [ "$S_ARGV_0
1c540 22 20 3d 3d 20 22 2d 68 22 20 5d 3b 20 74 68 65  " == "-h" ]; the
1c550 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 30 3d 22  n.        SB_0="
1c560 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  t".    fi.    #-
1c570 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ---.    if [ "$S
1c580 42 5f 30 22 20 3d 3d 20 22 74 22 20 5d 3b 20 74  B_0" == "t" ]; t
1c590 68 65 6e 0a 20 20 20 20 20 20 20 20 66 75 6e 63  hen.        func
1c5a0 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61 72 67  _mmmv_assert_arg
1c5b0 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 20 5c 0a  _is_absent_t1 \.
1c5c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1c5d0 22 24 53 5f 41 52 47 56 5f 31 22 20 5c 0a 20 20  "$S_ARGV_1" \.  
1c5e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 32                "2
1c5f0 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65  . console argume
1c600 6e 74 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  nt" \.          
1c610 20 20 20 20 20 20 22 36 66 63 32 37 62 33 31 2d        "6fc27b31-
1c620 61 63 64 34 2d 34 37 65 35 2d 39 38 66 30 2d 32  acd4-47e5-98f0-2
1c630 31 62 31 37 30 65 30 33 31 65 37 22 0a 20 20 20  1b170e031e7".   
1c640 20 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73       func_mmmv_s
1c650 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61  ilktorrent_packa
1c660 67 65 72 5f 74 31 5f 62 61 73 68 5f 70 72 69 6e  ger_t1_bash_prin
1c670 74 5f 68 65 6c 70 5f 6d 73 67 5f 74 31 0a 20 20  t_help_msg_t1.  
1c680 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
1c690 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
1c6a0 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 30  G.        exit 0
1c6b0 20 23 20 65 78 69 74 20 77 69 74 68 6f 75 74 20   # exit without 
1c6c0 61 6e 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  an error.    fi.
1c6d0 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
1c6e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
1c6f0 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47      if [ "$S_ARG
1c700 56 5f 30 22 20 3d 3d 20 22 76 65 72 73 69 6f 6e  V_0" == "version
1c710 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
1c720 20 20 53 42 5f 30 3d 22 74 22 0a 20 20 20 20 66    SB_0="t".    f
1c730 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41  i.    if [ "$S_A
1c740 52 47 56 5f 30 22 20 3d 3d 20 22 2d 2d 76 65 72  RGV_0" == "--ver
1c750 73 69 6f 6e 22 20 5d 3b 20 74 68 65 6e 0a 20 20  sion" ]; then.  
1c760 20 20 20 20 20 20 53 42 5f 30 3d 22 74 22 0a 20        SB_0="t". 
1c770 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22     fi.    if [ "
1c780 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d  $S_ARGV_0" == "-
1c790 76 65 72 73 69 6f 6e 22 20 5d 3b 20 74 68 65 6e  version" ]; then
1c7a0 0a 20 20 20 20 20 20 20 20 53 42 5f 30 3d 22 74  .        SB_0="t
1c7b0 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20  ".    fi.    if 
1c7c0 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d  [ "$S_ARGV_0" ==
1c7d0 20 22 76 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20   "v" ]; then.   
1c7e0 20 20 20 20 20 53 42 5f 30 3d 22 74 22 0a 20 20       SB_0="t".  
1c7f0 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24    fi.    if [ "$
1c800 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 76  S_ARGV_0" == "-v
1c810 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
1c820 20 20 53 42 5f 30 3d 22 74 22 0a 20 20 20 20 66    SB_0="t".    f
1c830 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20  i.    #----.    
1c840 69 66 20 5b 20 22 24 53 42 5f 30 22 20 3d 3d 20  if [ "$SB_0" == 
1c850 22 74 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  "t" ]; then.    
1c860 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61 73      func_mmmv_as
1c870 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62 73 65  sert_arg_is_abse
1c880 6e 74 5f 74 31 20 5c 0a 20 20 20 20 20 20 20 20  nt_t1 \.        
1c890 20 20 20 20 20 20 20 20 22 24 53 5f 41 52 47 56          "$S_ARGV
1c8a0 5f 31 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  _1" \.          
1c8b0 20 20 20 20 20 20 22 32 2e 20 63 6f 6e 73 6f 6c        "2. consol
1c8c0 65 20 61 72 67 75 6d 65 6e 74 22 20 5c 0a 20 20  e argument" \.  
1c8d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 66                "f
1c8e0 37 64 35 31 35 34 33 2d 61 37 38 62 2d 34 64 32  7d51543-a78b-4d2
1c8f0 35 2d 38 34 66 30 2d 32 31 62 31 37 30 65 30 33  5-84f0-21b170e03
1c900 31 65 37 22 0a 20 20 20 20 20 20 20 20 65 63 68  1e7".        ech
1c910 6f 20 22 24 53 5f 53 43 52 49 50 54 5f 56 45 52  o "$S_SCRIPT_VER
1c920 53 49 4f 4e 22 0a 20 20 20 20 20 20 20 20 23 2d  SION".        #-
1c930 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
1c940 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
1c950 20 20 65 78 69 74 20 30 20 23 20 65 78 69 74 20    exit 0 # exit 
1c960 77 69 74 68 6f 75 74 20 61 6e 20 65 72 72 6f 72  without an error
1c970 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
1c980 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c990 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
1c9a0 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20   "$S_ARGV_0" == 
1c9b0 22 76 65 72 73 69 6f 6e 5f 74 69 6d 65 73 74 61  "version_timesta
1c9c0 6d 70 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  mp" ]; then.    
1c9d0 20 20 20 20 53 42 5f 30 3d 22 74 22 0a 20 20 20      SB_0="t".   
1c9e0 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53   fi.    if [ "$S
1c9f0 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 2d 76  _ARGV_0" == "--v
1ca00 65 72 73 69 6f 6e 5f 74 69 6d 65 73 74 61 6d 70  ersion_timestamp
1ca10 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
1ca20 20 20 53 42 5f 30 3d 22 74 22 0a 20 20 20 20 66    SB_0="t".    f
1ca30 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41  i.    if [ "$S_A
1ca40 52 47 56 5f 30 22 20 3d 3d 20 22 2d 76 65 72 73  RGV_0" == "-vers
1ca50 69 6f 6e 5f 74 69 6d 65 73 74 61 6d 70 22 20 5d  ion_timestamp" ]
1ca60 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53  ; then.        S
1ca70 42 5f 30 3d 22 74 22 0a 20 20 20 20 66 69 0a 20  B_0="t".    fi. 
1ca80 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56     if [ "$S_ARGV
1ca90 5f 30 22 20 3d 3d 20 22 76 74 22 20 5d 3b 20 74  _0" == "vt" ]; t
1caa0 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 30  hen.        SB_0
1cab0 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20  ="t".    fi.    
1cac0 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22  if [ "$S_ARGV_0"
1cad0 20 3d 3d 20 22 2d 76 74 22 20 5d 3b 20 74 68 65   == "-vt" ]; the
1cae0 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 30 3d 22  n.        SB_0="
1caf0 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  t".    fi.    #-
1cb00 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ---.    if [ "$S
1cb10 42 5f 30 22 20 3d 3d 20 22 74 22 20 5d 3b 20 74  B_0" == "t" ]; t
1cb20 68 65 6e 0a 20 20 20 20 20 20 20 20 66 75 6e 63  hen.        func
1cb30 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61 72 67  _mmmv_assert_arg
1cb40 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 20 5c 0a  _is_absent_t1 \.
1cb50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1cb60 22 24 53 5f 41 52 47 56 5f 31 22 20 5c 0a 20 20  "$S_ARGV_1" \.  
1cb70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 32                "2
1cb80 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65  . console argume
1cb90 6e 74 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  nt" \.          
1cba0 20 20 20 20 20 20 22 37 30 31 34 34 38 31 39 2d        "70144819-
1cbb0 31 62 35 35 2d 34 36 33 35 2d 39 32 66 30 2d 32  1b55-4635-92f0-2
1cbc0 31 62 31 37 30 65 30 33 31 65 37 22 0a 20 20 20  1b170e031e7".   
1cbd0 20 20 20 20 20 65 63 68 6f 20 22 24 53 5f 53 43       echo "$S_SC
1cbe0 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f 47 45 4e  RIPT_VERSION_GEN
1cbf0 45 52 41 54 49 4f 4e 5f 44 41 54 45 22 0a 20 20  ERATION_DATE".  
1cc00 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
1cc10 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
1cc20 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 30  G.        exit 0
1cc30 20 23 20 65 78 69 74 20 77 69 74 68 6f 75 74 20   # exit without 
1cc40 61 6e 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  an error.    fi.
1cc50 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
1cc60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
1cc70 20 20 20 20 23 20 53 74 61 72 74 20 6f 66 20 61      # Start of a
1cc80 63 74 69 6f 6e 73 20 74 68 61 74 20 72 65 71 75  ctions that requ
1cc90 69 72 65 20 74 68 65 20 65 78 69 73 74 65 6e 63  ire the existenc
1cca0 65 20 6f 66 20 61 74 20 6c 65 61 73 74 20 6f 6e  e of at least on
1ccb0 65 20 66 69 6c 65 2e 0a 20 20 20 20 6c 6f 63 61  e file..    loca
1ccc0 6c 20 53 42 5f 46 49 4c 45 5f 52 45 51 55 49 52  l SB_FILE_REQUIR
1ccd0 45 44 3d 22 74 22 0a 20 20 20 20 6c 6f 63 61 6c  ED="t".    local
1cce0 20 53 42 5f 52 45 51 55 45 53 54 45 44 5f 41 43   SB_REQUESTED_AC
1ccf0 54 49 4f 4e 5f 45 58 49 53 54 53 3d 22 66 22 0a  TION_EXISTS="f".
1cd00 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f      local S_TMP_
1cd10 30 3d 22 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53  0="".    local S
1cd20 5f 54 4d 50 5f 31 3d 22 22 0a 20 20 20 20 53 5f  _TMP_1="".    S_
1cd30 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
1cd40 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 5f 57  AGER_T1_ACTION_W
1cd50 41 52 50 5f 4e 52 41 4e 44 3d 22 22 0a 20 20 20  ARP_NRAND="".   
1cd60 20 23 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d 50   #----.    S_TMP
1cd70 5f 30 3d 22 77 72 61 70 22 20 0a 20 20 20 20 69  _0="wrap" .    i
1cd80 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20  f [ "$S_ARGV_0" 
1cd90 3d 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b  == "$S_TMP_0" ];
1cda0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f   then.        S_
1cdb0 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
1cdc0 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22  AGER_T1_ACTION="
1cdd0 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20  $S_TMP_0".      
1cde0 20 20 53 42 5f 52 45 51 55 45 53 54 45 44 5f 41    SB_REQUESTED_A
1cdf0 43 54 49 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22  CTION_EXISTS="t"
1ce00 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b  .    fi.    if [
1ce10 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20   "$S_ARGV_0" == 
1ce20 22 70 61 63 6b 22 20 5d 3b 20 74 68 65 6e 20 20  "pack" ]; then  
1ce30 20 23 20 61 6c 69 61 73 0a 20 20 20 20 20 20 20   # alias.       
1ce40 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50   S_SILKTORRENT_P
1ce50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f  ACKAGER_T1_ACTIO
1ce60 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20  N="$S_TMP_0".   
1ce70 20 20 20 20 20 53 42 5f 52 45 51 55 45 53 54 45       SB_REQUESTE
1ce80 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54 53 3d  D_ACTION_EXISTS=
1ce90 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69  "t".    fi.    i
1cea0 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20  f [ "$S_ARGV_0" 
1ceb0 3d 3d 20 22 77 22 20 5d 3b 20 74 68 65 6e 20 20  == "w" ]; then  
1cec0 20 23 20 61 6c 69 61 73 0a 20 20 20 20 20 20 20   # alias.       
1ced0 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50   S_SILKTORRENT_P
1cee0 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f  ACKAGER_T1_ACTIO
1cef0 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20  N="$S_TMP_0".   
1cf00 20 20 20 20 20 53 42 5f 52 45 51 55 45 53 54 45       SB_REQUESTE
1cf10 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54 53 3d  D_ACTION_EXISTS=
1cf20 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69  "t".    fi.    i
1cf30 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20  f [ "$S_ARGV_0" 
1cf40 3d 3d 20 22 2d 77 22 20 5d 3b 20 74 68 65 6e 20  == "-w" ]; then 
1cf50 20 20 23 20 61 6c 69 61 73 0a 20 20 20 20 20 20    # alias.      
1cf60 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f    S_SILKTORRENT_
1cf70 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49  PACKAGER_T1_ACTI
1cf80 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20  ON="$S_TMP_0".  
1cf90 20 20 20 20 20 20 53 42 5f 52 45 51 55 45 53 54        SB_REQUEST
1cfa0 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54 53  ED_ACTION_EXISTS
1cfb0 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20  ="t".    fi.    
1cfc0 69 66 20 5b 20 22 24 53 5f 53 49 4c 4b 54 4f 52  if [ "$S_SILKTOR
1cfd0 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31  RENT_PACKAGER_T1
1cfe0 5f 41 43 54 49 4f 4e 22 20 3d 3d 20 22 24 53 5f  _ACTION" == "$S_
1cff0 54 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20  TMP_0" ]; then. 
1d000 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f         if [ "$S_
1d010 41 52 47 56 5f 32 22 20 21 3d 20 22 22 20 5d 3b  ARGV_2" != "" ];
1d020 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20   then.          
1d030 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f    func_mmmv_x_po
1d040 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
1d050 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
1d060 74 72 69 6e 67 5f 74 31 20 22 24 53 5f 41 52 47  tring_t1 "$S_ARG
1d070 56 5f 32 22 0a 20 20 20 20 20 20 20 20 20 20 20  V_2".           
1d080 20 53 5f 54 4d 50 5f 31 3d 22 24 53 5f 46 55 4e   S_TMP_1="$S_FUN
1d090 43 5f 4d 4d 4d 56 5f 58 5f 50 4f 53 49 54 49 56  C_MMMV_X_POSITIV
1d0a0 45 5f 57 48 4f 4c 45 5f 4e 55 4d 42 45 52 5f 4f  E_WHOLE_NUMBER_O
1d0b0 52 5f 41 4e 5f 45 4d 50 54 59 53 54 52 49 4e 47  R_AN_EMPTYSTRING
1d0c0 5f 54 31 5f 4f 55 54 22 0a 20 20 20 20 20 20 20  _T1_OUT".       
1d0d0 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d       if [ "$S_TM
1d0e0 50 5f 31 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68  P_1" == "" ]; th
1d0f0 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  en.             
1d100 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
1d110 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
1d120 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  "".             
1d130 20 20 20 65 63 68 6f 20 22 54 68 65 20 4e 5f 4f     echo "The N_O
1d140 46 5f 52 41 4e 44 4f 4d 5f 54 45 58 54 5f 42 4c  F_RANDOM_TEXT_BL
1d150 4f 43 4b 53 28 3d 3d 24 53 5f 41 52 47 56 5f 32  OCKS(==$S_ARGV_2
1d160 29 20 69 73 20 65 78 70 65 63 74 65 64 20 22 0a  ) is expected ".
1d170 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1d180 65 63 68 6f 20 22 74 6f 20 62 65 20 61 20 70 6f  echo "to be a po
1d190 73 69 74 69 76 65 20 77 68 6f 6c 65 20 6e 75 6d  sitive whole num
1d1a0 62 65 72 2e 22 0a 20 20 20 20 20 20 20 20 20 20  ber.".          
1d1b0 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
1d1c0 3d 3d 27 38 30 36 30 62 63 33 62 2d 38 61 39 31  =='8060bc3b-8a91
1d1d0 2d 34 62 31 34 2d 39 33 63 65 2d 32 31 62 31 37  -4b14-93ce-21b17
1d1e0 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
1d1f0 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
1d200 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ".              
1d210 20 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69    # func_mmmv_si
1d220 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67  lktorrent_packag
1d230 65 72 5f 74 31 5f 62 61 73 68 5f 70 72 69 6e 74  er_t1_bash_print
1d240 5f 68 65 6c 70 5f 6d 73 67 5f 74 31 0a 20 20 20  _help_msg_t1.   
1d250 20 20 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d               #--
1d260 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  --.             
1d270 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
1d280 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
1d290 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
1d2a0 69 74 68 20 61 6e 20 65 72 72 6f 72 0a 20 20 20  ith an error.   
1d2b0 20 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20           fi.    
1d2c0 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d          #-------
1d2d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d2e0 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23  --.            #
1d2f0 20 53 65 74 73 20 61 20 6c 69 6d 69 74 20 74 68   Sets a limit th
1d300 61 74 20 66 69 6c 65 73 20 74 68 61 74 20 0a 20  at files that . 
1d310 20 20 20 20 20 20 20 20 20 20 20 23 20 68 61 76             # hav
1d320 65 20 73 70 61 63 65 73 20 61 6e 64 20 74 61 62  e spaces and tab
1d330 73 20 69 6e 20 74 68 65 69 72 20 6e 61 6d 65 73  s in their names
1d340 20 63 61 6e 20 6e 6f 74 20 62 65 20 70 61 63 6b   can not be pack
1d350 65 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 23  ed.            #
1d360 20 77 69 74 68 6f 75 74 20 72 65 6e 61 6d 69 6e   without renamin
1d370 67 20 6f 72 20 77 72 61 70 70 69 6e 67 20 74 68  g or wrapping th
1d380 65 6d 20 74 6f 20 73 6f 6d 65 20 74 61 72 2d 66  em to some tar-f
1d390 69 6c 65 20 74 68 61 74 20 0a 20 20 20 20 20 20  ile that .      
1d3a0 20 20 20 20 20 20 23 20 68 61 73 20 61 20 73 70        # has a sp
1d3b0 61 63 65 2d 74 61 62 2d 6c 69 6e 65 62 72 65 61  ace-tab-linebrea
1d3c0 6b 2d 66 72 65 65 20 6e 61 6d 65 2e 0a 20 20 20  k-free name..   
1d3d0 20 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d           func_mm
1d3e0 6d 76 5f 61 73 73 65 72 74 5f 61 72 67 5f 69 73  mv_assert_arg_is
1d3f0 5f 61 62 73 65 6e 74 5f 74 31 20 5c 0a 20 20 20  _absent_t1 \.   
1d400 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1d410 20 22 24 53 5f 41 52 47 56 5f 33 22 20 5c 0a 20   "$S_ARGV_3" \. 
1d420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1d430 20 20 20 22 34 2e 20 63 6f 6e 73 6f 6c 65 20 61     "4. console a
1d440 72 67 75 6d 65 6e 74 22 20 5c 0a 20 20 20 20 20  rgument" \.     
1d450 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22                 "
1d460 37 32 33 37 63 65 61 36 2d 39 61 38 31 2d 34 61  7237cea6-9a81-4a
1d470 31 39 2d 39 38 66 30 2d 32 31 62 31 37 30 65 30  19-98f0-21b170e0
1d480 33 31 65 37 22 0a 20 20 20 20 20 20 20 20 20 20  31e7".          
1d490 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
1d4a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20  ------------.   
1d4b0 20 20 20 20 20 20 20 20 20 53 5f 53 49 4c 4b 54           S_SILKT
1d4c0 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
1d4d0 54 31 5f 41 43 54 49 4f 4e 5f 57 41 52 50 5f 4e  T1_ACTION_WARP_N
1d4e0 52 41 4e 44 3d 22 24 53 5f 54 4d 50 5f 31 22 20  RAND="$S_TMP_1" 
1d4f0 23 20 3d 3d 4e 5f 4f 46 5f 52 41 4e 44 4f 4d 5f  # ==N_OF_RANDOM_
1d500 54 45 58 54 5f 42 4c 4f 43 4b 53 0a 20 20 20 20  TEXT_BLOCKS.    
1d510 20 20 20 20 66 69 0a 20 20 20 20 66 69 0a 20 20      fi.    fi.  
1d520 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d    #----.    S_TM
1d530 50 5f 30 3d 22 75 6e 77 72 61 70 22 20 0a 20 20  P_0="unwrap" .  
1d540 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f    if [ "$S_ARGV_
1d550 30 22 20 3d 3d 20 22 24 53 5f 54 4d 50 5f 30 22  0" == "$S_TMP_0"
1d560 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1d570 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50   S_SILKTORRENT_P
1d580 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f  ACKAGER_T1_ACTIO
1d590 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20  N="$S_TMP_0".   
1d5a0 20 20 20 20 20 53 42 5f 52 45 51 55 45 53 54 45       SB_REQUESTE
1d5b0 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54 53 3d  D_ACTION_EXISTS=
1d5c0 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69  "t".    fi.    i
1d5d0 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20  f [ "$S_ARGV_0" 
1d5e0 3d 3d 20 22 75 6e 70 61 63 6b 22 20 5d 3b 20 74  == "unpack" ]; t
1d5f0 68 65 6e 20 23 20 61 6c 69 61 73 0a 20 20 20 20  hen # alias.    
1d600 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e      S_SILKTORREN
1d610 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43  T_PACKAGER_T1_AC
1d620 54 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a  TION="$S_TMP_0".
1d630 20 20 20 20 20 20 20 20 53 42 5f 52 45 51 55 45          SB_REQUE
1d640 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53  STED_ACTION_EXIS
1d650 54 53 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20  TS="t".    fi.  
1d660 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f    if [ "$S_ARGV_
1d670 30 22 20 3d 3d 20 22 75 77 22 20 5d 3b 20 74 68  0" == "uw" ]; th
1d680 65 6e 20 23 20 61 6c 69 61 73 0a 20 20 20 20 20  en # alias.     
1d690 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54     S_SILKTORRENT
1d6a0 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54  _PACKAGER_T1_ACT
1d6b0 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20  ION="$S_TMP_0". 
1d6c0 20 20 20 20 20 20 20 53 42 5f 52 45 51 55 45 53         SB_REQUES
1d6d0 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54  TED_ACTION_EXIST
1d6e0 53 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20  S="t".    fi.   
1d6f0 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30   if [ "$S_ARGV_0
1d700 22 20 3d 3d 20 22 2d 75 77 22 20 5d 3b 20 74 68  " == "-uw" ]; th
1d710 65 6e 20 23 20 61 6c 69 61 73 0a 20 20 20 20 20  en # alias.     
1d720 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54     S_SILKTORRENT
1d730 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54  _PACKAGER_T1_ACT
1d740 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20  ION="$S_TMP_0". 
1d750 20 20 20 20 20 20 20 53 42 5f 52 45 51 55 45 53         SB_REQUES
1d760 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54  TED_ACTION_EXIST
1d770 53 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20  S="t".    fi.   
1d780 20 69 66 20 5b 20 22 24 53 5f 53 49 4c 4b 54 4f   if [ "$S_SILKTO
1d790 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54  RRENT_PACKAGER_T
1d7a0 31 5f 41 43 54 49 4f 4e 22 20 3d 3d 20 22 24 53  1_ACTION" == "$S
1d7b0 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a  _TMP_0" ]; then.
1d7c0 20 20 20 20 20 20 20 20 23 20 41 20 6d 6f 72 65          # A more
1d7d0 20 73 74 72 65 69 67 68 74 66 6f 72 77 61 72 64   streightforward
1d7e0 20 63 68 65 63 6b 20 77 6f 75 6c 64 20 62 65 3a   check would be:
1d7f0 0a 20 20 20 20 20 20 20 20 23 0a 20 20 20 20 20  .        #.     
1d800 20 20 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61     # func_mmmv_a
1d810 73 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62 73  ssert_arg_is_abs
1d820 65 6e 74 5f 74 31 20 5c 0a 20 20 20 20 20 20 20  ent_t1 \.       
1d830 20 23 20 20 20 20 20 20 20 20 20 22 24 53 5f 41   #         "$S_A
1d840 52 47 56 5f 33 22 20 5c 0a 20 20 20 20 20 20 20  RGV_3" \.       
1d850 20 23 20 20 20 20 20 20 20 20 20 22 34 2e 20 63   #         "4. c
1d860 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65 6e 74 22  onsole argument"
1d870 20 5c 0a 20 20 20 20 20 20 20 20 23 20 20 20 20   \.        #    
1d880 20 20 20 20 20 22 32 37 66 32 34 35 31 31 2d 30       "27f24511-0
1d890 35 65 37 2d 34 32 36 35 2d 38 62 65 30 2d 32 31  5e7-4265-8be0-21
1d8a0 62 31 37 30 65 30 33 31 65 37 22 0a 20 20 20 20  b170e031e7".    
1d8b0 20 20 20 20 23 0a 20 20 20 20 20 20 20 20 23 20      #.        # 
1d8c0 62 75 74 20 69 6e 20 74 68 65 20 63 61 73 65 20  but in the case 
1d8d0 6f 66 20 74 68 65 20 75 6e 77 72 61 70 20 63 6f  of the unwrap co
1d8e0 6d 6d 61 6e 64 20 74 68 65 20 68 61 63 6b 20 69  mmand the hack i
1d8f0 6e 20 74 68 69 73 20 69 66 2d 63 6c 61 75 73 65  n this if-clause
1d900 0a 20 20 20 20 20 20 20 20 23 20 67 69 76 65 73  .        # gives
1d910 20 61 20 6d 6f 72 65 20 69 6e 66 6f 72 6d 61 74   a more informat
1d920 69 76 65 20 65 72 72 6f 72 20 6d 65 73 73 61 67  ive error messag
1d930 65 20 66 6f 72 20 0a 20 20 20 20 20 20 20 20 23  e for .        #
1d940 20 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63   Silktorrent pac
1d950 6b 65 74 20 63 61 6e 64 69 64 61 74 65 20 66 69  ket candidate fi
1d960 6c 65 73 20 74 68 61 74 20 68 61 76 65 20 73 70  les that have sp
1d970 61 63 65 73 20 69 6e 20 74 68 65 69 72 20 6e 61  aces in their na
1d980 6d 65 20 0a 20 20 20 20 20 20 20 20 69 66 20 5b  me .        if [
1d990 20 22 24 53 5f 41 52 47 56 5f 32 22 20 21 3d 20   "$S_ARGV_2" != 
1d9a0 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  "" ]; then.     
1d9b0 20 20 20 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52         S_SILKTOR
1d9c0 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31  RENT_PACKAGER_T1
1d9d0 5f 41 43 54 49 4f 4e 3d 22 76 65 72 69 66 79 5f  _ACTION="verify_
1d9e0 70 61 63 6b 65 74 5f 6e 61 6d 65 5f 66 6f 72 6d  packet_name_form
1d9f0 61 74 5f 76 31 22 0a 20 20 20 20 20 20 20 20 66  at_v1".        f
1da00 69 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d  i.    fi.    #--
1da10 2d 2d 0a 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22  --.    S_TMP_0="
1da20 76 65 72 69 66 79 22 20 23 20 63 68 65 63 6b 73  verify" # checks
1da30 20 74 68 65 20 6d 61 74 63 68 20 62 65 74 77 65   the match betwe
1da40 65 6e 20 74 68 65 20 62 6c 6f 62 20 61 6e 64 20  en the blob and 
1da50 74 68 65 20 66 69 6c 65 20 6e 61 6d 65 0a 20 20  the file name.  
1da60 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f    if [ "$S_ARGV_
1da70 30 22 20 3d 3d 20 22 24 53 5f 54 4d 50 5f 30 22  0" == "$S_TMP_0"
1da80 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1da90 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50   S_SILKTORRENT_P
1daa0 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f  ACKAGER_T1_ACTIO
1dab0 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20  N="$S_TMP_0".   
1dac0 20 20 20 20 20 53 42 5f 52 45 51 55 45 53 54 45       SB_REQUESTE
1dad0 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54 53 3d  D_ACTION_EXISTS=
1dae0 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69  "t".    fi.    i
1daf0 66 20 5b 20 22 24 53 5f 53 49 4c 4b 54 4f 52 52  f [ "$S_SILKTORR
1db00 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f  ENT_PACKAGER_T1_
1db10 41 43 54 49 4f 4e 22 20 3d 3d 20 22 24 53 5f 54  ACTION" == "$S_T
1db20 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  MP_0" ]; then.  
1db30 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f        func_mmmv_
1db40 61 73 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62  assert_arg_is_ab
1db50 73 65 6e 74 5f 74 31 20 5c 0a 20 20 20 20 20 20  sent_t1 \.      
1db60 20 20 20 20 20 20 20 20 20 20 22 24 53 5f 41 52            "$S_AR
1db70 47 56 5f 32 22 20 5c 0a 20 20 20 20 20 20 20 20  GV_2" \.        
1db80 20 20 20 20 20 20 20 20 22 33 2e 20 63 6f 6e 73          "3. cons
1db90 6f 6c 65 20 61 72 67 75 6d 65 6e 74 22 20 5c 0a  ole argument" \.
1dba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1dbb0 22 66 34 61 33 36 62 34 33 2d 34 62 39 34 2d 34  "f4a36b43-4b94-4
1dbc0 35 33 66 2d 38 31 65 30 2d 32 31 62 31 37 30 65  53f-81e0-21b170e
1dbd0 30 33 31 65 37 22 0a 20 20 20 20 66 69 0a 20 20  031e7".    fi.  
1dbe0 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d    #----.    S_TM
1dbf0 50 5f 30 3d 22 74 65 73 74 5f 68 61 73 68 5f 74  P_0="test_hash_t
1dc00 31 22 20 0a 20 20 20 20 69 66 20 5b 20 22 24 53  1" .    if [ "$S
1dc10 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 24 53 5f  _ARGV_0" == "$S_
1dc20 54 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20  TMP_0" ]; then. 
1dc30 20 20 20 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52         S_SILKTOR
1dc40 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31  RENT_PACKAGER_T1
1dc50 5f 41 43 54 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f  _ACTION="$S_TMP_
1dc60 30 22 0a 20 20 20 20 20 20 20 20 53 42 5f 52 45  0".        SB_RE
1dc70 51 55 45 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45  QUESTED_ACTION_E
1dc80 58 49 53 54 53 3d 22 74 22 0a 20 20 20 20 66 69  XISTS="t".    fi
1dc90 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 53 49  .    if [ "$S_SI
1dca0 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47  LKTORRENT_PACKAG
1dcb0 45 52 5f 54 31 5f 41 43 54 49 4f 4e 22 20 3d 3d  ER_T1_ACTION" ==
1dcc0 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b 20 74   "$S_TMP_0" ]; t
1dcd0 68 65 6e 0a 20 20 20 20 20 20 20 20 66 75 6e 63  hen.        func
1dce0 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61 72 67  _mmmv_assert_arg
1dcf0 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 20 5c 0a  _is_absent_t1 \.
1dd00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1dd10 22 24 53 5f 41 52 47 56 5f 32 22 20 5c 0a 20 20  "$S_ARGV_2" \.  
1dd20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 33                "3
1dd30 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65  . console argume
1dd40 6e 74 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  nt" \.          
1dd50 20 20 20 20 20 20 22 65 34 39 63 38 36 30 37 2d        "e49c8607-
1dd60 33 34 38 31 2d 34 30 33 33 2d 39 34 65 30 2d 32  3481-4033-94e0-2
1dd70 31 62 31 37 30 65 30 33 31 65 37 22 0a 20 20 20  1b170e031e7".   
1dd80 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d   fi.    #-------
1dd90 2d 0a 20 20 20 20 23 20 53 74 61 72 74 20 6f 66  -.    # Start of
1dda0 20 61 63 74 69 6f 6e 73 20 74 68 61 74 20 64 6f   actions that do
1ddb0 20 6e 6f 74 20 72 65 71 75 69 72 65 20 61 20 66   not require a f
1ddc0 69 6c 65 3a 0a 20 20 20 20 53 5f 54 4d 50 5f 30  ile:.    S_TMP_0
1ddd0 3d 22 76 65 72 69 66 79 5f 70 61 63 6b 65 74 5f  ="verify_packet_
1dde0 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f 76 31 22 20  name_format_v1" 
1ddf0 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52  .    if [ "$S_AR
1de00 47 56 5f 30 22 20 3d 3d 20 22 24 53 5f 54 4d 50  GV_0" == "$S_TMP
1de10 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  _0" ]; then.    
1de20 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e      S_SILKTORREN
1de30 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43  T_PACKAGER_T1_AC
1de40 54 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a  TION="$S_TMP_0".
1de50 20 20 20 20 20 20 20 20 53 42 5f 52 45 51 55 45          SB_REQUE
1de60 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53  STED_ACTION_EXIS
1de70 54 53 3d 22 74 22 0a 20 20 20 20 20 20 20 20 53  TS="t".        S
1de80 42 5f 46 49 4c 45 5f 52 45 51 55 49 52 45 44 3d  B_FILE_REQUIRED=
1de90 22 66 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69  "f".    fi.    i
1dea0 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20  f [ "$S_ARGV_0" 
1deb0 3d 3d 20 22 2d 2d 76 65 72 69 66 79 5f 70 61 63  == "--verify_pac
1dec0 6b 65 74 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f  ket_name_format_
1ded0 76 31 22 20 5d 3b 20 74 68 65 6e 20 0a 20 20 20  v1" ]; then .   
1dee0 20 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45       S_SILKTORRE
1def0 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41  NT_PACKAGER_T1_A
1df00 43 54 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22  CTION="$S_TMP_0"
1df10 0a 20 20 20 20 20 20 20 20 53 42 5f 52 45 51 55  .        SB_REQU
1df20 45 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49  ESTED_ACTION_EXI
1df30 53 54 53 3d 22 74 22 0a 20 20 20 20 20 20 20 20  STS="t".        
1df40 53 42 5f 46 49 4c 45 5f 52 45 51 55 49 52 45 44  SB_FILE_REQUIRED
1df50 3d 22 66 22 0a 20 20 20 20 66 69 0a 20 20 20 20  ="f".    fi.    
1df60 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22  if [ "$S_ARGV_0"
1df70 20 3d 3d 20 22 76 65 72 69 66 79 5f 70 61 63 6b   == "verify_pack
1df80 61 67 65 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f  age_name_format_
1df90 76 31 22 20 5d 3b 20 74 68 65 6e 20 0a 20 20 20  v1" ]; then .   
1dfa0 20 20 20 20 20 23 20 20 64 69 66 66 65 72 73 20       #  differs 
1dfb0 66 72 6f 6d 20 24 53 5f 54 4d 50 5f 30 20 61 74  from $S_TMP_0 at
1dfc0 20 41 41 41 0a 20 20 20 20 20 20 20 20 23 2d 2d   AAA.        #--
1dfd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1dfe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1dff0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 20  --------------  
1e000 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20           .      
1e010 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f    S_SILKTORRENT_
1e020 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49  PACKAGER_T1_ACTI
1e030 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20  ON="$S_TMP_0".  
1e040 20 20 20 20 20 20 53 42 5f 52 45 51 55 45 53 54        SB_REQUEST
1e050 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54 53  ED_ACTION_EXISTS
1e060 3d 22 74 22 0a 20 20 20 20 20 20 20 20 53 42 5f  ="t".        SB_
1e070 46 49 4c 45 5f 52 45 51 55 49 52 45 44 3d 22 66  FILE_REQUIRED="f
1e080 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20  ".    fi.    if 
1e090 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d  [ "$S_ARGV_0" ==
1e0a0 20 22 2d 2d 76 65 72 69 66 79 5f 70 61 63 6b 61   "--verify_packa
1e0b0 67 65 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f 76  ge_name_format_v
1e0c0 31 22 20 5d 3b 20 74 68 65 6e 20 0a 20 20 20 20  1" ]; then .    
1e0d0 20 20 20 20 23 20 20 20 20 64 69 66 66 65 72 73      #    differs
1e0e0 20 66 72 6f 6d 20 24 53 5f 54 4d 50 5f 30 20 61   from $S_TMP_0 a
1e0f0 74 20 41 41 41 0a 20 20 20 20 20 20 20 20 23 2d  t AAA.        #-
1e100 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e110 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e120 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20  --------------- 
1e130 20 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 20            .     
1e140 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54     S_SILKTORRENT
1e150 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54  _PACKAGER_T1_ACT
1e160 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20  ION="$S_TMP_0". 
1e170 20 20 20 20 20 20 20 53 42 5f 52 45 51 55 45 53         SB_REQUES
1e180 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54  TED_ACTION_EXIST
1e190 53 3d 22 74 22 0a 20 20 20 20 20 20 20 20 53 42  S="t".        SB
1e1a0 5f 46 49 4c 45 5f 52 45 51 55 49 52 45 44 3d 22  _FILE_REQUIRED="
1e1b0 66 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66  f".    fi.    if
1e1c0 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d   [ "$S_ARGV_0" =
1e1d0 3d 20 22 76 6e 66 31 22 20 5d 3b 20 74 68 65 6e  = "vnf1" ]; then
1e1e0 20 20 23 20 61 62 62 72 65 76 69 61 74 69 6f 6e    # abbreviation
1e1f0 20 6f 66 20 22 76 65 72 69 66 79 20 6e 61 6d 65   of "verify name
1e200 20 66 6f 72 6d 61 74 20 76 31 22 0a 20 20 20 20   format v1".    
1e210 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e      S_SILKTORREN
1e220 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43  T_PACKAGER_T1_AC
1e230 54 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30 22 0a  TION="$S_TMP_0".
1e240 20 20 20 20 20 20 20 20 53 42 5f 52 45 51 55 45          SB_REQUE
1e250 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49 53  STED_ACTION_EXIS
1e260 54 53 3d 22 74 22 0a 20 20 20 20 20 20 20 20 53  TS="t".        S
1e270 42 5f 46 49 4c 45 5f 52 45 51 55 49 52 45 44 3d  B_FILE_REQUIRED=
1e280 22 66 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69  "f".    fi.    i
1e290 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20  f [ "$S_ARGV_0" 
1e2a0 3d 3d 20 22 2d 76 6e 66 31 22 20 5d 3b 20 74 68  == "-vnf1" ]; th
1e2b0 65 6e 20 20 23 20 61 62 62 72 65 76 69 61 74 69  en  # abbreviati
1e2c0 6f 6e 20 6f 66 20 22 76 65 72 69 66 79 20 6e 61  on of "verify na
1e2d0 6d 65 20 66 6f 72 6d 61 74 20 76 31 22 0a 20 20  me format v1".  
1e2e0 20 20 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52        S_SILKTORR
1e2f0 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f  ENT_PACKAGER_T1_
1e300 41 43 54 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30  ACTION="$S_TMP_0
1e310 22 0a 20 20 20 20 20 20 20 20 53 42 5f 52 45 51  ".        SB_REQ
1e320 55 45 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58  UESTED_ACTION_EX
1e330 49 53 54 53 3d 22 74 22 0a 20 20 20 20 20 20 20  ISTS="t".       
1e340 20 53 42 5f 46 49 4c 45 5f 52 45 51 55 49 52 45   SB_FILE_REQUIRE
1e350 44 3d 22 66 22 0a 20 20 20 20 66 69 0a 20 20 20  D="f".    fi.   
1e360 20 23 20 54 68 65 20 33 2e 20 63 6f 6e 73 6f 6c   # The 3. consol
1e370 65 20 61 72 67 75 6d 65 6e 74 20 70 72 65 73 65  e argument prese
1e380 6e 63 65 2f 61 62 73 65 6e 63 65 20 63 68 65 63  nce/absence chec
1e390 6b 20 6d 75 73 74 20 62 65 0a 20 20 20 20 23 20  k must be.    # 
1e3a0 69 6e 74 65 6e 74 69 6f 6e 61 6c 6c 79 20 73 6b  intentionally sk
1e3b0 69 70 70 65 64 20 66 6f 72 20 74 68 65 20 22 76  ipped for the "v
1e3c0 65 72 69 66 79 5f 70 61 63 6b 65 74 5f 6e 61 6d  erify_packet_nam
1e3d0 65 5f 66 6f 72 6d 61 74 5f 76 31 22 2c 20 62 65  e_format_v1", be
1e3e0 63 61 75 73 65 20 0a 20 20 20 20 23 20 74 68 65  cause .    # the
1e3f0 20 63 6f 6e 73 6f 6c 65 20 6f 75 74 70 75 74 20   console output 
1e400 6d 75 73 74 20 72 65 74 75 72 6e 20 61 20 73 70  must return a sp
1e410 65 63 69 66 69 63 20 73 74 72 69 6e 67 20 69 6e  ecific string in
1e420 20 74 68 65 20 63 61 73 65 20 6f 66 20 0a 20 20   the case of .  
1e430 20 20 23 20 61 20 70 61 63 6b 65 74 20 6e 61 6d    # a packet nam
1e440 65 20 66 6f 72 6d 61 74 20 76 65 72 69 66 69 63  e format verific
1e450 61 74 69 6f 6e 20 66 61 69 6c 75 72 65 20 61 6e  ation failure an
1e460 64 20 61 6e 79 20 73 74 72 69 6e 67 2c 20 0a 20  d any string, . 
1e470 20 20 20 23 20 69 6e 63 6c 75 64 69 6e 67 20 74     # including t
1e480 68 65 20 73 74 72 69 6e 67 73 20 74 68 61 74 20  he strings that 
1e490 69 6e 63 6c 75 64 65 20 73 70 61 63 65 73 2c 20  include spaces, 
1e4a0 6d 75 73 74 20 62 65 20 61 6c 6c 6f 77 65 64 20  must be allowed 
1e4b0 74 6f 20 62 65 20 76 65 72 69 66 69 65 64 2e 0a  to be verified..
1e4c0 20 20 20 20 23 20 0a 20 20 20 20 23 20 41 20 74      # .    # A t
1e4d0 68 69 6e 67 20 74 6f 20 6b 65 65 70 20 69 6e 20  hing to keep in 
1e4e0 6d 69 6e 64 20 69 73 20 61 6c 73 6f 20 74 68 61  mind is also tha
1e4f0 74 20 74 68 65 20 22 75 6e 77 72 61 70 22 20 63  t the "unwrap" c
1e500 6f 6d 6d 61 6e 64 20 0a 20 20 20 20 23 20 72 65  ommand .    # re
1e510 76 65 72 74 73 20 74 6f 20 74 68 65 20 22 76 65  verts to the "ve
1e520 72 69 66 79 5f 70 61 63 6b 65 74 5f 6e 61 6d 65  rify_packet_name
1e530 5f 66 6f 72 6d 61 74 5f 76 31 22 20 63 6f 6d 6d  _format_v1" comm
1e540 61 6e 64 2c 20 69 66 20 74 68 65 20 0a 20 20 20  and, if the .   
1e550 20 23 20 66 69 6c 65 20 6e 61 6d 65 20 6f 66 20   # file name of 
1e560 61 20 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61  a Silktorrent pa
1e570 63 6b 65 74 20 63 61 6e 64 69 64 61 74 65 20 63  cket candidate c
1e580 6f 6e 74 61 69 6e 73 20 61 6e 79 20 73 70 61 63  ontains any spac
1e590 65 73 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  es..    #-------
1e5a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e5b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e5c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e5d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
1e5e0 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 52 45      if [ "$SB_RE
1e5f0 51 55 45 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45  QUESTED_ACTION_E
1e600 58 49 53 54 53 22 20 21 3d 20 22 74 22 20 5d 3b  XISTS" != "t" ];
1e610 20 74 68 65 6e 20 23 20 6c 61 63 6b 20 6f 66 20   then # lack of 
1e620 61 63 74 69 6f 6e 20 69 6e 63 6c 75 64 65 64 0a  action included.
1e630 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d 6d          func_mmm
1e640 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61  v_silktorrent_pa
1e650 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 70  ckager_t1_bash_p
1e660 72 69 6e 74 5f 68 65 6c 70 5f 6d 73 67 5f 74 31  rint_help_msg_t1
1e670 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
1e680 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
1e690 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69  ORIG.        exi
1e6a0 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
1e6b0 61 6e 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  an error.    fi.
1e6c0 20 20 20 20 53 42 5f 52 45 51 55 45 53 54 45 44      SB_REQUESTED
1e6d0 5f 41 43 54 49 4f 4e 5f 45 58 49 53 54 53 3d 22  _ACTION_EXISTS="
1e6e0 66 22 20 23 20 61 20 72 65 73 65 74 20 74 6f 20  f" # a reset to 
1e6f0 61 6e 74 69 63 69 70 61 74 65 20 66 6c 61 77 73  anticipate flaws
1e700 20 65 6c 73 65 77 68 65 72 65 0a 20 20 20 20 23   elsewhere.    #
1e710 20 54 68 65 20 61 63 74 69 6f 6e 20 6e 61 6d 65   The action name
1e720 20 74 65 73 74 20 61 62 6f 76 65 20 68 61 73 20   test above has 
1e730 74 6f 20 62 65 20 62 65 66 6f 72 65 20 74 68 65  to be before the
1e740 20 0a 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f   .    if [ "$SB_
1e750 46 49 4c 45 5f 52 45 51 55 49 52 45 44 22 20 3d  FILE_REQUIRED" =
1e760 3d 20 22 74 22 20 5d 3b 20 74 68 65 6e 0a 20 20  = "t" ]; then.  
1e770 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f        func_mmmv_
1e780 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b  silktorrent_pack
1e790 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 65 78 63  ager_t1_bash_exc
1e7a0 5f 61 73 73 65 72 74 5f 77 72 61 70 70 61 62 6c  _assert_wrappabl
1e7b0 65 5f 66 69 6c 65 5f 65 78 69 73 74 73 5f 74 31  e_file_exists_t1
1e7c0 20 22 24 53 5f 41 52 47 56 5f 31 22 0a 20 20 20   "$S_ARGV_1".   
1e7d0 20 65 6c 73 65 20 0a 20 20 20 20 20 20 20 20 66   else .        f
1e7e0 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72  unc_mmmv_silktor
1e7f0 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31  rent_packager_t1
1e800 5f 62 61 73 68 5f 65 78 63 5f 61 73 73 65 72 74  _bash_exc_assert
1e810 5f 70 61 63 6b 65 74 5f 6e 61 6d 65 5f 63 61 6e  _packet_name_can
1e820 64 69 64 61 74 65 5f 65 78 69 73 74 73 5f 74 31  didate_exists_t1
1e830 20 22 24 53 5f 41 52 47 56 5f 31 22 0a 20 20 20   "$S_ARGV_1".   
1e840 20 66 69 0a 20 20 20 20 23 20 62 65 63 61 75 73   fi.    # becaus
1e850 65 20 6f 74 68 65 72 77 69 73 65 20 74 68 65 20  e otherwise the 
1e860 65 72 72 6f 72 20 6d 65 73 73 61 67 65 73 20 77  error messages w
1e870 6f 75 6c 64 20 62 65 20 69 6e 63 6f 72 72 65 63  ould be incorrec
1e880 74 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  t..    #--------
1e890 0a 20 20 20 20 23 20 54 68 65 20 66 6f 6c 6c 6f  .    # The follo
1e8a0 77 69 6e 67 20 64 75 70 6c 69 63 61 74 69 6e 67  wing duplicating
1e8b0 20 73 65 72 69 65 73 20 6f 66 20 69 66 2d 63 6c   series of if-cl
1e8c0 61 75 73 65 73 20 69 73 20 74 6f 20 61 6c 6c 6f  auses is to allo
1e8d0 77 20 0a 20 20 20 20 23 20 61 63 74 69 6f 6e 73  w .    # actions
1e8e0 20 74 6f 20 68 61 76 65 20 61 6c 69 61 73 65 73   to have aliases
1e8f0 2e 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 53  ..    if [ "$S_S
1e900 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41  ILKTORRENT_PACKA
1e910 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 22 20 3d  GER_T1_ACTION" =
1e920 3d 20 22 77 72 61 70 22 20 5d 3b 20 74 68 65 6e  = "wrap" ]; then
1e930 0a 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d  .        func_mm
1e940 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70  mv_silktorrent_p
1e950 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f  ackager_t1_bash_
1e960 77 72 61 70 5f 74 31 20 22 24 53 5f 41 52 47 56  wrap_t1 "$S_ARGV
1e970 5f 31 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d  _1".        #---
1e980 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
1e990 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
1e9a0 65 78 69 74 20 30 20 23 20 65 78 69 74 20 77 69  exit 0 # exit wi
1e9b0 74 68 6f 75 74 20 61 6e 20 65 72 72 6f 72 0a 20  thout an error. 
1e9c0 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a     fi.    #----.
1e9d0 20 20 20 20 69 66 20 5b 20 22 24 53 5f 53 49 4c      if [ "$S_SIL
1e9e0 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45  KTORRENT_PACKAGE
1e9f0 52 5f 54 31 5f 41 43 54 49 4f 4e 22 20 3d 3d 20  R_T1_ACTION" == 
1ea00 22 75 6e 77 72 61 70 22 20 5d 3b 20 74 68 65 6e  "unwrap" ]; then
1ea10 0a 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d  .        func_mm
1ea20 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70  mv_silktorrent_p
1ea30 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f  ackager_t1_bash_
1ea40 75 6e 77 72 61 70 5f 74 31 20 22 24 53 5f 41 52  unwrap_t1 "$S_AR
1ea50 47 56 5f 31 22 0a 20 20 20 20 20 20 20 20 23 2d  GV_1".        #-
1ea60 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
1ea70 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
1ea80 20 20 65 78 69 74 20 30 20 23 20 65 78 69 74 20    exit 0 # exit 
1ea90 77 69 74 68 6f 75 74 20 61 6e 20 65 72 72 6f 72  without an error
1eaa0 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
1eab0 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 53  -.    if [ "$S_S
1eac0 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41  ILKTORRENT_PACKA
1ead0 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 22 20 3d  GER_T1_ACTION" =
1eae0 3d 20 22 76 65 72 69 66 79 22 20 5d 3b 20 74 68  = "verify" ]; th
1eaf0 65 6e 0a 20 20 20 20 20 20 20 20 66 75 6e 63 5f  en.        func_
1eb00 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74  mmmv_silktorrent
1eb10 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73  _packager_t1_bas
1eb20 68 5f 76 65 72 69 66 79 5f 66 69 6c 65 5f 6e 61  h_verify_file_na
1eb30 6d 65 5f 74 31 20 22 24 53 5f 41 52 47 56 5f 31  me_t1 "$S_ARGV_1
1eb40 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
1eb50 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c  $S_FUNC_MMMV_SIL
1eb60 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45  KTORRENT_PACKAGE
1eb70 52 5f 54 31 5f 42 41 53 48 5f 56 45 52 49 46 59  R_T1_BASH_VERIFY
1eb80 5f 46 49 4c 45 5f 4e 41 4d 45 5f 54 31 5f 52 45  _FILE_NAME_T1_RE
1eb90 53 55 4c 54 22 0a 20 20 20 20 20 20 20 20 23 2d  SULT".        #-
1eba0 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
1ebb0 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
1ebc0 20 20 65 78 69 74 20 30 20 23 20 65 78 69 74 20    exit 0 # exit 
1ebd0 77 69 74 68 6f 75 74 20 61 6e 20 65 72 72 6f 72  without an error
1ebe0 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
1ebf0 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 53  -.    if [ "$S_S
1ec00 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41  ILKTORRENT_PACKA
1ec10 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 22 20 3d  GER_T1_ACTION" =
1ec20 3d 20 22 74 65 73 74 5f 68 61 73 68 5f 74 31 22  = "test_hash_t1"
1ec30 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1ec40 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74   func_mmmv_silkt
1ec50 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f  orrent_packager_
1ec60 74 31 5f 62 61 73 68 5f 74 65 73 74 5f 31 20 22  t1_bash_test_1 "
1ec70 24 53 5f 41 52 47 56 5f 31 22 0a 20 20 20 20 20  $S_ARGV_1".     
1ec80 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
1ec90 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
1eca0 20 20 20 20 20 20 20 65 78 69 74 20 30 20 23 20         exit 0 # 
1ecb0 65 78 69 74 20 77 69 74 68 6f 75 74 20 61 6e 20  exit without an 
1ecc0 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20  error.    fi.   
1ecd0 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23   #--------.    #
1ece0 20 53 74 61 72 74 20 6f 66 20 61 63 74 69 6f 6e   Start of action
1ecf0 73 20 74 68 61 74 20 64 6f 20 6e 6f 74 20 72 65  s that do not re
1ed00 71 75 69 72 65 20 61 20 66 69 6c 65 3a 0a 20 20  quire a file:.  
1ed10 20 20 69 66 20 5b 20 22 24 53 5f 53 49 4c 4b 54    if [ "$S_SILKT
1ed20 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
1ed30 54 31 5f 41 43 54 49 4f 4e 22 20 3d 3d 20 22 76  T1_ACTION" == "v
1ed40 65 72 69 66 79 5f 70 61 63 6b 65 74 5f 6e 61 6d  erify_packet_nam
1ed50 65 5f 66 6f 72 6d 61 74 5f 76 31 22 20 5d 3b 20  e_format_v1" ]; 
1ed60 74 68 65 6e 0a 20 20 20 20 20 20 20 20 66 75 6e  then.        fun
1ed70 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65  c_mmmv_silktorre
1ed80 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62  nt_packager_t1_b
1ed90 61 73 68 5f 76 65 72 69 66 79 5f 70 61 63 6b 65  ash_verify_packe
1eda0 74 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f 76 31  t_name_format_v1
1edb0 20 22 24 53 5f 41 52 47 56 5f 31 22 0a 20 20 20   "$S_ARGV_1".   
1edc0 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
1edd0 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
1ede0 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 30 20  .        exit 0 
1edf0 23 20 65 78 69 74 20 77 69 74 68 6f 75 74 20 61  # exit without a
1ee00 6e 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20  n error.    fi. 
1ee10 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
1ee20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  --------------. 
1ee30 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 20 0a         echo "" .
1ee40 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
1ee50 69 73 20 62 61 73 68 20 73 63 72 69 70 74 20 69  is bash script i
1ee60 73 20 66 6c 61 77 65 64 2e 20 54 68 65 20 63 6f  s flawed. The co
1ee70 6e 74 72 6f 6c 20 66 6c 6f 77 20 22 20 0a 20 20  ntrol flow " .  
1ee80 20 20 20 20 20 20 65 63 68 6f 20 22 73 68 6f 75        echo "shou
1ee90 6c 64 20 68 61 76 65 20 6e 65 76 65 72 20 72 65  ld have never re
1eea0 61 63 68 65 64 20 74 68 69 73 20 6c 69 6e 65 2e  ached this line.
1eeb0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
1eec0 47 55 49 44 3d 3d 27 32 63 37 38 37 65 61 33 2d  GUID=='2c787ea3-
1eed0 34 62 61 61 2d 34 66 36 66 2d 38 34 62 65 2d 32  4baa-4f6f-84be-2
1eee0 31 62 31 37 30 65 30 33 31 65 37 27 22 0a 20 20  1b170e031e7'".  
1eef0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
1ef00 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
1ef10 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
1ef20 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31  G.        exit 1
1ef30 20 23 20 65 78 69 74 20 77 69 74 68 20 61 6e 20   # exit with an 
1ef40 65 72 72 6f 72 0a 7d 20 23 20 66 75 6e 63 5f 6d  error.} # func_m
1ef50 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f  mmv_silktorrent_
1ef60 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68  packager_t1_bash
1ef70 5f 64 65 74 65 72 6d 69 6e 65 5f 61 63 74 69 6f  _determine_actio
1ef80 6e 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c  n..func_mmmv_sil
1ef90 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65  ktorrent_package
1efa0 72 5f 74 31 5f 62 61 73 68 5f 64 65 74 65 72 6d  r_t1_bash_determ
1efb0 69 6e 65 5f 61 63 74 69 6f 6e 20 24 31 20 24 32  ine_action $1 $2
1efc0 20 24 33 20 24 34 20 24 35 20 24 36 20 24 37 0a   $3 $4 $5 $6 $7.
1efd0 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
1efe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1eff0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f000 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f010 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 0a  -------------...
1f020 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
1f030 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f050 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f060 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 63 64 20 24  -----------.cd $
1f070 53 5f 46 50 5f 4f 52 49 47 0a 65 78 69 74 20 30  S_FP_ORIG.exit 0
1f080 20 23 20 0a 0a 23 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d   # ..#==========
1f090 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f0a0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f0b0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f0c0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f0d0 0a 23 20 46 72 61 67 6d 65 6e 74 73 20 6f 66 20  .# Fragments of 
1f0e0 63 6f 6d 6d 65 6e 74 73 20 61 6e 64 20 63 6f 64  comments and cod
1f0f0 65 20 74 68 61 74 20 6d 69 67 68 74 20 66 69 6e  e that might fin
1f100 64 20 75 73 65 20 73 6f 6d 65 20 74 69 6d 65 73  d use some times
1f110 20 6c 61 74 65 72 3a 0a 23 2d 2d 2d 2d 2d 2d 2d   later:.#-------
1f120 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f130 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f140 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f150 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f160 2d 2d 2d 0a 23 0a 23 20 20 20 6d 61 78 20 35 35  ---.#.#   max 55
1f170 20 63 68 61 72 61 63 74 65 72 73 20 2d 2d 2d 20   characters --- 
1f180 70 61 63 6b 61 67 65 20 73 75 67 67 65 73 74 65  package suggeste
1f190 64 20 64 65 70 72 65 63 61 74 69 6f 6e 20 64 61  d deprecation da
1f1a0 74 65 20 69 6e 20 6e 61 6e 6f 73 65 63 6f 6e 64  te in nanosecond
1f1b0 73 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20  s.#             
1f1c0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6c 61              rela
1f1d0 74 69 76 65 20 74 6f 20 74 68 65 20 55 6e 69 78  tive to the Unix
1f1e0 20 45 70 6f 63 68 2c 20 0a 23 20 20 20 20 20 20   Epoch, .#      
1f1f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1f200 20 20 20 77 72 69 74 74 65 6e 20 69 6e 20 62 61     written in ba
1f210 73 65 20 31 30 2e 20 49 74 20 63 61 6e 20 62 65  se 10. It can be
1f220 20 6e 65 67 61 74 69 76 65 2e 0a 23 20 20 20 20   negative..#    
1f230 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1f240 20 20 20 20 20 72 67 78 5f 69 6e 5f 72 75 62 79       rgx_in_ruby
1f250 3d 2f 74 28 28 79 5b 2d 5d 3f 5b 5c 64 5d 2b 29  =/t((y[-]?[\d]+)
1f260 7c 6e 29 5b 5f 5d 2f 0a 23 20 65 63 68 6f 20 22  |n)[_]/.# echo "
1f270 76 30 30 33 34 5f 73 32 33 34 32 5f 74 6e 5f 22  v0034_s2342_tn_"
1f280 20 7c 20 67 61 77 6b 20 27 7b 20 67 73 75 62 28   | gawk '{ gsub(
1f290 2f 5f 2f 2c 20 22 5f 5c 6e 22 29 3b 20 70 72 69  /_/, "_\n"); pri
1f2a0 6e 74 20 7d 27 20 7c 20 5c 0a 23 20 20 20 20 20  nt }' | \.#     
1f2b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1f2c0 20 20 20 20 20 67 61 77 6b 20 27 2f 5e 74 28 79       gawk '/^t(y
1f2d0 5b 2d 5d 3f 5b 30 2d 39 5d 2b 7c 6e 29 5f 2f 20  [-]?[0-9]+|n)_/ 
1f2e0 7b 70 72 69 6e 74 66 20 22 25 73 22 2c 24 31 20  {printf "%s",$1 
1f2f0 7d 27 20 7c 0a 23 20 20 20 20 20 20 20 20 20 20  }' |.#          
1f300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1f310 67 61 77 6b 20 27 7b 67 73 75 62 28 2f 5b 74 79  gawk '{gsub(/[ty
1f320 6e 5f 5d 2f 2c 22 22 29 3b 70 72 69 6e 74 66 20  n_]/,"");printf 
1f330 22 25 73 22 2c 20 24 31 20 7d 27 0a 23 20 20 20  "%s", $1 }'.#   
1f340 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1f350 20 20 20 20 20 20 0a 23 0a 23 2d 2d 2d 2d 2d 2d        .#.#------
1f360 2d 2d 0a 23 20 54 68 65 20 61 77 6b 20 63 6f 64  --.# The awk cod
1f370 65 20 65 78 61 6d 70 6c 65 20 6f 72 69 67 69 6e  e example origin
1f380 61 74 65 73 20 66 72 6f 6d 20 0a 23 20 68 74 74  ates from .# htt
1f390 70 3a 2f 2f 77 77 77 2e 6c 69 6e 75 78 61 6e 64  p://www.linuxand
1f3a0 6c 69 66 65 2e 63 6f 6d 2f 32 30 31 33 2f 30 36  life.com/2013/06
1f3b0 2f 68 6f 77 2d 74 6f 2d 72 65 76 65 72 73 65 2d  /how-to-reverse-
1f3c0 73 74 72 69 6e 67 2e 68 74 6d 6c 0a 23 20 61 72  string.html.# ar
1f3d0 63 68 69 76 61 6c 20 63 6f 70 79 3a 20 68 74 74  chival copy: htt
1f3e0 70 73 3a 2f 2f 61 72 63 68 69 76 65 2e 69 73 2f  ps://archive.is/
1f3f0 43 78 30 78 46 0a 23 20 53 5f 54 4d 50 5f 30 3d  Cx0xF.# S_TMP_0=
1f400 22 60 70 72 69 6e 74 66 20 22 24 53 5f 49 4e 22  "`printf "$S_IN"
1f410 20 7c 20 5c 0a 23 20 20 20 20 61 77 6b 20 27 7b   | \.#    awk '{
1f420 20 66 6f 72 28 69 3d 6c 65 6e 67 74 68 3b 69 21   for(i=length;i!
1f430 3d 30 3b 69 2d 2d 29 78 3d 78 20 73 75 62 73 74  =0;i--)x=x subst
1f440 72 28 24 30 2c 69 2c 31 29 3b 7d 45 4e 44 7b 70  r($0,i,1);}END{p
1f450 72 69 6e 74 66 20 20 78 7d 27 60 22 0a 23 2d 2d  rintf  x}'`".#--
1f460 2d 2d 2d 2d 2d 2d 0a 23 0a 23 53 5f 54 4d 50 5f  ------.#.#S_TMP_
1f470 30 3d 22 60 70 72 69 6e 74 66 20 5c 22 24 53 5f  0="`printf \"$S_
1f480 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
1f490 55 54 41 42 4c 45 5f 32 5c 22 20 7c 20 67 61 77  UTABLE_2\" | gaw
1f4a0 6b 20 27 7b 67 73 75 62 28 2f 5c 73 2f 2c 22 22  k '{gsub(/\s/,""
1f4b0 29 3b 70 72 69 6e 74 66 20 22 25 73 22 2c 20 24  );printf "%s", $
1f4c0 31 20 7d 27 60 22 0a 23 53 5f 54 4d 50 5f 30 3d  1 }'`".#S_TMP_0=
1f4d0 24 28 20 70 72 69 6e 74 66 20 22 24 53 5f 43 41  $( printf "$S_CA
1f4e0 4e 44 49 44 41 54 45 22 20 7c 20 67 61 77 6b 20  NDIDATE" | gawk 
1f4f0 27 7b 67 73 75 62 28 2f 5e 5b 2b 5d 2f 2c 22 22  '{gsub(/^[+]/,""
1f500 29 3b 20 70 72 69 6e 74 66 20 22 25 73 22 2c 20  ); printf "%s", 
1f510 24 31 7d 27 20 29 0a 23 53 5f 54 4d 50 5f 31 3d  $1}' ).#S_TMP_1=
1f520 24 28 20 70 72 69 6e 74 66 20 22 24 53 5f 54 4d  $( printf "$S_TM
1f530 50 5f 30 22 20 20 20 20 20 7c 20 67 61 77 6b 20  P_0"     | gawk 
1f540 27 7b 67 73 75 62 28 2f 5b 30 31 32 33 34 35 36  '{gsub(/[0123456
1f550 37 38 39 5d 2b 2f 2c 22 22 29 3b 20 70 72 69 6e  789]+/,""); prin
1f560 74 66 20 22 25 73 22 2c 20 24 31 7d 27 20 29 0a  tf "%s", $1}' ).
1f570 23 53 5f 54 4d 50 5f 30 3d 24 28 20 70 72 69 6e  #S_TMP_0=$( prin
1f580 74 66 20 22 24 53 5f 43 41 4e 44 49 44 41 54 45  tf "$S_CANDIDATE
1f590 22 20 7c 20 67 61 77 6b 20 27 7b 67 73 75 62 28  " | gawk '{gsub(
1f5a0 2f 5c 73 2b 2f 2c 22 22 29 3b 20 70 72 69 6e 74  /\s+/,""); print
1f5b0 66 20 22 25 73 22 2c 20 24 31 7d 27 20 29 0a 23  f "%s", $1}' ).#
1f5c0 53 5f 54 4d 50 5f 31 3d 24 28 20 70 72 69 6e 74  S_TMP_1=$( print
1f5d0 66 20 22 24 53 5f 54 4d 50 5f 30 22 20 7c 20 67  f "$S_TMP_0" | g
1f5e0 61 77 6b 20 27 7b 67 73 75 62 28 2f 5e 5b 30 5d  awk '{gsub(/^[0]
1f5f0 2b 2f 2c 22 22 29 3b 20 70 72 69 6e 74 66 20 22  +/,""); printf "
1f600 25 73 22 2c 20 24 31 7d 27 20 29 0a 23 53 5f 54  %s", $1}' ).#S_T
1f610 4d 50 5f 30 3d 22 60 70 72 69 6e 74 66 20 20 5c  MP_0="`printf  \
1f620 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f  "$S_NAME_OF_THE_
1f630 42 41 53 48 5f 46 55 4e 43 54 49 4f 4e 5c 22 20  BASH_FUNCTION\" 
1f640 7c 20 67 61 77 6b 20 27 7b 67 73 75 62 28 2f 5c  | gawk '{gsub(/\
1f650 73 2f 2c 22 22 29 3b 70 72 69 6e 74 66 20 22 25  s/,"");printf "%
1f660 73 22 2c 20 24 31 20 7d 27 60 22 0a 23 53 5f 54  s", $1 }'`".#S_T
1f670 4d 50 5f 30 3d 22 60 70 72 69 6e 74 66 20 20 5c  MP_0="`printf  \
1f680 22 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53  "$S_FP_2_AN_EXIS
1f690 54 49 4e 47 5f 46 49 4c 45 5c 22 20 7c 20 67 61  TING_FILE\" | ga
1f6a0 77 6b 20 27 7b 67 73 75 62 28 2f 5c 73 2f 2c 22  wk '{gsub(/\s/,"
1f6b0 22 29 3b 70 72 69 6e 74 66 20 22 25 73 22 2c 20  ");printf "%s", 
1f6c0 24 31 20 7d 27 60 22 0a 23 53 5f 54 4d 50 5f 30  $1 }'`".#S_TMP_0
1f6d0 3d 22 60 70 72 69 6e 74 66 20 5c 22 24 53 5f 4e  ="`printf \"$S_N
1f6e0 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55  AME_OF_THE_EXECU
1f6f0 54 41 42 4c 45 5f 32 5c 22 20 7c 20 67 61 77 6b  TABLE_2\" | gawk
1f700 20 27 7b 67 73 75 62 28 2f 5c 73 2f 2c 22 22 29   '{gsub(/\s/,"")
1f710 3b 70 72 69 6e 74 66 20 22 25 73 22 2c 20 24 31  ;printf "%s", $1
1f720 20 7d 27 60 22 0a 0a 23 3d 3d 3d 3d 3d 3d 3d 3d   }'`"..#========
1f730 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f740 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f750 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f760 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f770 3d 3d 0a 0a                                      ==..