Univention Bugzilla – Attachment 5419 Details for
Bug 32539
Check debian/*.{pre,post}{rm,inst} for wrong comment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
ucslint check for correct script naming
1700-Debian.py (text/plain), 1.08 KB, created by
Philipp Hahn
on 2013-09-10 09:33:15 CEST
(
hide
)
Description:
ucslint check for correct script naming
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2013-09-10 09:33:15 CEST
Size:
1.08 KB
patch
obsolete
># vim:set ts=4 sw=4 noet fileencoding=UTF-8 : >try: > import univention.ucslint.base as uub >except ImportError: > import ucslint.base as uub >import os > >class UniventionPackageCheck(uub.UniventionPackageCheckDebian): > def __init__(self): > super(UniventionPackageCheck, self).__init__() > self.name = __name__ > > def getMsgIds(self): > return { > '1700-1': [uub.RESULT_WARN, 'wrong script name'], > } > > def check(self, path): > SCRIPTS = frozenset(('preint', 'postinst', 'prerm', 'postrm')) > for filename in os.listdir(os.path.join(path, 'debian')): > if '.' in filename: > package, suffix = os.path.splitext(filename) > suffix = suffix.lstrip('.') > else: > package, suffix = None, filename > > if suffix not in SCRIPTS: > continue > > script_path = os.path.join(path, 'debian', filename) > with open(script_path, 'r') as script_file: > for line in script_file: > if not line.startswith('#'): > break > for script_name in SCRIPTS - set((suffix,)): > if script_name in line: > self.addmsg('1700-1', 'wrong script name: %r' % (line.strip(),), > filename=script_path)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 32539
: 5419