| |
@@ -123,7 +123,7 @@
|
| |
self._distval = None
|
| |
# The distvar rpm value
|
| |
self._distvar = None
|
| |
- # The rpm epoch of the cloned module
|
| |
+ # The rpm epoch of the cloned package
|
| |
self._epoch = None
|
| |
# An authenticated buildsys session
|
| |
self._kojisession = None
|
| |
@@ -133,21 +133,21 @@
|
| |
self._localarch = None
|
| |
# A property to load the mock config
|
| |
self._mockconfig = None
|
| |
- # The name of the cloned module
|
| |
+ # The name of the cloned repository
|
| |
self._module_name = None
|
| |
# The dist git namespace
|
| |
self._ns = None
|
| |
- # The name of the module from spec file
|
| |
- self._module_name_spec = None
|
| |
- # The rpm name-version-release of the cloned module
|
| |
+ # The package name from spec file
|
| |
+ self._package_name_spec = None
|
| |
+ # The rpm name-version-release of the cloned package
|
| |
self._nvr = None
|
| |
- # The rpm release of the cloned module
|
| |
+ # The rpm release of the cloned package
|
| |
self._rel = None
|
| |
# The cloned repo object
|
| |
self._repo = None
|
| |
# The rpm defines used when calling rpm
|
| |
self._rpmdefines = None
|
| |
- # The specfile in the cloned module
|
| |
+ # The specfile in the cloned package
|
| |
self._spec = None
|
| |
# The build target within the buildsystem
|
| |
self._target = target
|
| |
@@ -161,7 +161,7 @@
|
| |
self._password = None
|
| |
# The alternate Koji user to run commands as
|
| |
self._runas = None
|
| |
- # The rpm version of the cloned module
|
| |
+ # The rpm version of the cloned package
|
| |
self._ver = None
|
| |
self.log = log
|
| |
# Pushurl or url of remote of branch
|
| |
@@ -186,6 +186,8 @@
|
| |
# package name will be sent to lookaside CGI script as 'namespace/name'
|
| |
# instead of just name.
|
| |
self.lookaside_namespaced = lookaside_namespaced
|
| |
+ # Deprecates self.module_name
|
| |
+ self._repo_name = None
|
| |
|
| |
# Define properties here
|
| |
# Properties allow us to "lazy load" various attributes, which also means
|
| |
@@ -529,7 +531,7 @@
|
| |
|
| |
@property
|
| |
def localarch(self):
|
| |
- """This property ensures the module attribute"""
|
| |
+ """This property ensures the localarch attribute"""
|
| |
|
| |
if not self._localarch:
|
| |
self.load_localarch()
|
| |
@@ -561,19 +563,35 @@
|
| |
self._mockconfig = '%s-%s' % (self.target, self.localarch)
|
| |
|
| |
@property
|
| |
+ def repo_name(self):
|
| |
+ """Property to get repository name"""
|
| |
+ if not self._repo_name:
|
| |
+ self.load_repo_name()
|
| |
+ return self._repo_name
|
| |
+
|
| |
+ @repo_name.setter
|
| |
+ def repo_name(self, name):
|
| |
+ """Set repository name"""
|
| |
+ self._repo_name = name
|
| |
+
|
| |
+ @property
|
| |
def module_name(self):
|
| |
"""This property ensures the module attribute"""
|
| |
-
|
| |
- if not self._module_name:
|
| |
- self.load_module_name()
|
| |
- return self._module_name
|
| |
+ self.log.warning('Property module_name is deprecated. Please use '
|
| |
+ 'repo_name instead.')
|
| |
+ return self.repo_name
|
| |
|
| |
@module_name.setter
|
| |
def module_name(self, module_name):
|
| |
- self._module_name = module_name
|
| |
+ self.log.warning('Property module_name is deprecated. Please use '
|
| |
+ 'repo_name instead.')
|
| |
+ self.repo_name = module_name
|
| |
|
| |
def load_module_name(self):
|
| |
- """Loads a package module."""
|
| |
+ return self.load_repo_name()
|
| |
+
|
| |
+ def load_repo_name(self):
|
| |
+ """Loads repository name"""
|
| |
|
| |
try:
|
| |
if self.push_url:
|
| |
@@ -582,26 +600,26 @@
|
| |
# FIXME
|
| |
# if self.distgit_namespaced:
|
| |
# self._module_name = "/".join(parts.path.split("/")[-2:])
|
| |
- module_name = posixpath.basename(parts.path.strip('/'))
|
| |
+ repo_name = posixpath.basename(parts.path.strip('/'))
|
| |
|
| |
- if module_name.endswith('.git'):
|
| |
- module_name = module_name[:-len('.git')]
|
| |
- self._module_name = module_name
|
| |
+ if repo_name.endswith('.git'):
|
| |
+ repo_name = repo_name[:-len('.git')]
|
| |
+ self._repo_name = repo_name
|
| |
return
|
| |
except rpkgError:
|
| |
- self.log.warning('Failed to get module name from Git url or pushurl')
|
| |
+ self.log.warning('Failed to get repository name from Git url or pushurl')
|
| |
|
| |
self.load_nameverrel()
|
| |
- if self._module_name_spec:
|
| |
- self._module_name = self._module_name_spec
|
| |
+ if self._package_name_spec:
|
| |
+ self._repo_name = self._package_name_spec
|
| |
return
|
| |
|
| |
- raise rpkgError('Could not find current module name.'
|
| |
- ' Use --module-name.')
|
| |
+ raise rpkgError('Could not find current repository name.'
|
| |
+ ' Use --name and optional --namespace.')
|
| |
|
| |
@property
|
| |
def ns(self):
|
| |
- """This property provides the namespace of the module"""
|
| |
+ """This property provides the namespace of the repository"""
|
| |
|
| |
if not self._ns:
|
| |
self.load_ns()
|
| |
@@ -633,10 +651,16 @@
|
| |
|
| |
@property
|
| |
def ns_module_name(self):
|
| |
+ self.log.warning('Property ns_module_name is deprecated. Please use '
|
| |
+ 'ns_repo_name instead.')
|
| |
+ return self.ns_repo_name
|
| |
+
|
| |
+ @property
|
| |
+ def ns_repo_name(self):
|
| |
if self.distgit_namespaced:
|
| |
- return '%s/%s' % (self.ns, self.module_name)
|
| |
+ return '%s/%s' % (self.ns, self.repo_name)
|
| |
else:
|
| |
- return self.module_name
|
| |
+ return self.repo_name
|
| |
|
| |
@property
|
| |
def nvr(self):
|
| |
@@ -649,7 +673,7 @@
|
| |
def load_nvr(self):
|
| |
"""This sets the nvr attribute"""
|
| |
|
| |
- self._nvr = '%s-%s-%s' % (self.module_name, self.ver, self.rel)
|
| |
+ self._nvr = '%s-%s-%s' % (self.repo_name, self.ver, self.rel)
|
| |
|
| |
@property
|
| |
def rel(self):
|
| |
@@ -659,7 +683,7 @@
|
| |
return(self._rel)
|
| |
|
| |
def load_nameverrel(self):
|
| |
- """Set the release of a package module."""
|
| |
+ """Set the release of a package."""
|
| |
|
| |
cmd = ['rpm']
|
| |
cmd.extend(self.rpmdefines)
|
| |
@@ -681,7 +705,7 @@
|
| |
self.log.debug(joined_cmd)
|
| |
self.log.error(err)
|
| |
raise rpkgError('Could not query n-v-r of %s: %s'
|
| |
- % (self.module_name, e))
|
| |
+ % (self.repo_name, e))
|
| |
if err:
|
| |
self.log.debug('Errors occoured while running following command to get N-V-R-E:')
|
| |
self.log.debug(joined_cmd)
|
| |
@@ -697,7 +721,7 @@
|
| |
if len(parts) != 4:
|
| |
raise rpkgError('Could not get n-v-r-e from %r'
|
| |
% first_line_output)
|
| |
- (self._module_name_spec,
|
| |
+ (self._package_name_spec,
|
| |
self._epoch,
|
| |
self._ver,
|
| |
self._rel) = parts
|
| |
@@ -762,7 +786,7 @@
|
| |
|
| |
@property
|
| |
def spec(self):
|
| |
- """This property ensures the module attribute"""
|
| |
+ """This property ensures the spec attribute"""
|
| |
|
| |
if not self._spec:
|
| |
self.load_spec()
|
| |
@@ -884,7 +908,7 @@
|
| |
|
| |
@property
|
| |
def mock_results_dir(self):
|
| |
- return os.path.join(self.path, "results_%s" % self.module_name,
|
| |
+ return os.path.join(self.path, "results_%s" % self.repo_name,
|
| |
self.ver, self.rel)
|
| |
|
| |
@property
|
| |
@@ -1120,44 +1144,73 @@
|
| |
|
| |
return (name, files, uploadfiles)
|
| |
|
| |
- def _get_namespace_giturl(self, module):
|
| |
- """Get the namespaced git url, if DistGit namespaces enabled
|
| |
+ def _get_namespace_giturl(self, repo_name):
|
| |
+ """Get the namespaced git url, if DistGit namespace enabled
|
| |
|
| |
- :param str module: a module name
|
| |
- :return: giturl with proper namespace.
|
| |
+ :param str repo_name: a repository name with or without namespace.
|
| |
+ :return: giturl with proper namespace. If namespace is not in the
|
| |
+ repository name and dist-git namespace is enabled, default
|
| |
+ namespace rpms will set.
|
| |
:rtype: str
|
| |
"""
|
| |
|
| |
if self.distgit_namespaced:
|
| |
- if '/' in module:
|
| |
- giturl = self.gitbaseurl % \
|
| |
- {'user': self.user, 'module': module}
|
| |
+ if '/' in repo_name:
|
| |
+ giturl = self.gitbaseurl % {
|
| |
+ 'user': self.user,
|
| |
+ 'repo': repo_name,
|
| |
+ # This is for the compatible with old format
|
| |
+ 'module': repo_name,
|
| |
+ }
|
| |
else:
|
| |
# Default to rpms namespace for backwards compat
|
| |
- giturl = self.gitbaseurl % \
|
| |
- {'user': self.user, 'module': "rpms/%s" % module}
|
| |
+ rpms_repo_name = 'rpms/%s' % repo_name
|
| |
+ giturl = self.gitbaseurl % {
|
| |
+ 'user': self.user,
|
| |
+ 'repo': rpms_repo_name,
|
| |
+ # This is for the compatible with old format
|
| |
+ 'module': rpms_repo_name,
|
| |
+ }
|
| |
else:
|
| |
- giturl = self.gitbaseurl % \
|
| |
- {'user': self.user, 'module': module}
|
| |
+ giturl = self.gitbaseurl % {
|
| |
+ 'user': self.user,
|
| |
+ 'repo': repo_name,
|
| |
+ # This is for the compatible with old format
|
| |
+ 'module': repo_name
|
| |
+ }
|
| |
|
| |
return giturl
|
| |
|
| |
- def _get_namespace_anongiturl(self, module):
|
| |
- """Get the namespaced git url, if DistGit namespaces enabled
|
| |
+ def _get_namespace_anongiturl(self, repo_name):
|
| |
+ """Get the namespaced git url, if DistGit namespace enabled
|
| |
|
| |
- :param str module: a module name
|
| |
- :return: anonymous giturl with a proper namespace.
|
| |
+ :param str repo_name: a repository name with or without namespace.
|
| |
+ :return: anonymous giturl with a proper namespace. If repository name
|
| |
+ does not have namespace and dist-git namespace is enabled, default
|
| |
+ namespace rpms will be set.
|
| |
:rtype: str
|
| |
"""
|
| |
|
| |
if self.distgit_namespaced:
|
| |
- if '/' in module:
|
| |
- giturl = self.anongiturl % {'module': module}
|
| |
+ if '/' in repo_name:
|
| |
+ giturl = self.anongiturl % {
|
| |
+ 'repo': repo_name,
|
| |
+ # This is for the compatible with old format
|
| |
+ 'module': repo_name,
|
| |
+ }
|
| |
else:
|
| |
+ rpms_repo_name = 'rpms/%s' % repo_name
|
| |
# Default to rpms namespace for backwards compat
|
| |
- giturl = self.anongiturl % {'module': "rpms/%s" % module}
|
| |
+ giturl = self.anongiturl % {
|
| |
+ 'repo': rpms_repo_name,
|
| |
+ # This is for the compatible with old format
|
| |
+ 'module': rpms_repo_name,
|
| |
+ }
|
| |
else:
|
| |
- giturl = self.anongiturl % {'module': module}
|
| |
+ giturl = self.anongiturl % {
|
| |
+ 'repo': repo_name,
|
| |
+ 'module': repo_name,
|
| |
+ }
|
| |
|
| |
return giturl
|
| |
|
| |
@@ -1186,7 +1239,7 @@
|
| |
self.log.info('Tag \'%s\' was created', tagname)
|
| |
|
| |
def clean(self, dry=False, useignore=True):
|
| |
- """Clean a module checkout of untracked files.
|
| |
+ """Clean a repository checkout of untracked files.
|
| |
|
| |
:param bool dry: Can optionally perform a dry-run. Defaults to `False`.
|
| |
:param bool useignore: Can optionally not use the ignore rules.
|
| |
@@ -1205,11 +1258,11 @@
|
| |
self._run_command(cmd, cwd=self.path)
|
| |
return
|
| |
|
| |
- def clone(self, module, path=None, branch=None, bare_dir=None,
|
| |
+ def clone(self, repo, path=None, branch=None, bare_dir=None,
|
| |
anon=False, target=None):
|
| |
"""Clone a repo, optionally check out a specific branch.
|
| |
|
| |
- :param str module: the name of the module to clone
|
| |
+ :param str repo: the name of the repository to clone.
|
| |
:param str path: an optional basedir to perform the clone in.
|
| |
:param str branch: an optional name of a branch to checkout instead of
|
| |
`<remote>/master`.
|
| |
@@ -1227,9 +1280,9 @@
|
| |
self._branch_remote = None
|
| |
# construct the git url
|
| |
if anon:
|
| |
- giturl = self._get_namespace_anongiturl(module)
|
| |
+ giturl = self._get_namespace_anongiturl(repo)
|
| |
else:
|
| |
- giturl = self._get_namespace_giturl(module)
|
| |
+ giturl = self._get_namespace_giturl(repo)
|
| |
|
| |
# Create the command
|
| |
cmd = ['git', 'clone']
|
| |
@@ -1261,26 +1314,28 @@
|
| |
|
| |
self._run_command(cmd, cwd=path)
|
| |
|
| |
- base_module = self.get_base_module(module)
|
| |
- git_dir = target if target else bare_dir if bare_dir else base_module
|
| |
+ base_repo = self.get_base_repo(repo)
|
| |
+ git_dir = target if target else bare_dir if bare_dir else base_repo
|
| |
conf_git = git.Git(os.path.join(path, git_dir))
|
| |
- self._clone_config(conf_git, module)
|
| |
+ self._clone_config(conf_git, repo)
|
| |
|
| |
return
|
| |
|
| |
- def get_base_module(self, module):
|
| |
- # Handle namespaced modules
|
| |
+ def get_base_repo(self, repo):
|
| |
+ # Handle namespaced repositories
|
| |
# Example:
|
| |
- # module: docker/cockpit
|
| |
+ # repository: docker/cockpit
|
| |
+ # The path will just be os.path.join(path, "cockpit")
|
| |
+ # repository: rpms/nodejs
|
| |
# The path will just be os.path.join(path, "cockpit")
|
| |
- if "/" in module:
|
| |
- return module.split("/")[-1]
|
| |
- return module
|
| |
+ if "/" in repo:
|
| |
+ return repo.split("/")[-1]
|
| |
+ return repo
|
| |
|
| |
- def clone_with_dirs(self, module, anon=False, target=None):
|
| |
+ def clone_with_dirs(self, repo, anon=False, target=None):
|
| |
"""Clone a repo old style with subdirs for each branch.
|
| |
|
| |
- :param str module: name of the module to clone
|
| |
+ :param str repo: name of the repository to clone.
|
| |
:param bool anon: whether or not to clone anonymously. Defaults to
|
| |
`False`.
|
| |
:param str target: an optional name of the folder in which to clone the
|
| |
@@ -1291,26 +1346,26 @@
|
| |
self._branch_remote = None
|
| |
# Get the full path of, and git object for, our directory of branches
|
| |
top_path = os.path.join(self.path,
|
| |
- target or self.get_base_module(module))
|
| |
+ target or self.get_base_repo(repo))
|
| |
top_git = git.Git(top_path)
|
| |
repo_path = os.path.join(top_path, 'rpkg.git')
|
| |
|
| |
# construct the git url
|
| |
if anon:
|
| |
- giturl = self._get_namespace_anongiturl(module)
|
| |
+ giturl = self._get_namespace_anongiturl(repo)
|
| |
else:
|
| |
- giturl = self._get_namespace_giturl(module)
|
| |
+ giturl = self._get_namespace_giturl(repo)
|
| |
|
| |
# Create our new top directory
|
| |
try:
|
| |
os.mkdir(top_path)
|
| |
except OSError as e:
|
| |
- raise rpkgError('Could not create directory for module %s: %s'
|
| |
- % (module, e))
|
| |
+ raise rpkgError('Could not create directory for repository %s: %s'
|
| |
+ % (repo, e))
|
| |
|
| |
# Create a bare clone first. This gives us a good list of branches
|
| |
try:
|
| |
- self.clone(module, top_path, bare_dir=repo_path, anon=anon)
|
| |
+ self.clone(repo, top_path, bare_dir=repo_path, anon=anon)
|
| |
except Exception as e:
|
| |
# Clean out our directory
|
| |
shutil.rmtree(top_path)
|
| |
@@ -1342,21 +1397,33 @@
|
| |
# We don't need this now. Ignore errors since keeping it does no harm
|
| |
shutil.rmtree(repo_path, ignore_errors=True)
|
| |
|
| |
- def _clone_config(self, conf_git, module):
|
| |
+ def _clone_config(self, conf_git, repo):
|
| |
# Inject ourselves as the git credential helper for https pushing
|
| |
conf_git.config('credential.helper', ' '.join(find_me() + ['gitcred']))
|
| |
conf_git.config('credential.useHttpPath', 'true')
|
| |
# Set any other clone_config
|
| |
if self.clone_config:
|
| |
- base_module = self.get_base_module(module)
|
| |
+ base_repo = self.get_base_repo(repo)
|
| |
clone_config = self.clone_config.strip() % {
|
| |
- 'base_module': base_module, 'module': module}
|
| |
+ # base_repo will be just the repository name with namespace
|
| |
+ # stripped.
|
| |
+ 'repo': base_repo,
|
| |
+ # repo is the repo argument which is passed in the CLI, which
|
| |
+ # could or cound't have namespace. So, if namespace is
|
| |
+ # included, it is just the ns_repo, otherwise it is same as the
|
| |
+ # base_repo.
|
| |
+ 'ns_repo': repo,
|
| |
+
|
| |
+ # This is for compatible with old format
|
| |
+ 'base_module': base_repo,
|
| |
+ 'module': repo
|
| |
+ }
|
| |
for confline in clone_config.splitlines():
|
| |
if confline:
|
| |
conf_git.config(*confline.split())
|
| |
|
| |
def commit(self, message=None, file=None, files=[], signoff=False):
|
| |
- """Commit changes to a module (optionally found at path)
|
| |
+ """Commit changes to a repository (optionally found at path)
|
| |
|
| |
Requires the caller be a real tty or a message passed.
|
| |
|
| |
@@ -1414,7 +1481,7 @@
|
| |
module base directory.
|
| |
"""
|
| |
|
| |
- # Things work better if we're in our module directory
|
| |
+ # Things work better if we're in our repository directory
|
| |
oldpath = os.getcwd()
|
| |
os.chdir(self.path)
|
| |
# build up the command
|
| |
@@ -1430,11 +1497,11 @@
|
| |
os.chdir(oldpath)
|
| |
return
|
| |
|
| |
- def get_latest_commit(self, module, branch):
|
| |
- """Discover the latest commit has for a given module and return it"""
|
| |
+ def get_latest_commit(self, repo, branch):
|
| |
+ """Discover the latest commit has for a given repository and return it"""
|
| |
|
| |
# This is stupid that I have to use subprocess :/
|
| |
- url = self._get_namespace_anongiturl(module)
|
| |
+ url = self._get_namespace_anongiturl(repo)
|
| |
# This cmd below only works to scratch build rawhide
|
| |
# We need something better for epel
|
| |
cmd = ['git', 'ls-remote', url, 'refs/heads/%s' % branch]
|
| |
@@ -1448,11 +1515,11 @@
|
| |
raise rpkgError(e)
|
| |
if error:
|
| |
raise rpkgError('Got an error finding %s head for %s: %s'
|
| |
- % (branch, module, error))
|
| |
+ % (branch, repo, error))
|
| |
# Return the hash sum
|
| |
if not output:
|
| |
raise rpkgError('Could not find remote branch %s for %s'
|
| |
- % (branch, module))
|
| |
+ % (branch, repo))
|
| |
return output.split()[0]
|
| |
|
| |
def gitbuildhash(self, build):
|
| |
@@ -1531,7 +1598,7 @@
|
| |
except ValueError:
|
| |
pass
|
| |
|
| |
- # Things work better if we're in our module directory
|
| |
+ # Things work better if we're in our repository directory
|
| |
oldpath = os.getcwd()
|
| |
os.chdir(self.path)
|
| |
|
| |
@@ -1607,7 +1674,7 @@
|
| |
"""
|
| |
|
| |
# Create the outfile name based on arguments
|
| |
- outfile = '%s-%s-%s.patch' % (self.module_name, self.ver, suffix)
|
| |
+ outfile = '%s-%s-%s.patch' % (self.repo_name, self.ver, suffix)
|
| |
|
| |
# If we want to rediff, the patch file has to already exist
|
| |
if rediff and not os.path.exists(os.path.join(self.path, outfile)):
|
| |
@@ -1616,12 +1683,12 @@
|
| |
|
| |
# See if there is a source dir to diff in
|
| |
if not os.path.isdir(os.path.join(self.path,
|
| |
- '%s-%s' % (self.module_name,
|
| |
+ '%s-%s' % (self.repo_name,
|
| |
self.ver))):
|
| |
raise rpkgError('Expanded source dir not found!')
|
| |
|
| |
# Setup the command
|
| |
- cmd = ['gendiff', '%s-%s' % (self.module_name, self.ver),
|
| |
+ cmd = ['gendiff', '%s-%s' % (self.repo_name, self.ver),
|
| |
'.%s' % suffix]
|
| |
|
| |
# Try to run the command and capture the output
|
| |
@@ -1737,7 +1804,7 @@
|
| |
self.log.info("sources file doesn't exist. Source files download skipped.")
|
| |
return
|
| |
|
| |
- # Default to putting the files where the module is
|
| |
+ # Default to putting the files where the repository is
|
| |
if not outdir:
|
| |
outdir = self.path
|
| |
|
| |
@@ -1756,7 +1823,7 @@
|
| |
for entry in sourcesf.entries:
|
| |
outfile = os.path.join(outdir, entry.file)
|
| |
self.lookasidecache.download(
|
| |
- self.ns_module_name if self.lookaside_namespaced else self.module_name,
|
| |
+ self.ns_repo_name if self.lookaside_namespaced else self.repo_name,
|
| |
entry.file, entry.hash, outfile,
|
| |
hashtype=entry.hashtype, **args)
|
| |
|
| |
@@ -1859,13 +1926,13 @@
|
| |
raise rpkgError('Packages in destination tag %(dest_tag_name)s are not inherited by'
|
| |
' build tag %(build_tag_name)s' % build_target)
|
| |
|
| |
- def construct_build_url(self, module_name=None, commit_hash=None):
|
| |
+ def construct_build_url(self, repo_name=None, commit_hash=None):
|
| |
"""Construct build URL with namespaced anongiturl and commit hash
|
| |
|
| |
- :param str module_name: name of the module part of the build URL. If
|
| |
- omitted, module name with namespace will be guessed from current
|
| |
- repository. The given module name will be used in URL directly
|
| |
- without guessing namespace.
|
| |
+ :param str repo_name: name of the repository part of the build URL. If
|
| |
+ omitted, namespaced name will be guessed from current repository.
|
| |
+ The given repository name will be used in URL directly without
|
| |
+ guessing namespace.
|
| |
:param str commit_hash: the commit hash appended to build URL. It
|
| |
omitted, the latest commit hash got from current repository will be
|
| |
used.
|
| |
@@ -1873,12 +1940,12 @@
|
| |
:rtype: str
|
| |
"""
|
| |
return '{0}#{1}'.format(
|
| |
- self._get_namespace_anongiturl(module_name or self.ns_module_name),
|
| |
+ self._get_namespace_anongiturl(repo_name or self.ns_repo_name),
|
| |
commit_hash or self.commithash)
|
| |
|
| |
def build(self, skip_tag=False, scratch=False, background=False,
|
| |
url=None, chain=None, arches=None, sets=False, nvr_check=True):
|
| |
- """Initiate a build of the module. Available options are:
|
| |
+ """Initiate a build. Available options are:
|
| |
|
| |
skip_tag: Skip the tag action after the build
|
| |
|
| |
@@ -1978,7 +2045,7 @@
|
| |
' care that I am not able to construct NVR.'
|
| |
' I will refer this build by package name'
|
| |
' in following messages.')
|
| |
- build_reference = self.module_name
|
| |
+ build_reference = self.repo_name
|
| |
|
| |
# see if this build has been done. Does not check builds within
|
| |
# a chain
|
| |
@@ -2057,7 +2124,7 @@
|
| |
clog.writelines(clog_lines)
|
| |
|
| |
def compile(self, arch=None, short=False, builddir=None, nocheck=False):
|
| |
- """Run rpmbuild -bc on a module
|
| |
+ """Run rpmbuild -bc
|
| |
|
| |
optionally for a specific arch, or short-circuit it, or
|
| |
define an alternate builddir
|
| |
@@ -2110,7 +2177,7 @@
|
| |
self.kojisession.uploadWrapper(file, path, callback=callback)
|
| |
|
| |
def install(self, arch=None, short=False, builddir=None, nocheck=False):
|
| |
- """Run rpm -bi on a module
|
| |
+ """Run rpm -bi
|
| |
|
| |
optionally for a specific arch, short-circuit it, or
|
| |
define an alternative builddir
|
| |
@@ -2146,7 +2213,7 @@
|
| |
"""
|
| |
|
| |
# Check for srpm
|
| |
- srpm = "%s-%s-%s.src.rpm" % (self.module_name, self.ver, self.rel)
|
| |
+ srpm = "%s-%s-%s.src.rpm" % (self.repo_name, self.ver, self.rel)
|
| |
if not os.path.exists(os.path.join(self.path, srpm)):
|
| |
log.warning('No srpm found')
|
| |
|
| |
@@ -2161,7 +2228,7 @@
|
| |
if not rpms:
|
| |
log.warning('No rpm found')
|
| |
cmd = ['rpmlint']
|
| |
- default_rpmlintconf = '{0}.rpmlintrc'.format(self.module_name)
|
| |
+ default_rpmlintconf = '{0}.rpmlintrc'.format(self.repo_name)
|
| |
if info:
|
| |
cmd.extend(['-i'])
|
| |
if rpmlintconf:
|
| |
@@ -2436,7 +2503,7 @@
|
| |
|
| |
gitignore.add('/%s' % file_basename)
|
| |
self.lookasidecache.upload(
|
| |
- self.ns_module_name if self.lookaside_namespaced else self.module_name,
|
| |
+ self.ns_repo_name if self.lookaside_namespaced else self.repo_name,
|
| |
f, file_hash)
|
| |
|
| |
sourcesf.write()
|
| |
@@ -2445,7 +2512,7 @@
|
| |
self.repo.index.add(['sources', '.gitignore'])
|
| |
|
| |
def prep(self, arch=None, builddir=None):
|
| |
- """Run `rpmbuild -bp` on a module
|
| |
+ """Run `rpmbuild -bp`
|
| |
|
| |
:param str arch: optional to run prep section for a specific arch. By
|
| |
default, local system arch will be used.
|
| |
@@ -2467,7 +2534,7 @@
|
| |
self._run_command(cmd, shell=True)
|
| |
|
| |
def srpm(self, hashtype=None):
|
| |
- """Create an srpm using hashtype from content in the module
|
| |
+ """Create an srpm using hashtype from content
|
| |
|
| |
Requires sources already downloaded. The generated SRPM file will be
|
| |
put into package repository directory.
|
| |
@@ -2478,7 +2545,7 @@
|
| |
|
| |
self.srpmname = os.path.join(self.path,
|
| |
"%s-%s-%s.src.rpm"
|
| |
- % (self.module_name, self.ver, self.rel))
|
| |
+ % (self.repo_name, self.ver, self.rel))
|
| |
|
| |
# See if we need to build the srpm
|
| |
if os.path.exists(self.srpmname):
|
| |
@@ -2525,7 +2592,7 @@
|
| |
else:
|
| |
spec = data
|
| |
# Replace %{name} with the package name
|
| |
- spec = spec.replace("%{name}", self.module_name)
|
| |
+ spec = spec.replace("%{name}", self.repo_name)
|
| |
# Replace %{version} with the package version
|
| |
spec = spec.replace("%{version}", self.ver)
|
| |
|
| |
@@ -2558,7 +2625,7 @@
|
| |
return [line_num, offset - offset_inc + 1]
|
| |
|
| |
def verify_files(self, builddir=None):
|
| |
- """Run `rpmbuild -bl` on a module to verify the `%files` section
|
| |
+ """Run `rpmbuild -bl` to verify the `%files` section
|
| |
|
| |
:param str builddir: optionally define an alternate builddir.
|
| |
"""
|
| |
@@ -2848,7 +2915,7 @@
|
| |
# If the scm_url isn't specified, get the remote git URL of the
|
| |
# git repo the current user is in
|
| |
actual_scm_url = self._get_namespace_anongiturl(
|
| |
- self.ns_module_name)
|
| |
+ self.ns_repo_name)
|
| |
actual_scm_url = '{0}?#{1}'.format(actual_scm_url, self.commithash)
|
| |
return actual_scm_url, actual_branch
|
| |
|
| |
--module-name
can still be used but deprecation message is printed. As a result, a use case of--module-name
, e.g.fedpkg --module-name modules/somemodule request-repo
, could be replaced withfedpkg --name somemodule --namespace modules request-repo
.In addition, if
repo_namespaces
is configured, for example in fedpkg.conf, value of--namespace
will be validated.Fixes #301