View | Details | Raw Unified | Return to bug 19853
Collapse All | Expand All

(-)python/univention-install-config-registry-info (-2 / +19 lines)
 Lines 32-37    Link Here 
32
# <http://www.gnu.org/licenses/>.
32
# <http://www.gnu.org/licenses/>.
33
33
34
import os, sys
34
import os, sys
35
from optparse import OptionParser
35
import subprocess
36
import subprocess
36
import univention.config_registry_info as ucr_info
37
import univention.config_registry_info as ucr_info
37
38
 Lines 41-58    Link Here 
41
		print '\t%s' % ' '.join(argv)
42
		print '\t%s' % ' '.join(argv)
42
	return subprocess.call(argv)
43
	return subprocess.call(argv)
43
44
45
def check_path(path):
46
	if not os.path.exists(path):
47
		error_path(path)
48
	return path
49
	
50
def error_path(path):
51
	print >> sys.stderr, "File %s was not found" % path
52
	sys.exit(1)
53
44
def binary_packages():
54
def binary_packages():
45
	_prefix = 'Package: '
55
	_prefix = 'Package: '
46
	packages = []
56
	packages = []
47
	fp = open( 'debian/control' )
57
	fp = open( check_path('debian/control') )
48
	for line in fp.readlines():
58
	for line in fp.readlines():
49
		if not line.startswith( _prefix ):
59
		if not line.startswith( _prefix ):
50
			continue
60
			continue
51
		packages.append( line[ len( _prefix ) :  -1 ] )
61
		packages.append( line[ len( _prefix ) :  -1 ] )
52
	fp.close()
62
	fp.close()
53
	return packages
63
	return packages
54
64
	
55
if __name__ == '__main__':
65
if __name__ == '__main__':
66
	parser = OptionParser( version='univention-install-config-registry-info @%@package_version@%@')
67
	parser.set_usage("Usage: %prog")
68
	
69
	parser.set_description("""Description: univention-install-config-registry-info  is a debhelper like programm that is responsible for installing univention config registry (UCR)  variable and category descriptions into  etc/univention/registry.info/variables/  and  /etc/univention/registry.info/categories/  in  the package build directory. The files debian/PACKAGE.univention-config-registry-variables and debian/PACKAGE.univention-config-registry-categories are installed.""")
70
	
71
	parser.parse_args()
72
			
56
	info = ucr_info.ConfigRegistryInfo( install_mode = True )
73
	info = ucr_info.ConfigRegistryInfo( install_mode = True )
57
	for package in binary_packages():
74
	for package in binary_packages():
58
		# package's conffiles
75
		# package's conffiles
(-)python/univention-install-service-info (-1 / +18 lines)
 Lines 32-37    Link Here 
32
# <http://www.gnu.org/licenses/>.
32
# <http://www.gnu.org/licenses/>.
33
33
34
import os, sys
34
import os, sys
35
from optparse import OptionParser
35
import subprocess
36
import subprocess
36
import univention.service_info as us_info
37
import univention.service_info as us_info
37
38
 Lines 41-50    Link Here 
41
		print '\t%s' % ' '.join(argv)
42
		print '\t%s' % ' '.join(argv)
42
	return subprocess.call(argv)
43
	return subprocess.call(argv)
43
44
45
def check_path(path):
46
	if not os.path.exists(path):
47
		error_path(path)
48
	return path
49
	
50
def error_path(path):
51
	print >> sys.stderr, "File %s was not found" %path
52
	sys.exit(1)
53
	
44
def binary_packages():
54
def binary_packages():
45
	_prefix = 'Package: '
55
	_prefix = 'Package: '
46
	packages = []
56
	packages = []
47
	fp = open( 'debian/control' )
57
	fp = open( check_path('debian/control') )
48
	for line in fp.readlines():
58
	for line in fp.readlines():
49
		if not line.startswith( _prefix ):
59
		if not line.startswith( _prefix ):
50
			continue
60
			continue
 Lines 53-58    Link Here 
53
	return packages
63
	return packages
54
64
55
if __name__ == '__main__':
65
if __name__ == '__main__':
66
	parser = OptionParser( version='univention-install-service-info @%@package_version@%@')
67
	parser.set_usage("Usage: %prog")
68
	
