Correct issue with %prep and %pre
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Thu, 5 Jun 2014 12:17:30 +0000 (14:17 +0200)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Thu, 5 Jun 2014 12:17:30 +0000 (14:17 +0200)
%prep section in spec files was used as a %pre section. This commit
correct this issue.

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
tools/spec2yocto.py

index 9e9299b..17ff3a2 100755 (executable)
@@ -1188,11 +1188,13 @@ Group: devel
         '''
         Return the list of pre script section of the spec file.
         get_section_key() can't be used in this case since it will also
-        return the %preun results.
+        return the %preun and %prep results.
         '''
         res_script_section = []
         for section_key in self.__spect_dico.keys():
-            if section_key.startswith("%pre") and not section_key.startswith("%preun"):
+            if section_key.startswith("%pre") and \
+                    not section_key.startswith("%preun") and \
+                    not section_key.startswith("%prep"):
                 res_script_section.append(section_key)
 
         return res_script_section