From 9a955c414e34de441b5f188520314d54e3c5b3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 1 Oct 2017 20:08:51 +0200 Subject: remove patches; rewrite d/changelog --- debian/patches/0100-config.diff | 88 ----------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 debian/patches/0100-config.diff (limited to 'debian/patches/0100-config.diff') diff --git a/debian/patches/0100-config.diff b/debian/patches/0100-config.diff deleted file mode 100644 index 49bb589..0000000 --- a/debian/patches/0100-config.diff +++ /dev/null @@ -1,88 +0,0 @@ -Description: add loading config from every path - Add loading config from ervery path - Separation data / program -Author: Jörg Frings-Fürst -Last-Update: 2014-05-12 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ -Index: trunk/mwcfeedserver.py -=================================================================== ---- trunk.orig/mwcfeedserver.py -+++ trunk/mwcfeedserver.py -@@ -6,6 +6,7 @@ - import http.server - import socketserver - import importlib -+import os - import sys - import getopt - -@@ -31,13 +32,26 @@ for opt, arg in opts: - elif opt in ('-p', '--port'): - port = int(arg) - --config = importlib.import_module(configMod) -- -+# -+# add code to load config from nonsystem path -+# and change to datadir -+# -+try: -+ path = os.path.dirname(configMod) -+ fullname = os.path.basename(configMod) -+ sys.path.append(path) -+ config = importlib.import_module(fullname) -+except: -+ print('Error: loading config') -+ sys.exit(2) - - handler = http.server.SimpleHTTPRequestHandler - - httpd = socketserver.TCPServer((bind, port), handler) - - print('Bond to ' + bind + ', listening on port ' + str(port)) --httpd.serve_forever() -- -+try: -+ httpd.serve_forever() -+except KeyboardInterrupt: -+ pass -+httpd.server_close() -Index: trunk/mwc.py -=================================================================== ---- trunk.orig/mwc.py -+++ trunk/mwc.py -@@ -334,7 +334,7 @@ def pollWebsites(): - - if __name__ == "__main__": - -- configMod = 'config' -+ configMod = '/etc/mwc/mwc-config' - dryrun = None - - try: -@@ -351,7 +351,23 @@ if __name__ == "__main__": - elif opt in ('-d', '--dry-run'): - dryrun = arg - -- config = importlib.import_module(configMod) -+ # -+ # add code to load config from nonsystem path -+ # and change to datadir -+ # -+ try: -+ path = os.path.dirname(configMod) -+ fullname = os.path.basename(configMod) -+ sys.path.append(path) -+ config = importlib.import_module(fullname) -+ except: -+ print('Error: loading config') -+ sys.exit(2) -+ try: -+ os.chdir(config.datadir) -+ except: -+ print('Error: datadir not found') -+ sys.exit(3) - - if dryrun: - for site in config.sites: -- cgit v1.2.3