[elbe-devel] [PATCH 3/3] Upload Debian packages into project Debian repository

Manuel Traut manuel.traut at linutronix.de
Fri May 5 16:58:32 CEST 2017


Hi,

> +        # Parse .dsc-File and append neccessary source files to files
> +        if filetype == '.dsc':
> +            sources = []
> +            p=0
> +
> +            with open(filename) as f:
> +                lines = f.read().splitlines()
> +
> +            for l in lines:
> +                if l.startswith('Files'):
> +                    p=1
> +                    continue
> +                elif p==1 and l=="":
> +                    p=0
> +                    break
> +                if p: files.append(l.split()[2])
> +
> +            # Check whether source files are available
> +            for f in sources:
> +                if not os.path.isfile(f):
> +                    print("Source file %s not found although being specified in %s." % (f, filename))
> +                    sys.exit(20)

i just found this..

>>> import deb822
>>>
>>> d = deb822.Dsc(file('projects/elbe/debathena-transform-lighttpd_1.0.dsc'))
>>> for f in d['Files']:
...     print f['name']
...
...
debathena-transform-lighttpd_1.0.tar.xz

deb822 is packaged in 'python-debian' which is available for jessie and newer.

Maybe it is worth to convert?

Regards,

  Manuel




More information about the elbe-devel mailing list