Ok, thanks for the pointer and help. I'll push it later on this evening, right now I don't have my ssh keys on this machine :)
NM Melhores cumprimentos, Nelson M. Marques ________________________________________ De: Vincent Untz [[email protected]] Enviado: terça-feira, 25 de Setembro de 2012 12:52 Para: [email protected] Assunto: Re: [opensuse-gnome] tiny patch for spec-cleaner Hi, Le mardi 25 septembre 2012, à 00:45 +0100, Nelson Manuel Marques a écrit : > +def replace_lang_macros(s): > + return re.sub(r'%find_lang(.*)', r'%find_lang\1 %{?no_lang_C}', s) Wouldn't this replace "%find_lang %{?no_lang_C} foo" with "%find_lang %{?no_lang_C} foo %{?no_lang_C}"? You probably need to check if %{?no_lang_C} is there before doing the substitution. Cheers, Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: [email protected] To contact the owner, e-mail: [email protected]
From ddca1951386f8ceee333a3335e45e7315e52a900 Mon Sep 17 00:00:00 2001 From: Nelson Marques <[email protected]> Date: Tue, 25 Sep 2012 17:06:24 +0100 Subject: [PATCH] rework; only append %{?no_lang_C} if it doesnt exist already --- spec-cleaner | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec-cleaner b/spec-cleaner index 965ce12..286ee97 100755 --- a/spec-cleaner +++ b/spec-cleaner @@ -158,7 +158,9 @@ def replace_preamble_macros(s): return s def replace_lang_macros(s): - return re.sub(r'%find_lang(.*)', r'%find_lang\1 %{?no_lang_C}', s) + if '%{?no_lang_C}' not in s: + s = re.sub(r'%find_lang(.*)', r'%find_lang\1 %{?no_lang_C}', s) + return s def replace_all(s): s = replace_buildroot(s) -- 1.7.10.4
