Skip to content

Commit ce66550

Browse files
committed
import-dsc: Add pristine-lfs support
Signed-off-by: Andrej Shadura <[email protected]>
1 parent 531971c commit ce66550

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

gbp/scripts/clone.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def build_parser(name):
141141
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
142142
branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
143143
branch_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
144+
branch_group.add_boolean_config_file_option(option_name="pristine-lfs", dest="pristine_lfs")
144145
branch_group.add_option("--depth", action="store", dest="depth", default=0,
145146
help="git history depth (for creating shallow clones)")
146147
branch_group.add_option("--reference", action="store", dest="reference", default=None,

gbp/scripts/import_dsc.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,19 @@ def move_tag_stamp(repo, format, version):
307307

308308

309309
def disable_pristine_tar(options, reason):
310-
"""Disable pristine tar if enabled"""
310+
"""Disable pristine-tar if enabled"""
311311
if options.pristine_tar:
312312
gbp.log.info("%s: setting '--no-pristine-tar' option" % reason)
313313
options.pristine_tar = False
314314

315315

316+
def disable_pristine_lfs(options, reason):
317+
"""Disable pristine-lfs if enabled"""
318+
if options.pristine_lfs:
319+
gbp.log.info("%s: setting '--no-pristine-lfs' option" % reason)
320+
options.pristine_lfs = False
321+
322+
316323
def build_parser(name):
317324
try:
318325
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
@@ -359,6 +366,8 @@ def build_parser(name):
359366
dest="filters", action="append")
360367
import_group.add_boolean_config_file_option(option_name="pristine-tar",
361368
dest="pristine_tar")
369+
import_group.add_boolean_config_file_option(option_name="pristine-lfs",
370+
dest="pristine_lfs")
362371
import_group.add_option("--allow-same-version", action="store_true",
363372
dest="allow_same_version", default=False,
364373
help="allow import of already imported version")
@@ -487,6 +496,7 @@ def main(argv):
487496

488497
if repo.bare:
489498
disable_pristine_tar(options, "Bare repository")
499+
disable_pristine_lfs(options, "Bare repository")
490500

491501
# unpack
492502
dirs['tmp'] = os.path.abspath(tempfile.mkdtemp(dir='..'))
@@ -532,8 +542,11 @@ def main(argv):
532542
else:
533543
gbp.log.warn("Didn't find a diff to apply.")
534544

535-
if imported and options.pristine_tar:
536-
repo.create_pristine_tar_commits(commit, sources)
545+
if imported:
546+
if options.pristine_lfs:
547+
repo.create_pristine_lfs_commits(sources)
548+
if options.pristine_tar:
549+
repo.create_pristine_tar_commits(commit, sources)
537550
if repo.get_branch() == options.debian_branch or repo.empty:
538551
# Update HEAD if we modified the checked out branch
539552
repo.force_head(options.debian_branch, hard=True)

0 commit comments

Comments
 (0)