aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCliff Brake <cbrake@bec-systems.com>2011-05-19 15:10:50 -0400
committerCliff Brake <cbrake@bec-systems.com>2011-05-19 15:10:50 -0400
commit15dba917e333f330e39495839f9c379ff3fc90d2 (patch)
tree7d3a19242a157865b52fe245366c933727fec385
downloadopenembedded-admin-15dba917e333f330e39495839f9c379ff3fc90d2.tar.gz
openembedded-admin-15dba917e333f330e39495839f9c379ff3fc90d2.tar.bz2
openembedded-admin-15dba917e333f330e39495839f9c379ff3fc90d2.zip
initial commit of admin repos and tools
-rw-r--r--.gitmodules18
-rw-r--r--README13
m---------meta-angstrom0
m---------meta-openembedded0
m---------meta-smartphone0
m---------meta-texasinstruments0
m---------openembedded0
m---------openembedded-core0
-rw-r--r--tools/admin.js8
-rw-r--r--tools/git-weekly-changelog.js83
-rwxr-xr-xtools/weekly-changelog-report.py51
11 files changed, 173 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..bcd2cfc
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,18 @@
+[submodule "openembedded"]
+ path = openembedded
+ url = git://git.openembedded.org/openembedded
+[submodule "openembedded-core"]
+ path = openembedded-core
+ url = git://git.openembedded.org/openembedded-core
+[submodule "meta-openembedded"]
+ path = meta-openembedded
+ url = git://git.openembedded.org/meta-openembedded
+[submodule "meta-angstrom"]
+ path = meta-angstrom
+ url = git://git.angstrom-distribution.org/meta-angstrom
+[submodule "meta-texasinstruments"]
+ path = meta-texasinstruments
+ url = git://git.angstrom-distribution.org/meta-texasinstruments
+[submodule "meta-smartphone"]
+ path = meta-smartphone
+ url = http://git.shr-project.org/repo/meta-smartphone.git
diff --git a/README b/README
new file mode 100644
index 0000000..decc343
--- /dev/null
+++ b/README
@@ -0,0 +1,13 @@
+tools for administering the openembedded projects
+
+to set up:
+ - install node.js (tested with 0.4.5)
+ - install npm (tested with 1.0.3)
+ - cd tools
+ - npm install nodemailer (tested with 0.1.13)
+
+to use:
+ - git submodule foreach "git fetch" (pull down the latest repo data for each project)
+ - node ./tools/git-weekly-changelog.js (email out weekly changelog reports, based on origin/master in each project)
+
+
diff --git a/meta-angstrom b/meta-angstrom
new file mode 160000
+Subproject c25bbe1ab78e5cc4fada32ce87771abe7a2b999
diff --git a/meta-openembedded b/meta-openembedded
new file mode 160000
+Subproject b4e3ff370662a7d1bf6cef89dc8cb5531871dca
diff --git a/meta-smartphone b/meta-smartphone
new file mode 160000
+Subproject ce1877a6d276831f855d0c609a241348d16daa6
diff --git a/meta-texasinstruments b/meta-texasinstruments
new file mode 160000
+Subproject 2ee953b6273fcf06e1fd1a327e35f2c16144879
diff --git a/openembedded b/openembedded
new file mode 160000
+Subproject d768394be933ac231e31197c4d0b65d499c0665
diff --git a/openembedded-core b/openembedded-core
new file mode 160000
+Subproject 2f597ad74d7ed383365dba10e61010e8f82ab6b
diff --git a/tools/admin.js b/tools/admin.js
new file mode 100644
index 0000000..9bbcff2
--- /dev/null
+++ b/tools/admin.js
@@ -0,0 +1,8 @@
+// tools for admin'ing the OE project
+
+
+
+
+
+
+
diff --git a/tools/git-weekly-changelog.js b/tools/git-weekly-changelog.js
new file mode 100644
index 0000000..4084b89
--- /dev/null
+++ b/tools/git-weekly-changelog.js
@@ -0,0 +1,83 @@
+// script to collect the weekly changelog in a git repo
+
+var path = require('path'),
+ child_process = require('child_process'),
+ fs = require('fs'),
+ nodemailer = require('nodemailer');
+
+
+String.prototype.format = function() {
+ var formatted = this;
+ for (var i = 0; i < arguments.length; i++) {
+ var regexp = new RegExp('\\{'+i+'\\}', 'gi');
+ formatted = formatted.replace(regexp, arguments[i]);
+ }
+ return formatted;
+};
+
+var projects = ['meta-angstrom', 'meta-openembedded', 'meta-smartphone', 'meta-texasinstruments', 'openembedded-core', 'openembedded'];
+
+var date_range = function() {
+ var day = 1000*60*60*24;
+ var d = new Date();
+ var today_weekday = d.getDay();
+ var end_day = new Date(d.getTime() - today_weekday*day);
+ var start_day = new Date(end_day.getTime() - 7*day);
+ return "{0}-{1}-{2} to {3}-{4}-{5}".format(start_day.getFullYear(), start_day.getMonth(), start_day.getDate(),
+ end_day.getFullYear(), end_day.getMonth(), end_day.getDate());
+}
+
+var format_report = function(weekly_data) {
+ var ret = ''
+ for (var i=0; i < projects.length; i++) {
+ //console.log(project);
+ ret += "====================================================\n";
+ ret += "Changelog for " + projects[i] + ":\n\n";
+ ret += weekly_data[projects[i]];
+ }
+ return ret;
+}
+
+var email_report = function(report) {
+ nodemailer.send_mail(
+ {
+ sender: "cliff.brake@gmail.com",
+ to: "openembedded-core@lists.openembedded.org, openembedded-devel@lists.openembedded.org, angstrom-distro-devel@linuxtogo.org",
+ bcc: "cbrake@bec-systems.com",
+ subject: "OE Changelog for " + date_range(),
+ body: report
+ },
+ function(error, success) {
+ console.log("Message " + (success?"sent":"failed"));
+ }
+ );
+}
+
+var output = {};
+
+for (var i=0; i < projects.length; i++) {
+ var count = projects.length;
+ // FIXME: might be a better way to create closure for i than creating run_exec
+ var run_exec = function(i) {
+ console.log('processing: ' + path.join(__dirname, '../', projects[i]));
+ process.chdir(path.join(__dirname, '../', projects[i]));
+ child_process.exec('../tools/weekly-changelog-report.py', function(error, stdout, stderr) {
+ console.log('stderr: ' + stderr);
+ if (error !== null) {
+ console.log('exec error: ' + error);
+ } else {
+ output[projects[i]] = stdout;
+ }
+ count--;
+ if (count === 0) {
+ var r = format_report(output);
+ process.chdir(path.join(__dirname, '../'));
+ var f = fs.openSync('weekly-changelog', 'w');
+ fs.writeSync(f, r);
+ fs.closeSync(f);
+ email_report(r);
+ }
+ });
+ }(i);
+}
+
diff --git a/tools/weekly-changelog-report.py b/tools/weekly-changelog-report.py
new file mode 100755
index 0000000..641d4be
--- /dev/null
+++ b/tools/weekly-changelog-report.py
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+
+
+# generates an OE changelog for last weeks activity (Mon-Sun) assuming it is run on
+# any day of the following week
+
+# TODO
+# - remove patch count as it does not match after we remove "Merge branch" statements
+# - add bugzilla info
+
+import datetime
+import os
+import sys
+import string
+
+today = datetime.date.today()
+
+# 0 = Mon, 6 = Sun
+today_weekday = today.weekday()
+
+# find Mon of this week
+end_day = today - datetime.timedelta(today_weekday)
+
+start_day = end_day - datetime.timedelta(7)
+
+if (len(sys.argv) <= 1):
+ branch = "origin/master"
+else:
+ branch = sys.argv[1]
+
+branch_pretty = string.replace(branch, "origin/", "")
+
+#print "OE weekly changelog for %s, %s to %s\n" % (branch_pretty, start_day.isoformat(), end_day.isoformat())
+os.system("git shortlog --since=%s --until=%s %s | grep -v 'Merge branch' | grep -v 'Merge commit'|sed -e 's/^ //g'|cut -b -78 " % (start_day.isoformat(), end_day.isoformat(), branch))
+
+sys.exit(0)
+
+os.system("wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bugidtype=include&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&known_name=1WFixed&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=RESOLVED%2CVERIFIED%2CCLOSED&value0-0-0=&ctype=csv' -O resolved-bugs.csv >& /dev/null")
+os.system("wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=NEW&bugidtype=include&chfield=%5BBug%20creation%5D&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=NEW&value0-0-0=&ctype=csv' -O new-bugs.csv &> /dev/null")
+
+
+print "====================================================="
+print "Bugs fixed:\n"
+
+os.system("cat resolved-bugs.csv | awk -F, '{print $1 \" \" $7 \"\t \" $8}' | sed s:\\\"::g")
+
+print "\nBugs opened:\n"
+
+os.system("cat new-bugs.csv | awk -F, '{print $1 \" \" $7 \"\t \" $8}' | sed s:\\\"::g")
+
+