summaryrefslogtreecommitdiff
path: root/contrib/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scripts')
-rwxr-xr-xcontrib/scripts/install_prereq27
-rwxr-xr-xcontrib/scripts/refcounter.py23
-rwxr-xr-xcontrib/scripts/spandspflow2pcap.py2
-rwxr-xr-xcontrib/scripts/voicemailpwcheck.py10
4 files changed, 44 insertions, 18 deletions
diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq
index 3ac7a0a1f..dfeb36f2c 100755
--- a/contrib/scripts/install_prereq
+++ b/contrib/scripts/install_prereq
@@ -146,6 +146,22 @@ PACKAGES_FBSD="$PACKAGES_FBSD wget subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_FBSD="$PACKAGES_FBSD bzip2 patch python"
+# Basic build system:
+PACKAGES_DBSD="gmake pkgconf"
+# Asterisk: basic requirements:
+PACKAGES_DBSD="$PACKAGES_DBSD libedit jansson e2fsprogs-libuuid sqlite3 libxml2"
+# Asterisk: for addons:
+PACKAGES_DBSD="$PACKAGES_DBSD speex speexdsp libogg libvorbis alsa-lib portaudio curl xmlstarlet bison flex"
+PACKAGES_DBSD="$PACKAGES_DBSD postgresql10-client unixODBC neon gmime26 lua52 uriparser libxslt libressl"
+PACKAGES_DBSD="$PACKAGES_DBSD mariadb101-client radcli freetds"
+PACKAGES_DBSD="$PACKAGES_DBSD net-snmp iksemel corosync newt popt libical spandsp"
+PACKAGES_DBSD="$PACKAGES_DBSD cclient binutils libsrtp gsm libilbc doxygen graphviz libzip openldap-client libhoard"
+PACKAGES_DBSD="$PACKAGES_DBSD codec2 fftw3 libsndfile unbound"
+# Asterisk: for the unpackaged below:
+PACKAGES_DBSD="$PACKAGES_DBSD wget subversion"
+# Asterisk: for ./configure --with-pjproject-bundled:
+PACKAGES_DBSD="$PACKAGES_DBSD bzip2 patch python"
+
KVERS=`uname -r`
JANSSON_VER=2.11
@@ -302,6 +318,13 @@ handle_fbsd() {
fi
}
+handle_dbsd() {
+ extra_packs=`check_installed_fpkgs $PACKAGES_DBSD`
+ if [ x"$extra_packs" != "x" ] ; then
+ $testcmd pkg install -y $extra_packs
+ fi
+}
+
handle_SUSE() {
extra_packs=`check_installed_zypper $PACKAGES_SUSE`
if [ x"$extra_packs" != "x" ] ; then
@@ -380,7 +403,7 @@ OS=`uname -s`
unsupported_distro=''
# A number of distributions we don't (yet?) support.
-if [ "$OS" != 'Linux' -a "$OS" != 'NetBSD' -a "$OS" != 'OpenBSD' -a "$OS" != 'FreeBSD' ]; then
+if [ "$OS" != 'Linux' -a "$OS" != 'NetBSD' -a "$OS" != 'OpenBSD' -a "$OS" != 'FreeBSD' -a "$OS" != 'DragonFly' ]; then
echo >&2 "$0: Your OS ($OS) is currently not supported. Aborting."
exit 1
fi
@@ -427,6 +450,8 @@ elif [ "$OS" = 'OpenBSD' ]; then
handle_obsd
elif [ "$OS" = 'FreeBSD' ]; then
handle_fbsd
+elif [ "$OS" = 'DragonFly' ]; then
+ handle_dbsd
fi
if ! in_test_mode; then
diff --git a/contrib/scripts/refcounter.py b/contrib/scripts/refcounter.py
index 1f4b37517..de3cda051 100755
--- a/contrib/scripts/refcounter.py
+++ b/contrib/scripts/refcounter.py
@@ -18,6 +18,7 @@
Matt Jordan <mjordan@digium.com>
"""
+from __future__ import print_function
import sys
import os
@@ -35,8 +36,8 @@ def parse_line(line):
"""
tokens = line.strip().split(',', 7)
if len(tokens) < 8:
- print "ERROR: ref debug line '%s' contains fewer tokens than " \
- "expected: %d" % (line.strip(), len(tokens))
+ print("ERROR: ref debug line '%s' contains fewer tokens than "
+ "expected: %d" % (line.strip(), len(tokens)))
return None
processed_line = {'addr': tokens[0],
@@ -142,7 +143,7 @@ def process_file(options):
del current_objects[obj]
if options.leaks:
- for key, lines in current_objects.iteritems():
+ for (key, lines) in current_objects.items():
leaked_objects.append((key, lines))
return (finished_objects, invalid_objects, leaked_objects, skewed_objects)
@@ -156,13 +157,13 @@ def print_objects(objects, prefix=""):
this object
"""
- print "======== %s Objects ========" % prefix
- print "\n"
+ print("======== %s Objects ========" % prefix)
+ print("\n")
for obj in objects:
- print "==== %s Object %s history ====" % (prefix, obj[0])
+ print("==== %s Object %s history ====" % (prefix, obj[0]))
for line in obj[1]['log']:
- print line
- print "\n"
+ print(line)
+ print("\n")
def main(argv=None):
@@ -198,11 +199,11 @@ def main(argv=None):
if not options.invalid and not options.leaks and not options.normal \
and not options.skewed:
- print >>sys.stderr, "All options disabled"
+ print("All options disabled", file=sys.stderr)
return -1
if not os.path.isfile(options.filepath):
- print >>sys.stderr, "File not found: %s" % options.filepath
+ print("File not found: %s" % options.filepath, file=sys.stderr)
return -1
try:
@@ -227,7 +228,7 @@ def main(argv=None):
print_objects(finished_objects, "Finalized")
except (KeyboardInterrupt, SystemExit, IOError):
- print >>sys.stderr, "File processing cancelled"
+ print("File processing cancelled", file=sys.stderr)
return -1
return ret_code
diff --git a/contrib/scripts/spandspflow2pcap.py b/contrib/scripts/spandspflow2pcap.py
index a6546b693..7c403f105 100755
--- a/contrib/scripts/spandspflow2pcap.py
+++ b/contrib/scripts/spandspflow2pcap.py
@@ -119,7 +119,7 @@ class FaxPcap(object):
else:
self.date += timedelta(microseconds=9000)
- print seqno, '\t', self.date + self.dateoff
+ print(seqno, '\t', self.date + self.dateoff)
# Make packet.
packet, prev_data = self.data2packet(self.date + self.dateoff,
diff --git a/contrib/scripts/voicemailpwcheck.py b/contrib/scripts/voicemailpwcheck.py
index d7a66d4b9..452255c35 100755
--- a/contrib/scripts/voicemailpwcheck.py
+++ b/contrib/scripts/voicemailpwcheck.py
@@ -46,20 +46,20 @@ mailbox, context, old_pw, new_pw = sys.argv[1:5]
# Enforce a password length of at least 6 characters
if len(new_pw) < REQUIRED_LENGTH:
- print "INVALID: Password is too short (%d) - must be at least %d" % \
- (len(new_pw), REQUIRED_LENGTH)
+ print("INVALID: Password is too short (%d) - must be at least %d" % \
+ (len(new_pw), REQUIRED_LENGTH))
sys.exit(0)
for regex, error in REGEX_BLACKLIST:
if re.search(regex, new_pw):
- print "INVALID: %s" % error
+ print("INVALID: %s" % error)
sys.exit(0)
for pw in PW_BLACKLIST:
if new_pw.find(pw) != -1:
- print "INVALID: %s is forbidden in a password" % pw
+ print("INVALID: %s is forbidden in a password" % pw)
sys.exit(0)
-print "VALID"
+print("VALID")
sys.exit(0)