[Debian-in-commits] [SCM] Git repository for debian-in branch, master, updated. 14c88a360e5299680342b840155fef64fb3fd28e

Vasudev Kamath kamathvasudev at gmail.com
Sat Sep 29 17:35:09 UTC 2012


The following commit has been merged in the master branch:
commit 2934bf5e15cfb240b67525407aa8c6b1d7c85efc
Author: Vasudev Kamath <kamathvasudev at gmail.com>
Date:   Sat Sep 29 23:02:14 2012 +0530

    Added sample post-receive hook, kgb-client.conf and scripts
    
    Modified pkg-perl's post receive hook for sending notifications to KGB this
    should go into all repository

diff --git a/docs/debian-in-post-receive b/docs/debian-in-post-receive
new file mode 100755
index 0000000..a38bc72
--- /dev/null
+++ b/docs/debian-in-post-receive
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+BASE=/home/groups/debian-in
+
+KGB=/home/groups/kgb/trunk
+CONF=$BASE/kgb-client.conf
+DIR=`basename $(readlink -f $GIT_DIR)`
+PKG=${DIR%.git}
+
+cat > hooks/reflog
+
+if [ -e $BASE/KGB-notifications-disabled ]; then
+    echo "KGB notifications disabled"
+else
+    cat hooks/reflog | \
+    PERL5LIB=$KGB/lib $KGB/script/kgb-client --conf $CONF \
+            --repository git --git-reflog - --module $PKG
+fi
+
+cat hooks/reflog | grep -v /tags/ |
+    while read old new; do
+        rev_spec="$old..$new"
+        if echo $old | egrep -q '^0\+$' ; then
+            rev_spec=$new
+        fi
+        for r in `git rev-list $rev_spec`; do
+            $BASE/scripts/git-tag-pending-bugs $GIT_DIR $r;
+        done
+    done
+
+#/home/groups/pet/PET2/pkg-perl/pet-git-helper.pkg-perl-packages update $DIR
+
+# send announce to the mailing list
+cat hooks/reflog | grep -v refs/heads/upstream | /usr/local/bin/git-commit-notice
diff --git a/docs/git-tag-pending-bugs b/docs/git-tag-pending-bugs
new file mode 100755
index 0000000..29595b4
--- /dev/null
+++ b/docs/git-tag-pending-bugs
@@ -0,0 +1,118 @@
+#!/usr/bin/perl -w
+
+# Find bugs closed by this commit and tag them pending in the BTS
+#
+# Synopsis: $0 repos_path revision
+#
+# Copyright © 2008, 2011 Damyan Ivanov <dmn at debian.org>
+#
+# This program is free software. You may distribute it under
+# the terms of Perl
+
+use strict;
+use Cwd qw(realpath);
+use File::Basename qw(basename);
+use Getopt::Long;
+use Git;
+use Mail::Send;
+use Sys::Hostname::Long;
+use Text::Wrap qw(wrap);
+
+use constant FROM	=> 'debian-in-workers at lists.alioth.debian.org';
+
+our $opt_debug;
+
+GetOptions( 'debug!' => \$opt_debug )
+    or exit 1;
+
+my( $repo_path, $revision ) = @ARGV;
+
+my $git = Git->repository($repo_path);
+my ( $package, $author, $log );
+
+$package = basename(realpath($repo_path));
+$package =~ s/\.git$//;
+
+for my $line ( $git->command( show => '--format=medium' => $revision ) ) {
+    if ( defined($log) ) {
+        last if $line =~ /^diff/;
+        $log .= "\n" if $log ne '';
+        $log .= $line;
+        next;
+    }
+
+    $log = '', next if $line eq '';
+
+    $author = $1 if $line =~ /^Author: (.+) </;
+}
+
+my $branch = $git->command_oneline( branch => '--contains', $revision );
+
+$branch =~ s/^\* //;
+
+my @bugs;
+my $log_copy = $log;
+while( $log_copy =~ s/(closes:\s*(?:bug)?\#\s*\d+(?:,\s*(?:bug)?\#\s*\d+)*)//is )
+{
+  my $match = $1;
+  push @bugs, $1 while $match =~ s/#(\d+)//;
+}
+
+exit unless @bugs;
+
+my $msg = Mail::Send->new(
+  Subject=>"Pending fixes for bugs in the $package package",
+  Bcc	=> 'control at bugs.debian.org',
+);
+$msg->add('From', FROM);
+$msg->add('X-Mailer', (basename $0).' running on '.hostname_long);
+$msg->add('X-Debbugs-No-Ack', 'please');
+$msg->add('X-Git-Repository', $repo_path);
+$msg->add('X-Debian', (basename $0));
+$msg->add('X-Debian-Package', $package);
+$msg->add('MIME-Version', '1.0');
+$msg->add('Content-Type', 'text/plain; charset=utf-8');     
+$msg->add('Content-Transfer-Encoding', '8bit');
+
+$msg->to(
+    join(
+        ', ',
+        map(
+            ("$_\@bugs.debian.org", "$_-submitter\@bugs.debian.org"),
+            @bugs )
+    )
+);
+
+my $out;
+
+if ( $opt_debug ) {
+    $out = $msg->open('testfile');
+}
+else {
+    $out = $msg->open();
+}
+$Text::Wrap::columns = 70;
+$Text::Wrap::huge = 'overflow';
+
+$out->print("tag $_ + pending\n") foreach @bugs;
+$out->print("thanks\n\n");
+$out->print(
+    wrap(
+        '',
+        '',
+        "Some bugs in the $package package are closed "
+            . "in revision $revision in branch '$branch' by $author"
+    ),
+    "\n\n"
+);
+$out->print(
+    wrap(
+        '',
+        '',
+        "The full diff can be seen at http://anonscm.debian.org/gitweb/?p=debian-in/$package.git;a=commitdiff;h="
+            . substr( $revision, 0, 7 )
+    ),
+    "\n\n"
+);
+$out->print("Commit message:\n\n$log\n");
+$out->close;
diff --git a/docs/kgb-client.conf b/docs/kgb-client.conf
new file mode 100644
index 0000000..992017c
--- /dev/null
+++ b/docs/kgb-client.conf
@@ -0,0 +1,10 @@
+---
+repo-id: 'debian-in'
+password: Rihucpygduc4
+servers:
+# dam, KGB-0
+- uri: http://dam.homelinux.net:9418/
+# gregoa, KGB-2
+- uri: http://colleen.colgarra.priv.at:8080/
+# Tincho, KGB-1
+- uri: http://abhean.mine.nu:9418/
\ No newline at end of file

-- 
Git repository for debian-in



More information about the Debian-in-commits mailing list