File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1422,29 +1422,8 @@ def _finalize(self) -> None:
14221422 self .gen .add_command (f'FLATPAK_BUILDER_BUILDDIR=$PWD { patch_all_dest } ' )
14231423
14241424 if self .index_entries :
1425- # (ab-)use a "script" module to generate the index.
1426- parents : Set [str ] = set ()
1427-
1428- for path in self .index_entries :
1429- for parent in map (str , path .relative_to (self .cacache_dir ).parents ):
1430- if parent != '.' :
1431- parents .add (parent )
1432-
1433- index_commands : List [str ] = []
1434- index_commands .append ('import os' )
1435- index_commands .append (f'os.chdir({ str (self .cacache_dir )!r} )' )
1436-
1437- for parent in sorted (parents , key = len ):
1438- index_commands .append (f'os.makedirs({ parent !r} , exist_ok=True)' )
1439-
14401425 for path , entry in self .index_entries .items ():
1441- path = path .relative_to (self .cacache_dir )
1442- index_commands .append (f'with open({ str (path )!r} , "w") as fp:' )
1443- index_commands .append (f' fp.write({ entry !r} )' )
1444-
1445- script_dest = self .gen .data_root / 'generate-index.py'
1446- self .gen .add_script_source (index_commands , script_dest )
1447- self .gen .add_command (f'python3 { script_dest } ' )
1426+ self .gen .add_data_source (entry , path )
14481427
14491428
14501429class YarnLockfileProvider (LockfileProvider ):
You can’t perform that action at this time.
0 commit comments