Ignore managed prefs documented as "Deprecated."

Deprecated keys are removed from web/default_preferences.json,
but still maintained in managed_preferences.json.
This commit is contained in:
Rob Wu 2018-02-17 01:09:17 +01:00
parent 94a49fa048
commit 9d55a1edc7

View File

@ -192,6 +192,13 @@ function getVersionJSON() {
function checkChromePreferencesFile(chromePrefsPath, webPrefsPath) {
var chromePrefs = JSON.parse(fs.readFileSync(chromePrefsPath).toString());
var chromePrefsKeys = Object.keys(chromePrefs.properties);
chromePrefsKeys = chromePrefsKeys.filter(function (key) {
var description = chromePrefs.properties[key].description;
// Deprecated keys are allowed in the managed preferences file.
// The code maintained is responsible for adding migration logic to
// extensions/chromium/options/migration.js and web/chromecom.js .
return !description || !description.startsWith('DEPRECATED.');
});
chromePrefsKeys.sort();
var webPrefs = JSON.parse(fs.readFileSync(webPrefsPath).toString());
var webPrefsKeys = Object.keys(webPrefs);