@@ -55,7 +55,7 @@ def get_distdir():
5555
5656 d = portage .settings ["DISTDIR" ]
5757 if not os .path .isdir (d ):
58- e = pp .error ("%s does not appear to be a directory.\n " % d )
58+ e = pp .error (f" { d } does not appear to be a directory.\n " )
5959 e += pp .error ("Please set DISTDIR to a sane value.\n " )
6060 e += pp .error ("(Check your make.conf file and environment)." )
6161 print (e , file = sys .stderr )
@@ -138,7 +138,7 @@ def findDistfiles(
138138 installed_included = True
139139 if destructive :
140140 self .output (
141- "...destructive type search: %d packages already found" % len ( pkgs )
141+ f "...destructive type search: { len ( pkgs ) } packages already found"
142142 )
143143 pkgs , _deprecated = self ._destructive (
144144 package_names , exclude , pkgs , installed_included
@@ -147,21 +147,21 @@ def findDistfiles(
147147 # use the same structure as invalid binpkgs for list_pkgs()
148148 deprecated .update ({_distdir : _deprecated })
149149 # gather the files to be cleaned
150- self .output ("...checking limits for %d ebuild sources" % len ( pkgs ) )
150+ self .output (f "...checking limits for { len ( pkgs ) } ebuild sources" )
151151
152152 vcs = self .vcs_check (Path (_distdir ))
153153 checks = self ._get_default_checks (size_limit , time_limit , exclude , destructive )
154154 checks .extend (extra_checks )
155155 clean_me = self ._check_limits (_distdir , checks , clean_me )
156156 # remove any protected files from the list
157157 self .output (
158- "...removing protected sources from %s candidates to clean" % len ( clean_me )
158+ f "...removing protected sources from { len ( clean_me ) } candidates to clean"
159159 )
160160 clean_me = self ._remove_protected (pkgs , clean_me )
161161 if not deprecate and len (exclude ) and len (clean_me ):
162162 self .output (
163163 "...checking final for exclusion from "
164- + "%s remaining candidates to clean" % len ( clean_me )
164+ + f" { len ( clean_me ) } remaining candidates to clean"
165165 )
166166 clean_me , saved = self ._check_excludes (exclude , clean_me )
167167 return clean_me , saved , deprecated , vcs
@@ -326,24 +326,22 @@ def _non_destructive(
326326 if fetch_restricted and destructive :
327327 self .output (
328328 " - getting source file names "
329- + "for %d installed ebuilds" % len ( installed_cpvs )
329+ + f "for { len ( installed_cpvs ) } installed ebuilds"
330330 )
331331 pkgs , _deprecated = self ._unrestricted (pkgs , installed_cpvs )
332332 deprecated .update (_deprecated )
333333 # remove the installed cpvs then check the remaining for fetch restiction
334334 cpvs .difference_update (installed_cpvs )
335335 self .output (
336336 " - getting fetch-restricted source file names "
337- + "for %d remaining ebuilds" % len ( cpvs )
337+ + f "for { len ( cpvs ) } remaining ebuilds"
338338 )
339339 pkgs , _deprecated = self ._fetch_restricted (pkgs , cpvs )
340340 deprecated .update (_deprecated )
341341 # save the installed cpv list to re-use in _destructive()
342342 self .installed_cpvs = installed_cpvs .copy ()
343343 else :
344- self .output (
345- " - getting source file names " + "for %d ebuilds" % len (cpvs )
346- )
344+ self .output (" - getting source file names " + f"for { len (cpvs )} ebuilds" )
347345 pkgs , _deprecated = self ._unrestricted (pkgs , cpvs )
348346 deprecated .update (_deprecated )
349347 return pkgs , deprecated
@@ -466,12 +464,12 @@ def _destructive(
466464 pkgset .update (self .vardb .cpv_all ())
467465 else :
468466 pkgset .update (self .installed_cpvs )
469- self .output (" - processing %s installed ebuilds" % len ( pkgset ) )
467+ self .output (f " - processing { len ( pkgset ) } installed ebuilds" )
470468 elif package_names :
471469 # list all CPV's from portree for CP's in vartree
472470 # print( "_destructive: getting vardb.cp_all")
473471 cps = self .vardb .cp_all ()
474- self .output (" - processing %s installed packages" % len ( cps ) )
472+ self .output (f " - processing { len ( cps ) } installed packages" )
475473 for package in cps :
476474 pkgset .update (self .portdb .cp_list (package ))
477475 self .output (" - processing excluded" )
@@ -571,11 +569,11 @@ def _deps_equal(deps_a, eapi_a, deps_b, eapi_b, libc_deps, uselist=None, cpv=Non
571569 deps_b = use_reduce (deps_b , uselist = uselist , eapi = eapi_b , token_class = Atom )
572570 except InvalidDependString as er : # the ebuild depend string is bad
573571 print (
574- pp .warn ("Warning: Invalid ebuild DEPEND String found for: %s" % cpv ),
572+ pp .warn (f "Warning: Invalid ebuild DEPEND String found for: { cpv } " ),
575573 file = sys .stderr ,
576574 )
577575 print (
578- pp .warn ("Warning: DEPEND string for ebuild: %s" % deps_b ),
576+ pp .warn (f "Warning: DEPEND string for ebuild: { deps_b } " ),
579577 file = sys .stderr ,
580578 )
581579 print (er , file = sys .stderr )
@@ -737,7 +735,7 @@ def findPackages(
737735 exit (0 )
738736 print (pp .error ("Error accessing PKGDIR." ), file = sys .stderr )
739737 print (pp .error ("(Check your make.conf file and environment)." ), file = sys .stderr )
740- print (pp .error ("Error: %s" % str ( er ) ), file = sys .stderr )
738+ print (pp .error (f "Error: { er !s } " ), file = sys .stderr )
741739 exit (1 )
742740
743741 libc_deps = find_libc_deps (var_dbapi , False )
0 commit comments