aboutsummaryrefslogtreecommitdiff
path: root/ca
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-03-22 23:55:11 +0000
committerRob Austein <sra@hactrn.net>2016-03-22 23:55:11 +0000
commit8e46ff7d680f05f7690ea7702f5cb596fbc76c3e (patch)
treef8629964c518b8d0ee4476985b434fdeb841fdd1 /ca
parent06c36280969363739bb55710bf936abab77bf67d (diff)
Handle Linux .distribution_version in cases like "testing" and
"unstable" where there is no numeric version available (yet, or ever, as the case may be). Debian Stretch picked up the mandatory ".conf" suffix for Apache site files; don't (yet) know whether that was already present in Jessie, won't much care until we have working backports of our dependencies for Jessie. svn path=/branches/tk705/; revision=6325
Diffstat (limited to 'ca')
-rwxr-xr-xca/rpkigui-apache-conf-gen26
1 files changed, 17 insertions, 9 deletions
diff --git a/ca/rpkigui-apache-conf-gen b/ca/rpkigui-apache-conf-gen
index 41e7e9f3..71bdd8c7 100755
--- a/ca/rpkigui-apache-conf-gen
+++ b/ca/rpkigui-apache-conf-gen
@@ -446,17 +446,25 @@ class Debian(Platform):
Debian and related platforms like Ubuntu.
"""
+ # Pull the current version number for released code. Use
+ # something very large when there is no version (eg, "sid").
@property
def distribution_version(self):
- return tuple(int(v) for v in platform.linux_distribution()[1].split("."))
+ v = platform.linux_distribution()[1].split(".")
+ if all(d.isdigit() for d in v):
+ return tuple(int(d) for d in v)
+ else:
+ return (99999999, 0)
- # As of Wheezy, Debian still wants the configuration filename
- # without the .conf suffix. Keep an eye on this, as it may change
- # in future releases.
- #
+ # On Debian, the filename must end in .conf on Stretch and must not
+ # end in .conf on Wheezy. Haven't checked Jessie yet, will need to
+ # update this if we ever sort out the version skew mess on Jessie.
@property
def apache_conf_target(self):
- return "/etc/apache2/sites-available/rpki"
+ if self.distribution_version < (8, 0):
+ return "/etc/apache2/sites-available/rpki"
+ else:
+ return "/etc/apache2/sites-available/rpki.conf"
snake_oil_cer = "/etc/ssl/certs/ssl-cert-snakeoil.pem"
snake_oil_key = "/etc/ssl/private/ssl-cert-snakeoil.key"
@@ -493,10 +501,10 @@ class Ubuntu(Debian):
# end in .conf on Precise.
@property
def apache_conf_target(self):
- if self.distribution_version >= (14, 0):
- return "/etc/apache2/sites-available/rpki.conf"
- else:
+ if self.distribution_version < (14, 0):
return "/etc/apache2/sites-available/rpki"
+ else:
+ return "/etc/apache2/sites-available/rpki.conf"
class NIY(Platform): # pylint: disable=W0223