From cf3661464c600471a077042393611191e4f79295 Mon Sep 17 00:00:00 2001
From: Rolf Niepraschk <Rolf.Niepraschk@ptb.de>
Date: Thu, 7 Jan 2021 10:54:02 +0100
Subject: [PATCH] change the installation steps; better pretty script

---
 README.md      | 20 ++++++++++++--------
 pretty_c14n.py |  8 ++++----
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index dfa9a6d..96182ec 100644
--- a/README.md
+++ b/README.md
@@ -43,22 +43,26 @@ Do the following steps with root permission on the server installation:
 ```shell
 mkdir -p /usr/local/share/vl-dcc
 cd /usr/local/share/vl-dcc
-curl --silent --output - \
+curl --silent --insecure --output - \
   https://gitlab1.ptb.de/niepra01/vl-dcc/-/archive/master/vl-dcc-master.tar \
-  | tar xf - --strip-components=1           # only once
+  | tar xf - --strip-components=1        # only once
+sudo apt install python3-pip             # openSUSE: sudo zypper in python3-pip 
 python3 -m venv .
 source bin/activate
 pip3 install pip-tools
-pip-compile
-chown -R nobody.nobody ../vl-dcc
-systemctl daemon-reload                     # if already exist
+pip-compile --output-file=requirements.txt requirements.in
+pip3 install -r requirements.txt
+chown -R nobody.nogroup $PWD             # openSUSE: chown -R nobody.nobody $PWD
+systemctl daemon-reload                  # if already exist
 systemctl link $PWD/vl-dcc.service
-systemctl enable vl-dcc.service             # make permanent
+systemctl enable vl-dcc.service          # make permanent
 systemctl start vl-dcc.service      
-systemctl status vl-dcc.service             # running?
-journalctl -f --unit vl-dcc.service         # run-time check
+systemctl status vl-dcc.service          # running?
+journalctl -f --unit vl-dcc.service      # run-time check
 ```
 
+<!-- TODO: "setup-py" weg, stattdessen: "requirements.in" -->
+
 ## api
 
 ### vl-dcc/<cer_doc_id> (GET)
diff --git a/pretty_c14n.py b/pretty_c14n.py
index d8786c4..1c021fb 100755
--- a/pretty_c14n.py
+++ b/pretty_c14n.py
@@ -2,15 +2,15 @@
 
 import sys
 from trans import pretty_c14n
-
-def error_exit(x):
-    print('ERROR: ', str(x), file=sys.stderr)
-    sys.exit(1)
     
 if len(sys.argv) < 3:
     error_exit('too few arguments')
 if sys.argv[1] == sys.argv[2]:
     error_exit('"infile" and "outfile" must be different')
+    
+def error_exit(x):
+    print('ERROR: ', str(x), file=sys.stderr)
+    sys.exit(1)
 
 infile = sys.argv[1]
 outfile = sys.argv[2]
-- 
GitLab