
  "   ˆl–ßi~”Ji?u2 \¸®	µ1hßÂ742ÁÀ  "   ˆl–ß=¿Jå!¶e	A
ãm\e¥1hßÃ560ÂÁ æ    #! /usr/bin/python
# -*- python -*-
#
# guido's version, from rcsbump,v 1.2 1995/06/22 21:27:27 bwarsaw Exp
#
# Python script for bumping up an RCS major revision number.

import sys
import re
import rcslib
import string

WITHLOCK = 1
majorrev_re = re.compile('^[0-9]+')

dir = rcslib.RCS()

if sys.argv[1:]:
    files = sys.argv[1:]
else:
    files = dir.listfiles()

for file in files:
    # get the major revnumber of the file
    headbranch = dir.info(file)['head']
    majorrev_re.match(headbranch)
    majorrev = string.atoi(majorrev_re.group(0)) + 1

    if not dir.islocked(file):
        dir.checkout(file, WITHLOCK)

    msg = "Bumping major revision number (to %d)" % majorrev
    dir.checkin((file, "%s.0" % majorrev), msg, "-f")
 0    ó
ÏiTc           @   s®   d  Z  d Z d Z d Z d Z d Z e d k rF d e e e f Z n> e d k rk d e e e e f Z n d e e e e e f Z e d >e d	 >Be d
 >Be d >Be BZ d S(   s&   dnspython release version information.i   i   i    i   s   %d.%d.%ds   %d.%d.%dx%ds   %d.%d.%d%x%di   i   i   i   N(   t   __doc__t   MAJORt   MINORt   MICROt   RELEASELEVELt   SERIALt   versiont
   hexversion(    (    (    s1   /usr/lib64/python2.7/site-packages/dns/version.pyt   <module>   s     "   	ˆl–ß=¿J*hŠ}A
àAq§Å£Äƒeð?ÃÂ E    	import os
import re
import errno
import procfs
import platform
from configobj import ConfigObj, ConfigObjError

have_dmidecode = False
try:
	if (os.geteuid() == 0 and platform.machine() in ["i386", "i486", "i586", "i686", "x86_64"]):
		import dmidecode
		have_dmidecode = True
except:
	pass
try:
	import syspurpose.files
	have_syspurpose = True
except:
	have_syspurpose = False

import tuned.consts as consts
import tuned.logs
from tuned.utils.commands import commands

log = tuned.logs.get()

class ProfileRecommender:

	def __init__(self):
		self._commands = commands()

	def recommend(self, hardcoded = False):
		profile = consts.DEFAULT_PROFILE
		if hardcoded:
			return profile
		has_root = os.geteuid() == 0
		if not has_root:
			log.warning("Profile recommender is running without root privileges. Profiles with virt recommendation condition will be omitted.")
		matching = self.process_config(consts.RECOMMEND_CONF_FILE,
									   has_root=has_root)
		if matching is not None:
			return matching
		files = {}
		for directory in consts.RECOMMEND_DIRECTORIES:
			contents = []
			try:
				contents = os.listdir(directory)
			except OSError as e:
				if e.errno != errno.ENOENT:
					log.error("error accessing %s: %s" % (directory, e))
			for name in contents:
				path = os.path.join(directory, name)
				files[name] = path
		for name in sorted(files.keys()):
			path = files[name]
			matching = self.process_config(path, has_root=has_root)
			if matching is not None:
				return matching
		return profile

	def process_config(self, fname, has_root=True):
		matching_profile = None
		try:
			if not os.path.isfile(fname):
				return None
			config = ConfigObj(fname, list_values = False, interpolation = False)
			for section in list(config.keys()):
				match = True
				for option in list(config[section].keys()):
					value = config[section][option]
					if value == "":
						value = r"^$"
					if option == "virt":
						if not has_root:
							match = False
							break
						if not re.match(value,
								self._commands.execute(["virt-what"])[1], re.S):
							match = False
					elif option == "system":
						if not re.match(value,
								self._commands.read_file(
								consts.SYSTEM_RELEASE_FILE), re.S):
							match = False
					elif option[0] == "/":
						if not os.path.exists(option) or not re.match(value,
								self._commands.read_file(option), re.S):
							match = False
					elif option[0:7] == "process":
						ps = procfs.pidstats()
						ps.reload_threads()
						if len(ps.find_by_regex(re.compile(value))) == 0:
							match = False
					elif option == "chassis_type":
						if have_dmidecode:
	