69
	parser.set_description("""Description: univention-install-service-info  is a debhelper like programm that is responsible for installing a service description file into etc/univention/service.info/services/ in the package build directory. The files debian/PACKAGE.univention-service are installed.""")
70
	
71
	parser.parse_args()
72
	
56
	info = us_info.ServiceInfo( install_mode = True )
73
	info = us_info.ServiceInfo( install_mode = True )
57
	for package in binary_packages():
74
	for package in binary_packages():
58
		# package's conffiles
75
		# package's conffiles
(-)python/univention-install-config-registry (-6 / +22 lines)
 Lines 32-37    Link Here 
32
# <http://www.gnu.org/licenses/>.
32
# <http://www.gnu.org/licenses/>.
33
33
34
import os, sys
34
import os, sys
35
from optparse import OptionParser
35
import subprocess
36
import subprocess
36
import univention.config_registry
37
import univention.config_registry
37
38
 Lines 40-49    Link Here 
40
	if os.environ.get('DH_VERBOSE', False):
41
	if os.environ.get('DH_VERBOSE', False):
41
		print '\t%s' % ' '.join(argv)
42
		print '\t%s' % ' '.join(argv)
42
	return subprocess.call(argv)
43
	return subprocess.call(argv)
43
44
	
45
def check_path(path):
46
	if not os.path.exists(path):
47
		error_path(path)
48
	return path
49
	
50
def error_path(path):
51
	print >> sys.stderr, "File %s was not found" % path 
52
	sys.exit(1)
53
	
44
def getPackages():
54
def getPackages():
45
	packages = []
55
	packages = []
46
	fp = open('debian/control')
56
	fp = open(check_path('debian/control'))
47
	for line in fp.readlines():
57
	for line in fp.readlines():
48
		if not line.startswith('Package: '):
58
		if not line.startswith('Package: '):
49
			continue
59
			continue
 Lines 67-74    Link Here 
67
	if file.startswith('etc/'):
77
	if file.startswith('etc/'):
68
		f = 'conffiles/'+file[4:]
78
		f = 'conffiles/'+file[4:]
69
		if os.path.exists(f): return f
79
		if os.path.exists(f): return f
70
	print "file "+file+" was not found"
80
	error_path(file)
71
	sys.exit(1)
72
81
73
def destPath(file, package, type='files'):
82
def destPath(file, package, type='files'):
74
	return tmpDir(package)+'/etc/univention/templates/'+type+'/'+file
83
	return tmpDir(package)+'/etc/univention/templates/'+type+'/'+file
 Lines 81-88    Link Here 
81
		return type
90
		return type
82
	else:
91
	else:
83
		return 'file'
92
		return 'file'
84
93
	
85
if __name__ == '__main__':
94
if __name__ == '__main__':
95
	parser = OptionParser( version='univention-install-config-registry @%@package_version@%@')
96
	parser.set_usage("Usage: %prog")
97
	
98
	parser.set_description("""Description: univention-install-config-registry  is a debhelper like programm that is responsible for installing template files using univention config registry (UCR) variables into etc/univention/templates/ in the package build directory. The  templates  references by debian/PACKAGE.univention-config-registry are installed.""")
99
	
100
	parser.parse_args()
101
			
86
	for package in getPackages():
102
	for package in getPackages():
87
		file = extFile(package, 'univention-config-registry')
103
		file = extFile(package, 'univention-config-registry')
88
		if not os.path.exists(file):
104
		if not os.path.exists(file):
 Lines 97-103    Link Here 
97
		try:	bla=open('debian/'+package+'.conffiles').readlines()
113
		try:	bla=open('debian/'+package+'.conffiles').readlines()
98
		except IOError:	bla=[]
114
		except IOError:	bla=[]
99
		conffiles = open('debian/'+package+'.conffiles','a')
115
		conffiles = open('debian/'+package+'.conffiles','a')
100
		fp = open(file)
116
		fp = open(check_path(file))
101
		filelist = []
117
		filelist = []
102
		for item in univention.config_registry.parseRfc822(fp.read()):
118
		for item in univention.config_registry.parseRfc822(fp.read()):
103
			if item['Type'][0] == 'file':
119
			if item['Type'][0] == 'file':

Return to bug 19853