packaging_dir = os.path.join(workdir, 'packaging/')
export_dir = tempfile.mkdtemp(prefix=packaging_dir + 'build_')
with utils.Workdir(workdir):
+ if opts.commit:
+ commit = opts.commit
+ elif opts.include_uncommited:
+ commit = 'WC.TRACKED'
+ elif opts.include_untracked:
+ commit = 'WC.UNTRACKED'
+ else:
+ commit = 'HEAD'
relative_spec = specfile.replace('%s/' % workdir, '')
- commit = opts.commit or 'HEAD'
msger.info('export tar ball and packaging files ... ')
try:
if gbp_build(["argv[0] placeholder", "--git-export-only",
specfile = utils.guess_spec(workdir, opts.spec)
export_dir = tempfile.mkdtemp(prefix='gbs_export_', dir=outdir)
with utils.Workdir(workdir):
- commit = opts.commit or 'HEAD'
+ if opts.commit:
+ commit = opts.commit
+ elif opts.include_uncommited:
+ commit = 'WC.TRACKED'
+ elif opts.include_untracked:
+ commit = 'WC.UNTRACKED'
+ else:
+ commit = 'HEAD'
relative_spec = specfile.replace('%s/' % workdir, '')
try:
if gbp_build(["argv[0] placeholder", "--git-export-only",
localpkg.remove_all()
with utils.Workdir(workdir):
- commit = opts.commit or 'HEAD'
+ if opts.commit:
+ commit = opts.commit
+ elif opts.include_uncommited:
+ commit = 'WC.TRACKED'
+ elif opts.include_untracked:
+ commit = 'WC.UNTRACKED'
+ else:
+ commit = 'HEAD'
relative_spec = specfile.replace('%s/' % workdir, '')
try:
if gbp_build(["argv[0] placeholder", "--git-export-only",
default=None,
dest='commit',
help='Specify a commit ID to export')
+ @cmdln.option('--include-uncommited',
+ action='store_true',
+ default=False,
+ dest='include_uncommited',
+ help='uncommited changes would be included while '\
+ 'generating tar ball')
+ @cmdln.option('--include-untracked',
+ action='store_true',
+ default=False,
+ dest='include_untracked',
+ help='untracked files would be included while '\
+ 'generating tar ball')
def do_export(self, _subcmd, opts, *args):
"""${cmd_name}: export files and prepare for build
dest='extra_packs',
help='Specify extra packages to install to build root '\
'multiple packages can be separated by comma')
+ @cmdln.option('--include-uncommited',
+ action='store_true',
+ default=False,
+ dest='include_uncommited',
+ help='uncommited changes would be included while '\
+ 'generating tar ball')
+ @cmdln.option('--include-untracked',
+ action='store_true',
+ default=False,
+ dest='include_untracked',
+ help='untracked files would be included while '\
+ 'generating tar ball')
@cmdln.option('--debuginfo',
action='store_true',
default=False,
default=False,
dest='status',
help='Get build status from build server')
-
+ @cmdln.option('--include-uncommited',
+ action='store_true',
+ default=False,
+ dest='include_uncommited',
+ help='uncommited changes would be included while '\
+ 'generating tar ball')
+ @cmdln.option('--include-untracked',
+ action='store_true',
+ default=False,
+ dest='include_untracked',
+ help='untracked files would be included while '\
+ 'generating tar ball')
def do_remotebuild(self, subcmd, opts, *args):
"""${cmd_name}: remote build package