Just return 0 for the size of a symlink.
This commit is contained in:
+2
-5
@@ -25,11 +25,8 @@ exception confusion. These two functions should be a lot simpler.
|
|||||||
* get_file_hashes is overly complex and contains strange code like:
|
* get_file_hashes is overly complex and contains strange code like:
|
||||||
for r, d, f in os.walk(parent, topdown=False): pass
|
for r, d, f in os.walk(parent, topdown=False): pass
|
||||||
|
|
||||||
* dir_size tries to calculate symlink lengths, this is probably not very
|
* To estimate required disk size for the packages more accurately we can
|
||||||
helpful, since in most cases, they fit in the inode, and wont take any
|
calculate package size + (nr of files * inode size of fs).
|
||||||
extra space at all. We can keep the number of file in the index though.
|
|
||||||
That way we can calculate package size + (nr of files * inode size of fs)
|
|
||||||
to give a more correct required disk size.
|
|
||||||
|
|
||||||
* Why in a world like this there exists *parse_package* util functions? These must be all methods of package class
|
* Why in a world like this there exists *parse_package* util functions? These must be all methods of package class
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -296,7 +296,7 @@ def dir_size(dir):
|
|||||||
return getsize(dir)
|
return getsize(dir)
|
||||||
|
|
||||||
if islink(dir):
|
if islink(dir):
|
||||||
return long(len(os.readlink(dir)))
|
return 0
|
||||||
|
|
||||||
def sizes():
|
def sizes():
|
||||||
for root, dirs, files in os.walk(dir):
|
for root, dirs, files in os.walk(dir):
|
||||||
|
|||||||
Reference in New Issue
Block a user