@@ -53,23 +53,6 @@ def check_repo(self, path: str) -> None:
5353 self .errors .add ("appstream-missing-screenshots" )
5454 return
5555
56- arches = {ref .split ("/" )[2 ] for ref in refs if len (ref .split ("/" )) == 4 }
57- for arch in arches :
58- if f"screenshots/{ arch } " not in refs :
59- self .errors .add ("appstream-screenshots-not-mirrored-in-ostree" )
60- return
61-
62- ostree_screenshots_cmd = ostree .cli (path , "ls" , "-R" , "screenshots/x86_64" )
63- if ostree_screenshots_cmd ["returncode" ] != 0 :
64- raise RuntimeError ("Failed to list screenshots" )
65-
66- ostree_screenshots = []
67- for ostree_screenshot in ostree_screenshots_cmd ["stdout" ].splitlines ():
68- mode , _ , _ , _ , ostree_screenshot_filename = ostree_screenshot .split ()
69- if mode [0 ] != "-" :
70- continue
71- ostree_screenshots .append (ostree_screenshot_filename [1 :])
72-
7356 for screenshot in screenshots :
7457 if screenshot .attrib .get ("type" ) != "source" :
7558 if not screenshot .text .startswith (
@@ -78,9 +61,28 @@ def check_repo(self, path: str) -> None:
7861 self .errors .add ("appstream-external-screenshot-url" )
7962 return
8063
81- screenshot_filename = "/" .join (screenshot .text .split ("/" )[5 :])
82- if f"{ screenshot_filename } " not in ostree_screenshots :
83- self .warnings .add (
84- "appstream-screenshots-files-not-found-in-ostree"
85- )
86- return
64+ arches = {ref .split ("/" )[2 ] for ref in refs if len (ref .split ("/" )) == 4 }
65+ for arch in arches :
66+ if f"screenshots/{ arch } " not in refs :
67+ self .errors .add ("appstream-screenshots-not-mirrored-in-ostree" )
68+ return
69+
70+ ostree_screenshots_cmd = ostree .cli (path , "ls" , "-R" , "screenshots/{arch}" )
71+ if ostree_screenshots_cmd ["returncode" ] != 0 :
72+ raise RuntimeError ("Failed to list screenshots" )
73+
74+ ostree_screenshots = []
75+ for ostree_screenshot in ostree_screenshots_cmd ["stdout" ].splitlines ():
76+ mode , _ , _ , _ , ostree_screenshot_filename = ostree_screenshot .split ()
77+ if mode [0 ] != "-" :
78+ continue
79+ ostree_screenshots .append (ostree_screenshot_filename [1 :])
80+
81+ for screenshot in screenshots :
82+ if screenshot .attrib .get ("type" ) != "source" :
83+ screenshot_filename = "/" .join (screenshot .text .split ("/" )[5 :])
84+ if f"{ screenshot_filename } " not in ostree_screenshots :
85+ self .warnings .add (
86+ "appstream-screenshots-files-not-found-in-ostree"
87+ )
88+ return
0 commit comments