~ubuntu-langpack/langpack-o-matic/main

« back to all changes in this revision

Viewing changes to lib/makepkg.py

  • Committer: martin at piware
  • Date: 2006-03-31 16:46:38 UTC
  • Revision ID: martin@piware.de-20060331164638-a0b6ed2926666a3c
combined changes from breezy to head from old revision control

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# (C) 2005 Canonical Ltd.
4
4
 
5
 
import os.path, os
 
5
import os.path, os, gzip
6
6
 
7
7
def make_pkg(skeleton, path, lpmacros, extra_tar = None): 
8
8
    '''Create a new source package from a skeleton for a specific locale and
44
44
    # Install extra tarball
45
45
    if extra_tar:
46
46
        target = os.path.join(path, 'data', 'extra.tar')
47
 
        open(target, 'w').write(open(extra_tar).read())
 
47
        if extra_tar.endswith('.gz'):
 
48
            tardata = gzip.open(extra_tar).read()
 
49
        else:
 
50
            tardata = open(extra_tar).read()
 
51
        open(target, 'w').write(tardata)
48
52
 
49
53
def _create_pkg(skel, dest, lpmacros):
50
54
    # copy skel files, omitting hidden files
79
83
    # call dch to update changelog
80
84
    cwd = os.getcwd()
81
85
    os.chdir(dest)
82
 
    result = os.spawnlpe(os.P_WAIT, 'dch', 'dch', '-v', lpmacros['TIMESTAMP'],
 
86
    result = os.spawnlpe(os.P_WAIT, 'dch', 'dch', '-v', 
 
87
        '1:%s+%s' % (lpmacros['RELEASEVERSION'], lpmacros['TIMESTAMP']),
83
88
        '-p', '-D', lpmacros['RELEASE'], 
84
89
        'Automatic update to latest translation data.',
85
90
        {'DEBEMAIL': lpmacros['UPLOADER']})