~ubuntu-branches/debian/sid/bzr-builddeb/sid

« back to all changes in this revision

Viewing changes to cmds.py

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij, Jelmer Vernooij, Martin Packman
  • Date: 2011-10-01 21:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20111001212705-29f1lpwpsdb2dork
Tags: 2.7.9
[ Jelmer Vernooij ]
* Support .tar.xz Debian files rather than .tar.lzma.

[ Martin Packman ]
* Support non-ascii characters in changelog entry when determining
  commit message. LP: #853664

[ Jelmer Vernooij ]
* Use more complete control file during examples. Closes: #642818

Show diffs side-by-side

added added

removed removed

Lines of Context:
351
351
            if build_type is None:
352
352
                build_type = config.build_type
353
353
            contains_upstream_source = tree_contains_upstream_source(tree)
354
 
            (changelog, larstiq) = find_changelog(tree, not contains_upstream_source)
 
354
            (changelog, top_level) = find_changelog(tree, not contains_upstream_source)
355
355
            if build_type is None:
356
356
                build_type = guess_build_type(tree, changelog.version,
357
357
                    contains_upstream_source)
396
396
            elif not native and config.upstream_branch is not None:
397
397
                upstream_sources.append(LazyUpstreamBranchSource(config.upstream_branch))
398
398
            upstream_sources.extend([
399
 
                GetOrigSourceSource(tree, larstiq),
400
 
                UScanSource(tree, larstiq),
 
399
                GetOrigSourceSource(tree, top_level),
 
400
                UScanSource(tree, top_level),
401
401
                ])
402
402
            if build_type == BUILD_TYPE_SPLIT:
403
403
                upstream_sources.append(SelfSplitSource(tree))
413
413
                distiller_cls = FullSourceDistiller
414
414
 
415
415
            distiller = distiller_cls(tree, upstream_provider,
416
 
                    larstiq=larstiq, use_existing=use_existing,
 
416
                    top_level=top_level, use_existing=use_existing,
417
417
                    is_working_tree=working_tree)
418
418
 
419
419
            build_source_dir = os.path.join(build_dir,
471
471
 
472
472
    You must supply the source to import from, and in some cases
473
473
    the version number of the new release. The source can be a .tar.gz, .tar,
474
 
    .tar.bz2, .tar.lzma, .tgz or .zip archive, a directory or a branch. The
 
474
    .tar.bz2, .tar.xz, .tgz or .zip archive, a directory or a branch. The
475
475
    source may also be a remote file described by a URL.
476
476
 
477
477
    In most situations the version can be guessed from the upstream source.
577
577
            if v3:
578
578
                if location.endswith(".tar.bz2") or location.endswith(".tbz2"):
579
579
                    format = "bz2"
580
 
                elif location.endswith(".tar.lzma"):
581
 
                    format = "lzma"
 
580
                elif location.endswith(".tar.xz"):
 
581
                    format = "xz"
582
582
            dest_name = tarball_name(package, version, None, format=format)
583
583
            tarball_filename = os.path.join(orig_dir, dest_name)
584
584
            try:
604
604
    def _get_changelog_info(self, tree, last_version, package, distribution):
605
605
        current_version = last_version
606
606
        try:
607
 
            (changelog, larstiq) = find_changelog(tree, False, max_blocks=2)
 
607
            (changelog, top_level) = find_changelog(tree, False, max_blocks=2)
608
608
            if last_version is None:
609
609
                current_version = changelog.version.upstream_version
610
610
            if package is None:
614
614
                if distribution is not None:
615
615
                    note("Using distribution %s" % distribution)
616
616
        except MissingChangelogError:
617
 
            larstiq = False
 
617
            top_level = False
618
618
            changelog = None
619
619
        if distribution is None:
620
620
            note("No distribution specified, and no changelog, "
631
631
            raise BzrCommandError("Unknown target distribution: %s" \
632
632
                        % distribution)
633
633
        return (current_version, package, distribution, distribution_name,
634
 
                changelog, larstiq)
 
634
                changelog, top_level)
635
635
 
636
636
    def run(self, location=None, upstream_branch=None, version=None,
637
637
            distribution=None, package=None,
647
647
                        "command.")
648
648
            config = debuild_config(tree, tree)
649
649
            (current_version, package, distribution, distribution_name,
650
 
             changelog, larstiq) = self._get_changelog_info(tree, last_version,
 
650
             changelog, top_level) = self._get_changelog_info(tree, last_version,
651
651
                 package, distribution)
652
652
            contains_upstream_source = tree_contains_upstream_source(tree)
653
653
            if changelog is None:
702
702
                            " branch source")
703
703
                    primary_upstream_source = upstream_branch_source
704
704
                else:
705
 
                    primary_upstream_source = UScanSource(tree, larstiq)
 
705
                    primary_upstream_source = UScanSource(tree, top_level)
706
706
 
707
707
            if revision is not None:
708
708
                if upstream_branch is None:
869
869
            dbs = DistributionBranchSet()
870
870
            dbs.add_branch(db)
871
871
            try:
872
 
                (changelog, larstiq) = find_changelog(tree, False)
 
872
                (changelog, top_level) = find_changelog(tree, False)
873
873
                last_version = changelog.version
874
874
            except MissingChangelogError:
875
875
                last_version = None
1034
1034
            except KeyError:
1035
1035
                command_list = ["/bin/sh"]
1036
1036
            give_instruction = True
1037
 
        (changelog, larstiq) = find_changelog(t, True)
 
1037
        (changelog, top_level) = find_changelog(t, True)
1038
1038
        build_dir = config.build_dir
1039
1039
        if build_dir is None:
1040
1040
            build_dir = default_build_dir
1046
1046
                changelog.version.upstream_version, orig_dir,
1047
1047
                [PristineTarSource(t, t.branch),
1048
1048
                 AptSource(),
1049
 
                 GetOrigSourceSource(t, larstiq),
1050
 
                 UScanSource(t, larstiq) ])
 
1049
                 GetOrigSourceSource(t, top_level),
 
1050
                 UScanSource(t, top_level) ])
1051
1051
 
1052
1052
        distiller = MergeModeDistiller(t, upstream_provider,
1053
 
                larstiq=larstiq)
 
1053
                top_level=top_level)
1054
1054
 
1055
1055
        build_source_dir = os.path.join(build_dir,
1056
1056
                changelog.package + "-" + changelog.version.upstream_version)
1071
1071
            raise BzrCommandError('Not updating the working tree as the '
1072
1072
                    'command failed.')
1073
1073
        note("Copying debian/ back")
1074
 
        if larstiq:
 
1074
        if top_level:
1075
1075
            destination = ''
1076
1076
        else:
1077
1077
            destination = 'debian/'
1113
1113
            config = debuild_config(t, t)
1114
1114
            if merge is None:
1115
1115
                merge = (config.build_type == BUILD_TYPE_MERGE)
1116
 
            (changelog, larstiq) = find_changelog(t, merge)
 
1116
            (changelog, top_level) = find_changelog(t, merge)
1117
1117
            if changelog.distributions == 'UNRELEASED':
1118
1118
                if not force:
1119
1119
                    raise BzrCommandError("The changelog still targets "