source: lliurex-dpkg-provider/trunk/fuentes/build.py @ 3891

Last change on this file since 3891 was 3891, checked in by hectorgh, 4 years ago

adding files

  • Property svn:executable set to *
File size: 797 bytes
Line 
1#!/usr/bin/env python
2
3from jinja2 import Environment
4from jinja2.loaders import FileSystemLoader
5from jinja2 import Template
6
7tpl_env = Environment(loader=FileSystemLoader('debian/'))
8
9control_template=tpl_env.get_template("control.skel")
10
11vars={}
12
13vars["CONFLICTS"]=""
14vars["DEPENDS"]=""
15vars["PROVIDES"]=""
16
17f=open("conflicts")
18lines=f.readlines()
19f.close()
20
21for p in lines:
22        if len(p)>0:
23                vars["CONFLICTS"]+=p.strip("\n")
24               
25
26f=open("depends")
27lines=f.readlines()
28f.close()
29
30for p in lines:
31        if len(p)>0:
32                vars["DEPENDS"]+=p.strip("\n")
33               
34
35       
36vars["CONFLICTS"]=vars["CONFLICTS"].rstrip(",")
37vars["PROVIDES"]=vars["CONFLICTS"]
38vars["DEPENDS"]=vars["DEPENDS"].rstrip(",")
39
40content=control_template.render(vars)
41
42
43
44f=open("debian/control","w")
45f.write(content.decode("utf-8"))
46f.close()
47
48
49
50
51
52
53
Note: See TracBrowser for help on using the repository browser.