示例#1
0
 def new ( name ) :
     _config = repolib.config.read_build_config( name )
     if _config['type'] == "deb" :
         return repolib.debian_build_repository( _config , name )
     elif _config['type'] == "apt" :
         return repolib.debian_build_apt( _config , name )
     elif _config['type'] == "feed" :
         return repolib.feed_build_repository( _config , name )
     elif _config['type'] == "yum" :
         return repolib.yum_build_repository( _config , name )
     else :
         raise Exception( "Unknown repository build type '%s'" % _config['type'] )
示例#2
0
 def new ( name , input=None ) :
     if input :
         if name in repolib.config.get_all_build_repos() :
             raise Exception( "already exists" )
         if not isinstance(input,dict) :
             raise Exception( "Given '%s' object, only dictionaries allowed" % input.__class__.__name__ )
         _config = repolib.config.read_build_config( name , input )
     else :
         _config = repolib.config.read_build_config( name )
     if _config['type'] == "deb" :
         return repolib.debian_build_repository( _config , name )
     elif _config['type'] == "apt" :
         return repolib.debian_build_apt( _config , name )
     elif _config['type'] == "feed" :
         return repolib.feed_build_repository( _config , name )
     elif _config['type'] == "yum" :
         return repolib.yum_build_repository( _config , name )
     elif _config['type'] == "snapshot" :
         return repolib.snapshot_build_repository( _config , name )
     else :
         raise Exception( "Unknown repository build type '%s'" % _config['type'] )
示例#3
0
 def new(name, input=None):
     if input:
         if name in repolib.config.get_all_build_repos():
             raise Exception("already exists")
         if not isinstance(input, dict):
             raise Exception(
                 "Given '%s' object, only dictionaries allowed" %
                 input.__class__.__name__)
         _config = repolib.config.read_build_config(name, input)
     else:
         _config = repolib.config.read_build_config(name)
     if _config['type'] == "deb":
         return repolib.debian_build_repository(_config, name)
     elif _config['type'] == "apt":
         return repolib.debian_build_apt(_config, name)
     elif _config['type'] == "feed":
         return repolib.feed_build_repository(_config, name)
     elif _config['type'] == "yum":
         return repolib.yum_build_repository(_config, name)
     elif _config['type'] == "snapshot":
         return repolib.snapshot_build_repository(_config, name)
     else:
         raise Exception("Unknown repository build type '%s'" %
                         _config['type'])