Added check for optparse module, if not we install the Optik package.
This commit is contained in:
@@ -1,10 +1,28 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# Checks with python if a module is installed
|
||||||
import sys
|
import sys
|
||||||
try:
|
|
||||||
import dns
|
module = sys.argv[1]
|
||||||
has = 1
|
|
||||||
except:
|
if module == 'dns':
|
||||||
has = 0
|
try:
|
||||||
|
import dns
|
||||||
|
has = 1
|
||||||
|
except:
|
||||||
|
has = 0
|
||||||
|
|
||||||
|
|
||||||
|
if module == 'optparse':
|
||||||
|
try:
|
||||||
|
from optparse import OptionParser
|
||||||
|
has = 1
|
||||||
|
except:
|
||||||
|
try:
|
||||||
|
from optik import OptionParser
|
||||||
|
has = 1
|
||||||
|
except:
|
||||||
|
has = 0
|
||||||
|
|
||||||
|
|
||||||
if has == 1:
|
if has == 1:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
DNSPYTHON_VER=1.2.0
|
DNSPYTHON_VER=1.2.0
|
||||||
|
OPTIK_VER=1.4.1
|
||||||
|
|
||||||
# Do we have the dns modules??
|
# Do we have the dns modules??
|
||||||
./check_dnsmod.py
|
./check_modules.py dns
|
||||||
if [ "$?" == "1" ]; then
|
if [ "$?" == "1" ]; then
|
||||||
DNSPYTHON=dnspython-$DNSPYTHON_VER
|
DNSPYTHON=dnspython-$DNSPYTHON_VER
|
||||||
tar zxf $DNSPYTHON.tar.gz
|
tar zxf $DNSPYTHON.tar.gz
|
||||||
@@ -11,6 +12,15 @@ if [ "$?" == "1" ]; then
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
./check_modules.py optparse
|
||||||
|
if [ "$?" == "1" ]; then
|
||||||
|
OPTIK=dnspython-$OPTIK_VER
|
||||||
|
tar zxf $OPTIK.tar.gz
|
||||||
|
cd $OPTIK
|
||||||
|
python setup.py install
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
# Copy the manpages
|
# Copy the manpages
|
||||||
cp ../dnsupdate.1 /usr/share/man/man1
|
cp ../dnsupdate.1 /usr/share/man/man1
|
||||||
gzip /usr/share/man/man1/dnsupdate.1
|
gzip /usr/share/man/man1/dnsupdate.1
|
||||||
|
|||||||
Reference in New Issue
Block a user