if len(args) == 1:
workdir = os.path.abspath(args[0])
+ try:
+ repo = RpmGitRepository(workdir)
+ except GitRepositoryError:
+ msger.error("%s is not a git repository" % (os.path.curdir))
+
+ workdir = repo.path
+
hostarch = get_hostarch()
if opts.arch:
buildarch = opts.arch
if not spec.name or not spec.version:
msger.error('can\'t get correct name or version from spec file.')
- try:
- repo = RpmGitRepository(workdir)
- except GitRepositoryError:
- msger.error("%s is not a git repository" % (os.path.curdir))
tarball = None
if spec.orig_file:
msger.error("Cannot create source tarball %s" % tarball)
except GbpError, exc:
msger.error(str(exc))
-
+
if opts.incremental:
cmd += ['--rsync-src=%s' % os.path.abspath(workdir)]
cmd += ['--rsync-dest=/home/abuild/rpmbuild/BUILD/%s-%s' % \
def do(opts, _args):
- project_root_dir = '.'
-
try:
- repo = RpmGitRepository(project_root_dir)
+ repo = RpmGitRepository('.')
except GitRepositoryError:
msger.error("No git repository found.")
+ project_root_dir = repo.path
+
if not repo.is_clean():
msger.error("Git tree is not clean")
if len(args) == 1:
workdir = os.path.abspath(args[0])
+ try:
+ repo = RpmGitRepository(workdir)
+ except GitRepositoryError:
+ msger.error("%s is not a git repository" % (workdir))
+
+ workdir = repo.path
+
if not os.path.exists("%s/packaging" % workdir):
msger.error('No packaging directory, so there is nothing to export.')
urlres = urlparse.urlparse(spec.orig_file)
tarball = '%s/%s' % (outdir, os.path.basename(urlres.path))
msger.info('generate tar ball: %s' % tarball)
- try:
- repo = RpmGitRepository(workdir)
- except GitRepositoryError:
- msger.error("%s is not a git repository" % (os.path.curdir))
try:
comp_type = guess_comp_type(spec)
except repository.GitRepositoryError:
msger.error('%s is not a git dir' % workdir)
+ workdir = repo.path
+
tmpdir = '%s/%s' % (TMPDIR, USER)
if not os.path.exists(tmpdir):
os.makedirs(tmpdir)