Package yum :: Module constants
[hide private]
[frames] | no frames]

Source Code for Module yum.constants

  1  # This program is free software; you can redistribute it and/or modify 
  2  # it under the terms of the GNU General Public License as published by 
  3  # the Free Software Foundation; either version 2 of the License, or 
  4  # (at your option) any later version. 
  5  # 
  6  # This program is distributed in the hope that it will be useful, 
  7  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
  8  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  9  # GNU Library General Public License for more details. 
 10  # 
 11  # You should have received a copy of the GNU General Public License 
 12  # along with this program; if not, write to the Free Software 
 13  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 14   
 15  """ 
 16  Yum constants. Usually dealing with rpm magic numbers. 
 17  """ 
 18   
 19  #Constants 
 20  YUM_PID_FILE = '/var/run/yum.pid' 
 21   
 22  #transaction set states 
 23  TS_UPDATE = 10 
 24  TS_INSTALL = 20 
 25  TS_TRUEINSTALL = 30 
 26  TS_ERASE = 40 
 27  TS_OBSOLETED = 50 
 28  TS_OBSOLETING = 60 
 29  TS_AVAILABLE = 70 
 30  TS_UPDATED = 90 
 31  TS_FAILED = 100 
 32   
 33  TS_INSTALL_STATES = [TS_INSTALL, TS_TRUEINSTALL, TS_UPDATE, TS_OBSOLETING] 
 34  TS_REMOVE_STATES = [TS_ERASE, TS_OBSOLETED, TS_UPDATED] 
 35   
 36  # Transaction Relationships 
 37  TR_UPDATES = 1 
 38  TR_UPDATEDBY = 2 
 39  TR_OBSOLETES = 3 
 40  TR_OBSOLETEDBY = 4 
 41  TR_DEPENDS = 5 
 42  TR_DEPENDSON = 6 
 43   
 44  # Transaction Member Sort Colors 
 45  # Each node in a topological sort is colored 
 46  # White nodes are unseen, black nodes are seen 
 47  # grey nodes are in progress 
 48  TX_WHITE = 0 
 49  TX_GREY = 1 
 50  TX_BLACK = 2 
 51   
 52  # package object file types 
 53  PO_FILE = 1 
 54  PO_DIR = 2 
 55  PO_GHOST = 3 
 56  PO_CONFIG = 4 
 57  PO_DOC = 5 
 58   
 59  # package object package types 
 60  PO_REMOTEPKG = 1 
 61  PO_LOCALPKG = 2 
 62  PO_INSTALLEDPKG = 3 
 63   
 64  # FLAGS 
 65  SYMBOLFLAGS = {'>':'GT', '<':'LT', '=': 'EQ', '==': 'EQ', '>=':'GE', '<=':'LE'} 
 66  LETTERFLAGS = {'GT':'>', 'LT':'<', 'EQ':'=', 'GE': '>=', 'LE': '<='} 
 67   
 68  # Constants for plugin config option registration 
 69  PLUG_OPT_STRING = 0 
 70  PLUG_OPT_INT = 1 
 71  PLUG_OPT_FLOAT = 2 
 72  PLUG_OPT_BOOL = 3 
 73   
 74  PLUG_OPT_WHERE_MAIN = 0 
 75  PLUG_OPT_WHERE_REPO = 1 
 76  PLUG_OPT_WHERE_ALL = 2 
 77   
 78  # version of sqlite database schemas 
 79  DBVERSION = '10' 
 80   
 81  # boolean dict: 
 82  BOOLEAN_STATES = {'1': True, 'yes': True, 'true': True, 'on': True, 
 83                    '0': False, 'no': False, 'false': False, 'off': False} 
 84   
 85  RPM_TO_SQLITE = { 'packagesize' : 'size_package', 
 86                   'archivesize' : 'size_archive', 
 87                   'installedsize' : 'size_installed', 
 88                   'buildtime' : 'time_build', 
 89                   'hdrstart' : 'rpm_header_start', 
 90                   'hdrend' : 'rpm_header_end', 
 91                   'basepath' : 'location_base', 
 92                   'relativepath': 'location_href', 
 93                   'filetime' : 'time_file', 
 94                   'packager' : 'rpm_packager', 
 95                   'group' : 'rpm_group', 
 96                   'buildhost' : 'rpm_buildhost', 
 97                   'sourcerpm' : 'rpm_sourcerpm', 
 98                   'vendor' : 'rpm_vendor', 
 99                   'license' : 'rpm_license' 
100                          } 
101   
102  #  Cut over for when we should just give up and load everything. 
103  #  The main problem here is not so much SQLite dying (although that happens 
104  # at large values: http://sqlite.org/limits.html#max_variable_number) but that 
105  # but SQLite going really slow when it gets medium sized values (much slower 
106  # than just loading everything and filtering it in python). 
107  PATTERNS_MAX = 8 
108  #  We have another value here because name is indexed and sqlite is _much_ 
109  # faster even at large numbers of patterns. 
110  PATTERNS_INDEXED_MAX = 128 
111   
112  RPM_CHECKSUM_TYPES = { 1:'md5', 2:'sha1', 8:'sha256', 9:'sha384', 10:'sha512', 
113                         11:'sha224' } # from RFC 4880 
114   
115   
116  # for repo verification/checks 
117  REPO_PROBLEM_REPOMD=1 
118  REPO_PROBLEM_METADATA=2 
119  REPO_PROBLEM_COMPS=3 
120  REPO_PROBLEM_OTHER=4 
121  REPO_PROBLEM_PACKAGE=5 
122