Search
j0ke.net Open Build Service
>
Projects
>
SUSE
:
Manager
:
1.2
>
geronimo-specs
> undot.py
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File undot.py of Package geronimo-specs
#!/usr/bin/python # remove dots from package names, as they are not allowed in SUSE # # Usage: # cat geronimo-specs.spec | ./undot.py > geronimo-specs.new.spec # gvimdiff geronimo-specs.spec geronimo-specs.new.spec # review import re import sys regexp = re.compile(r'^(Requires|%package|%description|%post|%postun|%pre|%preun|%files|BuildRequires|PreReq|Provides).*') oregexp = re.compile(r'[<=>]') for line in sys.stdin: if regexp.search(line): m = oregexp.search(line) if m: line = line[:m.start()].replace('.', '_') + line[m.start():] else: line = line.replace('.', '_') sys.stdout.write(line)