Package conary :: Module checkin
[hide private]
[frames] | no frames]

Source Code for Module conary.checkin

   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  """ 
  15  Actions on source components.  This includes creating new packages; 
  16  checking in changes; checking out the latest version; displaying logs 
  17  and diffs; creating new packages; adding, removing, and renaming files; 
  18  and committing changes back to the repository. 
  19  """ 
  20  import errno 
  21  import fnmatch 
  22  import itertools 
  23  import os 
  24  import re 
  25  import stat 
  26  import sys 
  27  import time 
  28  import re 
  29   
  30  from conary import callbacks 
  31  from conary import changelog 
  32  from conary import conarycfg, conaryclient 
  33  from conary import deps 
  34  from conary import errors 
  35  from conary import files 
  36  from conary import trove 
  37  from conary import versions 
  38  from conary.build import derivedrecipe, recipe 
  39  from conary.build import loadrecipe, lookaside 
  40  from conary.build import errors as builderrors 
  41  from conary.build.macros import Macros 
  42  from conary.build.packagerecipe import loadMacros 
  43  from conary.build.cook import signAbsoluteChangeset 
  44  from conary.build import cook, use 
  45  from conary.conarycfg import selectSignatureKey 
  46  from conary.conaryclient import cmdline 
  47  from conary.lib import fixeddifflib 
  48  from conary.lib import log 
  49  from conary.lib import magic 
  50  from conary.lib import util 
  51  from conary.lib import graph 
  52  from conary.local import update 
  53  from conary.repository import changeset 
  54  from conary.state import ConaryState, ConaryStateFromFile, SourceState 
  55   
  56  nonCfgRe = re.compile(r'^.*\.(%s)$' % '|'.join(( 
  57      'bz2', 'ccs', 'data', 'eps', 'gif', 'gz', 'ico', 'img', 
  58      'jar', 'jpeg', 'jpg', 'lss', 'pdf', 'png', 'ps', 
  59      'rpm', 'run', 
  60      'tar', 'tbz', 'tbz2', 'tgz', 'tiff', 'ttf', 
  61      'zip', 
  62  ))) 
  63  cfgRe = re.compile(r'(^.*\.(%s)|(^|/)(%s))$' % ('|'.join(( 
  64      # extensions 
  65      '(1|2|3|4|5|6|7|8|9)', 
  66      'c', 'cfg', 'cnf', 'conf', 'CONFIG.*', 
  67      'console.*', 'cron.*', '(c|)sh', 'css', 
  68      'desktop', 'diff', 'h', 'html', 'init', 'kid', 'logrotate', 
  69      'pam(d|)', 'patch', 'pl', 'py', 
  70      'recipe', 'sysconfig', 
  71      'tag(handler|description)', 'tmpwatch', 'txt', 
  72      )), 
  73      '|'.join(( 
  74      # full filenames 
  75      r'Makefile(|\..*)', 
  76      )))) 
  77   
  78  # mix UpdateCallback and CookCallback, since we use both. 
79 -class CheckinCallback(callbacks.UpdateCallback, callbacks.CookCallback):
80 - def __init__(self, trustThreshold=0, keyCache=None):