-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkgdb.js
37 lines (28 loc) · 951 Bytes
/
pkgdb.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var request = require('sync-request')
module.exports = function pkgdb(package_name, package_json){
return getDistGitBranches(package_name)
};
getDistGitBranches = function(package_name) {
var result = [];
var requestresult = getPackageInfo(package_name);
if (requestresult['packages']){
for (var attributename in requestresult['packages']) {
result.push(requestresult['packages'][attributename]['collection']['branchname']);
}
}else{
result.push('NONE')
}
return result;
};
getKojiBulds = function(package_name) {};
getPackageInfo = function(package_name) {
try {
res = request('GET', 'https://admin.fedoraproject.org/pkgdb/api/package/?pkgname=nodejs-'+ package_name)
return requestresult = JSON.parse(res.getBody());
} catch (err) {
return false
}
};
getModuleSources = function(package_name) {};
generateSpecFile = function(package_name) {};
buildRpm = function(package_name) {};