|
Brian Stinson |
2fb8a5 |
import pyrpkg
|
|
Brian Stinson |
ca61eb |
import os
|
|
Brian Stinson |
ca61eb |
import re
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
from . import cli
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
class Commands(pyrpkg.Commands):
|
|
Brian Stinson |
2fb8a5 |
def __init__(self, path, lookaside, lookasidehash, lookaside_cgi,
|
|
Brian Stinson |
2fb8a5 |
gitbaseurl, anongiturl, branchre, kojiconfig,
|
|
Brian Stinson |
2fb8a5 |
build_client, user=None, dist=None, target=None,
|
|
Brian Stinson |
2fb8a5 |
quiet=False):
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
super(Commands,self).__init__(path, lookaside, lookasidehash,
|
|
Brian Stinson |
2fb8a5 |
lookaside_cgi, gitbaseurl, anongiturl,
|
|
Brian Stinson |
2fb8a5 |
branchre, kojiconfig, build_client,
|
|
Brian Stinson |
2fb8a5 |
user, dist, target,
|
|
Brian Stinson |
2fb8a5 |
quiet)
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
ca61eb |
# redefined loaders
|
|
Brian Stinson |
ca61eb |
def load_rpmdefines(self):
|
|
Brian Stinson |
ca61eb |
try:
|
|
Brian Stinson |
ca61eb |
osver = re.search(r'\d.*$', self.branch_merge).group()
|
|
Brian Stinson |
ca61eb |
except AttributeError:
|
|
Brian Stinson |
ca61eb |
raise pyrpkg.rpkgError('Could not find the base OS ver from branch name'
|
|
Brian Stinson |
ca61eb |
' %s' % self.branch_merge)
|
|
Brian Stinson |
ca61eb |
self._distval = osver
|
|
Brian Stinson |
ca61eb |
self._distval = self._distval.replace('.', '_')
|
|
Brian Stinson |
ca61eb |
self._disttag = 'el%s' % self._distval
|
|
Brian Stinson |
ca61eb |
self._rpmdefines = ["--define '_sourcedir %s'" % os.path.join(self.path,'SOURCES'),
|
|
Brian Stinson |
ca61eb |
"--define '_specdir %s'" % os.path.join(self.path,'SPECS'),
|
|
Brian Stinson |
ca61eb |
"--define '_builddir %s'" % os.path.join(self.path,'BUILD'),
|
|
Brian Stinson |
ca61eb |
"--define '_srcrpmdir %s'" % os.path.join(self.path,'SRPMS'),
|
|
Brian Stinson |
ca61eb |
"--define '_rpmdir %s'" % os.path.join(self.path, 'RPMS'),
|
|
Brian Stinson |
ca61eb |
"--define 'dist .%s'" % self._disttag,
|
|
Brian Stinson |
ca61eb |
# int and float this to remove the decimal
|
|
Brian Stinson |
ca61eb |
"--define '%s 1'" % self._disttag]
|
|
Brian Stinson |
ca61eb |
|
|
Brian Stinson |
ca61eb |
def load_spec(self):
|
|
Brian Stinson |
ca61eb |
"""This sets the spec attribute"""
|
|
Brian Stinson |
ca61eb |
|
|
Brian Stinson |
ca61eb |
# We are not using the upstream load_spec because the file structure is
|
|
Brian Stinson |
ca61eb |
# hard-coded
|
|
Brian Stinson |
ca61eb |
|
|
Brian Stinson |
ca61eb |
deadpackage = False
|
|
Brian Stinson |
ca61eb |
|
|
Brian Stinson |
ca61eb |
# Get a list of files in the path we're looking at
|
|
Brian Stinson |
ca61eb |
files = os.listdir(os.path.join(self.path,'SPECS'))
|
|
Brian Stinson |
ca61eb |
# Search the files for the first one that ends with ".spec"
|
|
Brian Stinson |
ca61eb |
for f in files:
|
|
Brian Stinson |
ca61eb |
if f.endswith('.spec') and not f.startswith('.'):
|
|
Brian Stinson |
ca61eb |
self._spec = os.path.join('SPECS',f)
|
|
Brian Stinson |
ca61eb |
return
|
|
Brian Stinson |
ca61eb |
if f == 'dead.package':
|
|
Brian Stinson |
ca61eb |
deadpackage = True
|
|
Brian Stinson |
ca61eb |
if deadpackage:
|
|
Brian Stinson |
ca61eb |
raise pyrpkg.rpkgError('No spec file found. This package is retired')
|
|
Brian Stinson |
ca61eb |
else:
|
|
Brian Stinson |
ca61eb |
raise pyrpkg.rpkgError('No spec file found.')
|
|
Brian Stinson |
ca61eb |
|
|
Brian Stinson |
ca61eb |
|
|
Brian Stinson |
2fb8a5 |
# These are the commands defined in the base pyrpkg.Commands class
|
|
Brian Stinson |
2fb8a5 |
def load_kojisession(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def add_tag(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def clean(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def clone(self, *args, **kwargs):
|
|
Brian Stinson |
6f323d |
super(Commands,self).clone(*args, **kwargs)
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def clone_with_dirs(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def commit(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def delete_tag(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def get_latest_commit(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def gitbuildhash(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def import_srpm(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def list_tag(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def new(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def patch(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def pull(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def push(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def sources(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def switch_branch(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def file_exists(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def upload_file(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def build(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def clog(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def compile(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def giturl(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def koji_upload(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def install(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def lint(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def local(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def mock_config(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def mockbuild(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def upload(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def prep(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def srpm(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def unused_patches(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|
|
Brian Stinson |
2fb8a5 |
|
|
Brian Stinson |
2fb8a5 |
def verify_files(self, *args, **kwargs):
|
|
Brian Stinson |
2fb8a5 |
raise NotImplementedError("This command is not yet implemented in centpkg")
|