Tolerate nonexistent current dir, https://bugzilla.redhat.com/244835

git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1356 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
Ville Skyttä 2007-06-20 20:32:39 +00:00
parent 3134f0e9b2
commit 22fc68e5fd
1 changed files with 1 additions and 4 deletions

5
Pkg.py
View File

@ -231,10 +231,7 @@ class Pkg:
def getFilesInfo(self):
if self.file_info == None:
self.file_info=[]
olddir = os.getcwd()
os.chdir(self.dirName())
lines = commands.getoutput('find . -type f -print0 | LC_ALL=C xargs -0r file')
os.chdir(olddir)
lines = commands.getoutput('cd %s ; find . -type f -print0 | LC_ALL=C xargs -0r file' % self.dirName())
lines=string.split(lines, '\n')
for l in lines:
#print l