0
  
   355 c    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
  7   l=J*e8n2ʘo0a=J*e8n2ʘo  #   l=J *j"T3qţeo ?     #! /usr/bin/python -tt
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Copyright 2005 Duke University
# Written by Seth Vidal

# TODOS: make all the package relationships deal with package objects
# search by package object for TransactionData, etc.
# provide a real TransactionData.remove(txmbr) method, It should 
# remove the given txmbr and iterate to remove all those in depedent relationships
# with the given txmbr. 

"""
Classes and functions for manipulating a transaction to be passed
to rpm.
"""

from constants import *
from packageSack import PackageSack, PackageSackVersion
from packages import YumInstalledPackage
from sqlitesack import YumAvailablePackageSqlite
import Errors
import warnings
import misc

import time

class GetProvReqOnlyPackageSack(PackageSack):
    def __init__(self, need_files=False):
        PackageSack.__init__(self)
        self._need_index_files = need_files

    def __addPackageToIndex_primary_files(self, obj):
        for ftype in obj.returnFileTypes(primary_only=True):
            for file in obj.returnFileEntries(ftype, primary_only=True):
                self._addToDictAsList(self.filenames, file, obj)
    def __addPackageToIndex_files(self, obj):
        for ftype in obj.returnFileTypes():
            for file in obj.returnFileEntries(ftype):
                self._addToDictAsList(self.filenames, file, obj)
    def _addPackageToIndex(self, obj):
        for (n, fl, (e,v,r)) in obj.returnPrco('provides'):
            self._addToDictAsList(self.provides, n, obj)
        for (n, fl, (e,v,r)) in obj.returnPrco('requires'):
            self._addToDictAsList(self.requires, n, obj)
        if self._need_index_files:
            self.__addPackageToIndex_files(obj)
        else:
            self.__addPackageToIndex_primary_files(obj)

    def __buildFileIndexes(self):
        for repoid in self.pkgsByRepo:
            for obj in self.pkgsByRepo[repoid]:
                self.__addPackageToIndex_files(obj)
    def searchFiles(self, name):
        if not self._need_index_files and not misc.re_primary_filename(name):
            self._need_index_files = True
            if self.indexesBuilt:
                self.filenames = {}
                self.__buildFileIndexes()

        return PackageSack.searchFiles(self, name)

class TransactionData:
    """Data Structure designed to hold information on a yum Transaction Set"""
    def __init__(self):
        self.flags = []
        self.vsflags = []
        self.probFilterFlags = []
        self.root = '/'
        self.pkgdict = {} # key = pkgtup, val = list of TransactionMember obj
        self._namedict = {} # name -> list of TransactionMember obj
        self._unresolvedMembers = set()
        self.debug = 0
        self.changed = False
        self.installonlypkgs = []
        self.state_counter = 0
        self.tm_created = time.time()
        self.tm_changed = time.time()
        self.conditionals = {} # key