pkg_uninstaller
pkg_uninstaller copied to clipboard
文件多时效率太差
xquartz一万多个文件,要进行一万多次pkgutil --file-info查询,效率太差了,有没有高效方法? 比如 if [ -f _file ] ; then rm -f _file; else pkgutil --file-info {} ... ... fi
Translation:
-
Issue name: Inefficiency when dealing with too many files
-
Content
With more than 10 thousand files in xquartz, so many lines of "pkgutil --file-info" is needed, this can be really inefficient. Is there a better way to do it?
e.g.
if [ -f _file ] ; then
rm -f _file;
else
pkgutil --file-info {}
...
...
fi
(P.S. I personally don't really understand the point here... )
翻译:
- 问题名称: 处理太多文件时效率低下
- 内容
在xquartz中有超过1万个文件,需要这么多行“pkgutil --file-info”,这可能 效率很低。有没有更好的方法呢?
例如
if [ -f _file ] ; then rm -f _file; else pkgutil --file-info {} ... ... fi
(PS我个人真的不明白这一点......)
Pkgutil --file-info is faster when there are fewer files in the package. But when the number of files in the package reaches a certain number, for example, the xquartz package, the pkguitl --files output shows more than 15,000 files.
This will perform 15,000 times of pkguitls --file-info query
I think the pkgid of the directory may belong to multiple packages, but the pkgid of the file should belong to only one package.
So can you judge the direct deletion of the file in the pkgutil --files list without the --file-info query?
Hey, sorry for late answer, I'm not actively on OSX anymore, I'm open for maintainers, or singular PR's, will do my best to review fixes and help maintain the tool.