Commit 3aa169b8 authored by AlmAck's avatar AlmAck
Browse files

redefine the locale search condition

rfind(' ') was wrong since the pkg does not contains any spaces.
the pkg can be:

the new code search from the right the first '-' and then returns the string from there. For kde-l10n-zh_CN the string returned is zh_CN
fix #1
parent 1a4c3a8f
......@@ -74,7 +74,7 @@ def remove_locales(basepkgname, keep_locale):
# Remove the pkgs that do not have the locale 'keep_locale'
# ex: kde-l10n-it 15.04.0-2
for pkg in list_of_pkgs:
if pkg[pkg.find(basepkgname + "-")+len(basepkgname + "-"):pkg.rfind(' ')] not in keep_locale:
if keep_locale not in pkg[pkg.rfind('-')+1:]:
print('Removing %s package' % pkg)
['pacman', '-Rddn', '--noconfirm', '%s' % (pkg)])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment