File: new-upstream

package info (click to toggle)
pyxplot 0.6.3.1%2Bds-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 848 kB
  • ctags: 267
  • sloc: python: 5,058; xml: 978; sh: 109; makefile: 45
file content (35 lines) | stat: -rw-r--r-- 798 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/python

# Called by uscan(1). Repacks a new upstream tarball, and calls uupdate(1).

import optparse
import os
import tarfile

p = optparse.OptionParser ()
p.add_option ('--upstream_version')
(options, args) = p.parse_args ()

version = options.upstream_version
orig_tarball = os.path.join ('..', args[0])
to = tarfile.open (orig_tarball, 'r')

ds_tarball = os.path.join ('..', 'pyxplot_%s+ds.orig.tar.gz' % (version))
td = tarfile.open (ds_tarball, 'w:gz')

while True:
    x = to.next ()
    if x == None: break

    if x.name == 'pyxplot/PyX-0.9.tar.gz':
        continue
    elif x.name.startswith ('pyxplot/doc/html/'):
        continue

    td.addfile (x, to.extractfile (x))

to.close ()
td.close ()

if version != None:
    os.system ('uupdate %s %s+ds' % (ds_tarball, version))