summaryrefslogtreecommitdiffstats
path: root/sample/README
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-09 18:20:46 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-09 18:20:46 +0000
commit9afbaffe4df85d72e2281817d39e12bf2b3cc520 (patch)
treec9cb29752b977cb06878bc7e188533addb262da0 /sample/README
parent458b2ac5d5f8ab72df861644870ef8cd481e199c (diff)
* test/ripper/test_scanner_events.rb: test location information.
* test/ripper/test_scanner_events.rb: test \n between comments. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/README')
0 files changed, 0 insertions, 0 deletions
href='#n110'>110 111 112 113 114 115 116 117 118 119 120 121 122 123
#
# installmethod.py - Base class for install methods
#
# Copyright 1999-2002 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
#
# You should have received a copy of the GNU Library Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

import os
import string
from hdrlist import groupSetFromCompsFile
from constants import *

from rhpl.log import log

class FileCopyException(Exception):
    def __init__(self, s = ""):
        self.args = s
        

class InstallMethod:

    # find best match from several locations for a file
    def findBestFileMatch(self, treebase, file):
	# look in /tmp/updates first
	rc = None
	tryloc = ["/tmp/updates"]
	if treebase is not None:
	    tryloc.append("%s/RHupdates" %(treebase,))
	    tryloc.append("%s/%s/base" % (treebase, productPath))
	    
	for pre in tryloc:
	    tmpname = pre + "/" + file
	    if os.access(tmpname, os.R_OK):
		log("Using file://%s", tmpname)
		return "file://%s" %(tmpname,)

	log("Unable to find %s", file)
	return None
	
    def protectedPartitions(self):
        return None

    def readCompsViaMethod(self, hdlist):
	pass

    def readComps(self, hdlist):
	# see if there is a comps in PYTHONPATH, otherwise fall thru
	# to method dependent location
	path = None
	if os.environ.has_key('PYTHONPATH'):
	    for f in string.split(os.environ['PYTHONPATH'], ":"):
		if os.access (f+"/comps", os.X_OK):
		    path = f+"/comps"
		    break