File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 11import glob
2+ import math
23import os
34
45from pathlib import Path
@@ -28,11 +29,20 @@ def make_meta_info():
2829 return DebMetaInfo ()
2930
3031 def generate_control_file (self ):
31- # this key is optional, however it shouldn't be a big deal to calculate the value
32- installed_size = sum (
33- map (
34- os .path .getsize ,
35- glob .glob (str (self .appdir .path ) + "/**" , recursive = True ),
32+ def get_size (path : str | os .PathLike ):
33+ if os .path .islink (path ):
34+ return 0
35+
36+ return os .path .getsize (path )
37+
38+ # this key is optional, however it's not a big deal to calculate the value
39+ # https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-installed-size
40+ installed_size = math .ceil (
41+ sum (
42+ map (
43+ get_size ,
44+ glob .glob (str (self .appdir .path ) + "/**" , recursive = True ),
45+ )
3646 )
3747 / 1024
3848 )
You can’t perform that action at this time.
0 commit comments