hhurley
Version:
Tool to find lost security patches for Linux distributions.
32 lines (17 loc) • 644 B
JavaScript
/*
Copyright IBM Research Emergent Solutions
Jesús Pérez <jesusprubio@gmail.com>
This code may only be used under the MIT license found at
https://opensource.org/licenses/MIT.
*/
;
const utils = require('../utils');
const substrs = ['git.kernel.org', ';a=commit;'];
// TODO: Repeated in "githubcom.js" -> abstract.
module.exports.match = str => utils.every(substrs, (substr) => {
const pos = str.search(substr);
if (pos !== -1) { return true; }
return false;
});
module.exports.massage = str => str.replace('commit', 'patch');
module.exports.getHash = str => str.split(';')[2].split('=')[1];