import sys
import traceback
import daklib.utils
-import warnings
from daklib.daklog import Logger
from daklib.config import Config
daklib.utils.warn("unknown command '%s'" % (cmdname))
usage(functionality, 1)
- # We do not care. No idea wth sqlalchemy warns about them, makes no sense,
- # so we ignore it.
- warnings.filterwarnings("ignore", 'Predicate of partial index')
-
# Invoke the module
module = __import__(cmdname.replace("-","_"))
################################################################################
+# suppress some deprecation warnings in squeeze related to md5 module
+import warnings
+warnings.filterwarnings('ignore', \
+ "the md5 module is deprecated; use hashlib instead", \
+ DeprecationWarning)
+
import errno
import os
import re
import sys, os, re, time
import apt_pkg
-from debian_bundle import deb822
+
+try:
+ # starting with squeeze
+ from debian import deb822
+except:
+ # up to lenny
+ from debian_bundle import deb822
+
from daklib.dbconn import *
from daklib import utils
from daklib.regexes import re_html_escaping, html_escaping
import traceback
import atexit
-from debian_bundle import deb822
+try:
+ # starting with squeeze
+ from debian import deb822
+except:
+ # up to lenny
+ from debian_bundle import deb822
from dbconn import *
from config import Config
default_config = "/etc/dak/dak.conf" #: default dak config, defines host properties
+# suppress some deprecation warnings in squeeze related to apt_pkg
+# module
+import warnings
+warnings.filterwarnings('ignore', \
+ "Attribute '.*' of the 'apt_pkg\.Configuration' object is deprecated, use '.*' instead\.", \
+ DeprecationWarning)
+warnings.filterwarnings('ignore', \
+ "apt_pkg\.newConfiguration\(\) is deprecated\. Use apt_pkg\.Configuration\(\) instead\.", \
+ DeprecationWarning)
+
def which_conf_file():
return os.getenv("DAK_CONFIG", default_config)
from textutils import fix_maintainer
from dak_exceptions import NoSourceFieldError
+# suppress some deprecation warnings in squeeze related to sqlalchemy
+import warnings
+warnings.filterwarnings('ignore', \
+ "The SQLAlchemy PostgreSQL dialect has been renamed from 'postgres' to 'postgresql'.*", \
+ SADeprecationWarning)
+# TODO: sqlalchemy needs some extra configuration to correctly reflect
+# the ind_deb_contents_* indexes - we ignore the warnings at the moment
+warnings.filterwarnings("ignore", 'Predicate of partial index', SAWarning)
+
+
################################################################################
# Patch in support for the debversion field type so that it works during
DAK_ROOT_DIR = dirname(dirname(abspath(__file__)))
-# suppress some deprecation warnings in squeeze related to apt_pkg,
-# debian, and md5 modules
-warnings.filterwarnings('ignore', \
- "Attribute '.*' of the 'apt_pkg\.Configuration' object is deprecated, use '.*' instead\.", \
- DeprecationWarning)
-warnings.filterwarnings('ignore', \
- "apt_pkg\.newConfiguration\(\) is deprecated\. Use apt_pkg\.Configuration\(\) instead\.", \
- DeprecationWarning)
-warnings.filterwarnings('ignore', \
- "please use 'debian' instead of 'debian_bundle'", \
- DeprecationWarning)
-warnings.filterwarnings('ignore', \
- "the md5 module is deprecated; use hashlib instead", \
- DeprecationWarning)
-
class DakTestCase(unittest.TestCase):
def setUp(self):
pass
import pickle
import warnings
-# suppress some deprecation warnings in squeeze related to sqlalchemy
-warnings.filterwarnings('ignore', \
- "The SQLAlchemy PostgreSQL dialect has been renamed from 'postgres' to 'postgresql'.*", \
- SADeprecationWarning)
-
all_tables = ['architecture', 'archive', 'bin_associations', 'bin_contents',
'binaries', 'binary_acl', 'binary_acl_map', 'build_queue', 'build_queue_files',
'changes', 'changes_pending_binaries', 'changes_pending_files',
import PyRSS2Gen
-from debian_bundle.deb822 import Changes
+try:
+ # starting with squeeze
+ from debian.deb822 import Changes
+except:
+ # up to lenny
+ from debian_bundle.deb822 import Changes
inrss_filename = "NEW_in.rss"
outrss_filename = "NEW_out.rss"