summaryrefslogtreecommitdiff
path: root/Debian/Dgit.pm
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-03-21 13:41:06 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-03-22 15:19:51 +0000
commit8afbacc6da4ad5ccaf931d113df175bef22cc7b1 (patch)
tree810a27f66dbdf2a667063bbe3a9be6b8ef395dd9 /Debian/Dgit.pm
parente1adbc736603409551756653090e4455562833af (diff)
Move stat_exists to Dgit.pm
Diffstat (limited to 'Debian/Dgit.pm')
-rw-r--r--Debian/Dgit.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index 211bae3..8b29ba2 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -12,6 +12,7 @@ BEGIN {
$VERSION = 1.00;
@ISA = qw(Exporter);
@EXPORT = qw(debiantag server_branch server_ref
+ stat_exists
$package_re $branchprefix);
%EXPORT_TAGS = ( policyflags => qw() );
@EXPORT_OK = qw();
@@ -43,4 +44,11 @@ sub debiantag ($) {
sub server_branch ($) { return "$branchprefix/$_[0]"; }
sub server_ref ($) { return "refs/".server_branch($_[0]); }
+sub stat_exists ($) {
+ my ($f) = @_;
+ return 1 if stat $f;
+ return 0 if $!==&ENOENT;
+ die "stat $f: $!";
+}
+
1;