def __init__(self, suite, traits_table, packages_table): tablename = ujoin(suite, 'templates') packs_column = PkBigname('package') packs_column.set_fk(packages_table) tcolumns = template_columns() tcolumns[-1].set_fk('textfiles') columns = tcolumns[:1] + [packs_column] + tcolumns[1:] _TraitRelation.__init__(self, traits_table, tablename, columns)
def __init__(self, suite, traits_table, packages_table): packs_column = PkBigname('package') packs_column.set_fk(packages_table) action_column = PkName('action') action_column.constraint.default = 'install' columns = [packs_column, action_column] tablename = ujoin(suite, 'trait', 'package') _TraitRelation.__init__(self, traits_table, tablename, columns)
def __init__(self, suite, traits_table, packages_table): packs_column = PkBigname('package') if not os.environ.has_key('PAELLA_DB_NOPACKAGETABLES'): packs_column.set_fk(packages_table) action_column = PkName('action') action_column.constraint.default = 'install' columns = [packs_column, action_column] tablename = ujoin(suite, 'trait', 'package') _TraitRelation.__init__(self, traits_table, tablename, columns)
def family_env_columns(): return [ PkName('family'), PkName('trait'), PkBigname('name'), Text('value') ]
def template_columns(): return [ PkBigname('template'), Name('mode'), Name('owner'), Name('grp_owner'), Num('templatefile')]
def __init__(self, profiles_table): profile_col = PkName('profile') profile_col.set_fk(profiles_table) trait_col = PkName('trait') name_col = PkBigname('name') value_col = Text('value') cols = [profile_col, trait_col, name_col, value_col] tablename = ujoin('profile', 'variables') Table.__init__(self, tablename, cols)
def __init__(self, mach_types_table): mtype_col = PkName('machine_type') mtype_col.set_fk(mach_types_table) trait_col = PkName('trait') name_col = PkBigname('name') value_col = Text('value') cols = [mtype_col, trait_col, name_col, value_col] tablename = ujoin('machine_type', 'variables') Table.__init__(self, tablename, cols)
def debconf_columns(): return [ PkBigname('name'), Bigname('value'), Bigname('owners'), Bigname('flags'), Bigname('template'), Text('variables') ]
def packages_columns(): return [ PkBigname('package'), Name('priority'), Bigname('section'), Num('installedsize'), Bigname('filename'), Bigname('maintainer'), Bigname('size'), Name('md5sum'), Bigname('version'), Text('description')]
def defaultenv_columns(): return [PkName('section'), PkBigname('option'), Text('value')]
def currentenv_columns(): return [PkName('hostname'), PkBigname('name'), Text('value')]
def __init__(self, suite, traits_table): cols = [PkBigname('name'), Text('value')] tablename = ujoin(suite, 'variables') _TraitRelation.__init__(self, traits_table, tablename, cols)
from useless.sqlgen.classes import Column, Table from useless.sqlgen.defaults import Text from useless.sqlgen.defaults import PkBigname, Bigname, Name, Num dpkg_tables = ['available', 'status', 'filelist', 'md5sums', 'conffiles'] other_tables = ['current'] common_columns = [ PkBigname('package'), Name('essential'), Name('priority'), Name('section'), Num('installedsize'), Bigname('maintainer'), Name('version') ] #columns for /var/lib/dpkg/status status_columns = common_columns + [ Name('status'), Text('replaces'), Text('provides'), Text('predepends'), Text('conflicts'), Bigname('source'), Text('suggests'), Text('recommends'), Text('depends'),