def test_is_native_file_3_git(self):
        """Test native package of format 3 from git"""
        self._commit_format('3.0', 'native')
        source = DebianSource(GitVfs(self.repo))
        self.assertTrue(source.is_native())

        self._commit_format('3.0', 'quilt')
        source = DebianSource(GitVfs(self.repo))
        self.assertFalse(source.is_native())
예제 #2
0
def get_changes(dir, repo, debian_branch):
    if repo.empty:
        version = "0~"
    else:
        vfs = GitVfs(repo, debian_branch)
        try:
            with vfs.open('debian/changelog') as f:
                version = ChangeLog(contents=f.read()).version
        except IOError:
            version = "0~"  # Use full history if debian branch has no changelog
    cl = ChangeLog(filename=os.path.join(dir, 'debian/changelog'))
    return cl.get_changes(version)
예제 #3
0
def get_changes(dir, repo, is_empty, debian_branch):
    if is_empty:
        version = "0~"
    else:
        vfs = GitVfs(repo, debian_branch)
        try:
            with vfs.open('debian/changelog') as f:
                version = ChangeLog(contents=f.read()).version
        except IOError:
            version = "0~"  # Use full history if debian branch has no changelog
    cl = ChangeLog(filename=os.path.join(dir, 'debian/changelog'))
    return cl.get_changes(version)
예제 #4
0
def is_30_quilt(repo, options):
    format_file = DebianSourceFormat.format_file
    try:
        content = GitVfs(repo, options.debian_branch).open(format_file).read()
    except IOError:
        return False
    return str(DebianSourceFormat(content)) == "3.0 (quilt)"
예제 #5
0
def source_vfs(repo, options, tree):
    """Init source package info either from git or from working copy"""
    vfs = GitVfs(repo, tree) if tree else FileVfs('.')
    try:
        source = DebianSource(vfs)
        source.is_native()  # check early if this works
    except Exception as e:
        raise GbpError("Can't determine package type: %s" % e)
    return source
예제 #6
0
def source_vfs(repo, options, tree):
    """Init source package info either from git or from working copy"""
    # FIXME: just init the correct vfs
    try:
        if tree:
            source = DebianSource(GitVfs(repo, tree))
        else:
            source = DebianSource('.')
            source.is_native()  # check early if this works
    except Exception as e:
        raise GbpError("Can't determine package type: %s" % e)
    return source