Manage the %config() case in spec files
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Thu, 15 May 2014 09:44:04 +0000 (11:44 +0200)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Thu, 15 May 2014 09:44:04 +0000 (11:44 +0200)
When the %config() macro was encountered in the packaging section of a
spec file, the file wasn't added to the package in the recipe. Also when
more than one macro was found before a file in the packaging section the
file would not be added (usually a %attr() and a %config() macro). This
patch correct both those issues.

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

index d5ce547..eb340f6 100755 (executable)
@@ -1246,7 +1246,7 @@ Group: devel
             elif line.startswith( "%attr(" ):
                 line = line.replace( "//", "/" )
                 pkg_f_clean=line.split(")")
-                pkg_f=pkg_f_clean[1].strip()
+                pkg_f=pkg_f_clean[-1].strip()
                 res_list.append( pkg_f )
             elif line.startswith( "%doc " ):
                 line = line.replace( "//", "/" )
@@ -1263,6 +1263,11 @@ Group: devel
             elif line.startswith( "%config(noreplace) " ):
                 line = line.replace( "//", "/" )
                 res_list.append( line.replace( "%config(noreplace) ", "" ) )
+            elif line.startswith( "%config(" ):
+                line = line.replace( "//", "/" )
+                pkg_f_clean=line.split(")")
+                pkg_f=pkg_f_clean[-1].strip()
+                res_list.append( pkg_f )
             else:
                 pass