summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-10-14 22:26:22 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-10-14 22:26:22 +0200
commitc0d09e598a153624532f8d3b2ebcab5808e6c958 (patch)
treef3ec086d3806940332c943c15ad63a3ba3e7cb82 /debian/patches
parent9b36ecfec7b1111f7f7be5e5a525a7ca59955756 (diff)
Install mwctools.py to /usr/share/mwc; New debian/patches/0001-config.patch; New debian/NEWS.Debian
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0001-config.patch83
-rw-r--r--debian/patches/series1
2 files changed, 84 insertions, 0 deletions
diff --git a/debian/patches/0001-config.patch b/debian/patches/0001-config.patch
new file mode 100644
index 0000000..df47bb4
--- /dev/null
+++ b/debian/patches/0001-config.patch
@@ -0,0 +1,83 @@
+Description: add loading config from every path
+ Add loading config from every path
+ Separation data / program
+Author: Jörg Frings-Fürst <jff@jff-webhosting.net>
+Last-Update: 2017-10-14
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/mwc.py
+===================================================================
+--- trunk.orig/mwc.py
++++ trunk/mwc.py
+@@ -198,7 +198,7 @@ def pollWebsites():
+
+
+ if __name__ == "__main__":
+- configMod = 'config'
++ configMod = '/etc/mwc/mwc-config'
+ dryrun = None
+
+ try:
+@@ -215,7 +215,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 thesite in config.sites:
+Index: trunk/mwcfeedserver.py
+===================================================================
+--- trunk.orig/mwcfeedserver.py
++++ trunk/mwcfeedserver.py
+@@ -14,7 +14,7 @@ import getopt
+
+ bind = 'localhost'
+ port = 8000
+-configMod = 'config'
++configMod = '/etc/mwc/mwc-config'
+
+
+ try:
+@@ -34,7 +34,23 @@ 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)
++ try:
++ os.chdir(config.datadir)
++ except:
++ print('Error: datadir not found')
++ sys.exit(3)
+
+
+ handler = http.server.SimpleHTTPRequestHandler
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..2361bcf 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-config.patch