Package conary :: Package build :: Module grouprecipe
[hide private]
[frames] | no frames]

Source Code for Module conary.build.grouprecipe

   1  # 
   2  # Copyright (c) 2004-2008 rPath, Inc. 
   3  # 
   4  # This program is distributed under the terms of the Common Public License, 
   5  # version 1.0. A copy of this license should have been distributed with this 
   6  # source file in a file called LICENSE. If it is not present, the license 
   7  # is always available at http://www.rpath.com/permanent/licenses/CPL-1.0. 
   8  # 
   9  # This program is distributed in the hope that it will be useful, but 
  10  # without any warranty; without even the implied warranty of merchantability 
  11  # or fitness for a particular purpose. See the Common Public License for 
  12  # full details. 
  13  # 
  14  import copy 
  15  from itertools import chain, izip 
  16   
  17  from conary.build import policy 
  18  from conary.build.recipe import Recipe, RECIPE_TYPE_GROUP, loadMacros 
  19  from conary.build.errors import RecipeFileError, CookError, GroupPathConflicts 
  20  from conary.build.errors import GroupDependencyFailure, GroupCyclesError 
  21  from conary.build.errors import GroupAddAllError, GroupImplicitReplaceError 
  22  from conary.build.errors import GroupUnmatchedReplaces, GroupUnmatchedRemoves 
  23  from conary.build.errors import GroupUnmatchedGlobalReplaces 
  24  from conary.build import macros 
  25  from conary.build import trovefilter 
  26  from conary.build import use 
  27  from conary import conaryclient 
  28  from conary import callbacks 
  29  from conary.deps import deps 
  30  from conary import errors 
  31  from conary.lib import graph, log, util 
  32  from conary.repository import changeset, trovesource, searchsource 
  33  from conary import trove 
  34  from conary import versions 
  35   
  36  # reasons for adding troves to a group. 
  37  ADD_REASON_ADDED = 0    # added trove explicitly 
  38  ADD_REASON_DEP = 1      # added to satisfy dep 
  39  ADD_REASON_INCLUDED = 2 # added because it's in something else that was added 
  40  ADD_REASON_ADDALL = 3   # added as part of an "addAll" 
  41  ADD_REASON_REPLACE = 4  # added as part of a "replace" command. 
  42  ADD_REASON_INCLUDED_GROUP = 5 # added because its in an included group 
  43  ADD_REASON_COPIED = 6    # added because it was copied from another group 
  44   
  45  ADDALL_NORECURSE = 0 
  46  ADDALL_RECURSE   = 1 
  47  ADDALL_FLATTEN   = 2 
  48   
49 -class AddAllFlags(object):
50 51 __slots__ = [ 'ref', 'recurse', 'copyCompatibilityClass', 'copyScripts', 52 'requireLatest']
53
54 -class _BaseGroupRecipe(Recipe):
55 """ Defines a group recipe as collection of groups and provides 56 operations on those groups. 57 """ 58 internalAbstractBaseClass = 1 59 internalPolicyModules = ('grouppolicy',) 60 basePolicyClass = policy.GroupPolicy 61
62 - def __init__(self, laReposCache = None, srcdirs = None, 63 lightInstance = None):
64 Recipe.