Source: perl
Version: 5.14.2-6
Severity: minor

Without this check, a build run from a git repository without git
being available may result in PERL_GIT_UNCOMMITTED_CHANGES being
defined incorrectly.

My workflow was to build directly from the Debian git repository from
a clean sid chroot, which was causing these to be shown up. Now I export
the source directory first, to avoid this problem.

One disadvantage of this patch is that it may mask real changes which
were made in a local repository if built without git available; if this
was deemed problematic, I think we would instead patch out the git
checks in the Debian package entirely.

I was going to send this straight to perlbug, but I thought that it would
be worth disucssing locally because it's such an edge case which has a
bigger impact for most on us -- and because of the problem noted above.

Dominic.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)
>From 91ff081936252c473f60b7e1e202ac36b8e0e76b Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <[email protected]>
Date: Sat, 8 Oct 2011 12:35:09 +0100
Subject: [PATCH] Check that git exists before trying to use it

Without this check, a build run from a git repository without git
being available may result in PERL_GIT_UNCOMMITTED_CHANGES being
defined incorrectly.
---
 make_patchnum.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/make_patchnum.pl b/make_patchnum.pl
index fcbfc6c..a9d9c0c 100644
--- a/make_patchnum.pl
+++ b/make_patchnum.pl
@@ -131,7 +131,7 @@ if (my $patch_file= read_file(".patch")) {
     $extra_info = "git_snapshot_date='$snapshot_created'";
     $commit_title = "Snapshot of:";
 }
-elsif (-d "$srcdir/.git") {
+elsif (-d "$srcdir/.git" && system("git version") == 0) {
     # git branch | awk 'BEGIN{ORS=""} /\*/ { print $2 }'
     ($branch) = map { /\* ([^(]\S*)/ ? $1 : "" } backtick("git branch");
     my ($remote,$merge);
-- 
1.7.5.4

Reply via email to