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

Last change on this file since 3897 was 3897, checked in by hectorgh, 2 years ago

wip

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