chiark / gitweb /
Introduce Debian/Dgit.pm
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 15 Feb 2015 18:32:49 +0000 (18:32 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 22 Mar 2015 15:18:52 +0000 (15:18 +0000)
Debian/Dgit.pm [new file with mode: 0644]
dgit
tests/using-intree

diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
new file mode 100644 (file)
index 0000000..2be936b
--- /dev/null
@@ -0,0 +1,27 @@
+#
+
+package Debian::Dgit;
+
+use strict;
+use warnings;
+
+BEGIN {
+    use Exporter   ();
+    our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+
+    $VERSION     = 1.00;
+    @ISA         = qw(Exporter);
+    @EXPORT      = qw(debiantag);
+    %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
+    @EXPORT_OK   = qw();
+}
+
+our @EXPORT_OK;
+
+sub debiantag ($) { 
+    my ($v) = @_;
+    $v =~ y/~:/_%/;
+    return "debian/$v";
+}
+
+1;
diff --git a/dgit b/dgit
index 02ed55d..bd8507c 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -33,6 +33,8 @@ use Digest::SHA;
 use Digest::MD5;
 use Config;
 
+use Debian::Dgit;
+
 our $our_version = 'UNRELEASED'; ###substituted###
 
 our $rpushprotovsn = 2;
@@ -110,11 +112,6 @@ my $lbranch_re = '^refs/heads/'.$branchprefix.'/([^/.]+)$';
 sub lref () { return "refs/heads/".lbranch(); }
 sub lrref () { return "refs/remotes/$remotename/$branchprefix/$csuite"; }
 sub rrref () { return "refs/$branchprefix/$csuite"; }
-sub debiantag ($) { 
-    my ($v) = @_;
-    $v =~ y/~:/_%/;
-    return "debian/$v";
-}
 
 sub stripepoch ($) {
     my ($vsn) = @_;
index f20ec9d..26d5812 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
 set -e
-export DGIT_TEST_INTREE=`pwd`
+pwd=`pwd`
+export DGIT_TEST_INTREE="$pwd" PERLLIB="$pwd${PERLLIB:+:}${PERLLIB}"
 exec "$@"