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

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

wip

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