Bug 1230060 - Don't fail to read an install manifest containing non-actionable items. r=gps

Future improvements to process_install_manifest's --track option will require
adding data in the tracking dump that uses an install manifest form, and I don't
want e.g. switching branches or bisection to require to clobber in order to do the
right thing, so this change future-proofs the install manifest reader.
This commit is contained in:
Mike Hommey 2015-12-03 16:54:09 +09:00
Родитель 831f8542c7
Коммит 3d1b660fdf
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -85,6 +85,8 @@ class InstallManifest(object):
FIELD_SEPARATOR = '\x1f'
# Negative values are reserved for non-actionable items, that is, metadata
# that doesn't describe files in the destination.
SYMLINK = 1
COPY = 2
REQUIRED_EXISTS = 3
@ -163,8 +165,11 @@ class InstallManifest(object):
silence_missing_directive_warnings=bool(int(warnings)))
continue
raise UnreadableInstallManifest('Unknown record type: %d' %
record_type)
# Don't fail for non-actionable items, allowing
# forward-compatibility with those we will add in the future.
if record_type >= 0:
raise UnreadableInstallManifest('Unknown record type: %d' %
record_type)
def __len__(self):
return len(self._dests)