@@ -445,7 +445,7 @@ def _RewriteSetupPyGeneratedFile(
445445
446446 elif (line .startswith (b'%package -n python-' ) or
447447 line .startswith (b'%package -n python2-' )):
448- if project_name in ( 'artifacts' , ' plaso') :
448+ if project_name == ' plaso' :
449449 in_python_package = True
450450 continue
451451
@@ -462,7 +462,7 @@ def _RewriteSetupPyGeneratedFile(
462462 has_python3_package = True
463463
464464 elif line .startswith (b'%prep' ):
465- if project_name in ( 'artifacts' , ' plaso') :
465+ if project_name == ' plaso' :
466466 requires = b'{0:s}, {1:s}-data\n ' .format (
467467 requires [:- 1 ], project_name )
468468
@@ -490,7 +490,7 @@ def _RewriteSetupPyGeneratedFile(
490490 output_file_object , python_package_name , summary , requires ,
491491 description )
492492
493- if project_name in ( 'artifacts' , ' plaso') :
493+ if project_name == ' plaso' :
494494 output_file_object .write ((
495495 b'%package -n %{{name}}-data\n '
496496 b'{0:s}'
@@ -518,7 +518,8 @@ def _RewriteSetupPyGeneratedFile(
518518 elif line == b'rm -rf $RPM_BUILD_ROOT\n ' :
519519 line = b'rm -rf %{buildroot}\n '
520520
521- elif line .startswith (b'%files' ):
521+ elif (line .startswith (b'%files' ) and
522+ not line .startswith (b'%files -n %{name}-data' )):
522523 break
523524
524525 elif in_description :
@@ -555,14 +556,15 @@ def _RewriteSetupPyGeneratedFile(
555556 output_file_object , project_definition , project_name ,
556557 python_package_name , license_line , doc_line )
557558
558- if project_name in ( 'artifacts' , ' plaso') :
559+ if project_name == ' plaso' :
559560 output_file_object .write (
560561 b'\n '
561562 b'%files -n %{name}-data\n '
562563 b'%{_datadir}/%{name}/*\n ' )
563564
564565 # TODO: add bindir support.
565566 output_file_object .write ((
567+ b'\n '
566568 b'%exclude %{_bindir}/*\n ' ))
567569
568570 # TODO: add shared data support.
0 commit comments