mirror of
https://github.com/munki/munki.git
synced 2026-04-22 04:28:21 -05:00
Changed getFlatPackageInfo so it looks for a PackageInfo file at the top level of the expanded xar archive. Failing that, it looks for PackageInfo files in embedded sub-packages at the top level of the the expanded xar archive. If that still comes up empty, it tries to get info from the Distribution file at the top level of the expanded xar archive.
git-svn-id: http://munki.googlecode.com/svn/trunk@212 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -481,10 +481,23 @@ def getFlatPackageInfo(pkgpath):
|
||||
packageinfofile = os.path.join(currentdir, "PackageInfo")
|
||||
if os.path.exists(packageinfofile):
|
||||
infoarray = parsePkgRefs(packageinfofile)
|
||||
else:
|
||||
|
||||
if not infoarray:
|
||||
# didn't get any packageid info.
|
||||
# look for subpackages at the top level
|
||||
for item in os.listdir(currentdir):
|
||||
itempath = os.path.join(currentdir, item)
|
||||
if itempath.endswith(".pkg") and os.path.isdir(itempath):
|
||||
packageinfofile = os.path.join(itempath, "PackageInfo")
|
||||
if os.path.exists(packageinfofile):
|
||||
infoarray.extend(parsePkgRefs(packageinfofile))
|
||||
|
||||
if not infoarray:
|
||||
# found no PackageInfo files, so let's look at the Distribution file
|
||||
distributionfile = os.path.join(currentdir, "Distribution")
|
||||
if os.path.exists(distributionfile):
|
||||
infoarray = parsePkgRefs(distributionfile)
|
||||
|
||||
os.chdir("/")
|
||||
shutil.rmtree(pkgtmp)
|
||||
return infoarray
|
||||
|
||||
Reference in New Issue
Block a user