chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
using-these: New script to help with ad-hoc testing
[dgit.git]
/
Debian
/
Dgit.pm
diff --git
a/Debian/Dgit.pm
b/Debian/Dgit.pm
index 314bd8c712c6159fe031bfe8073a62f902666f84..ba1c28801aba0acb77fced48bb8966a878dc8973 100644
(file)
--- a/
Debian/Dgit.pm
+++ b/
Debian/Dgit.pm
@@
-36,7
+36,7
@@
BEGIN {
$VERSION = 1.00;
@ISA = qw(Exporter);
$VERSION = 1.00;
@ISA = qw(Exporter);
- @EXPORT = qw(setup_sigwarn
+ @EXPORT = qw(setup_sigwarn
forkcheck_setup forkcheck_mainprocess
dep14_version_mangle
debiantags debiantag_old debiantag_new
server_branch server_ref
dep14_version_mangle
debiantags debiantag_old debiantag_new
server_branch server_ref
@@
-50,6
+50,7
@@
BEGIN {
git_get_ref git_for_each_ref
git_for_each_tag_referring is_fast_fwd
$package_re $component_re $deliberately_re
git_get_ref git_for_each_ref
git_for_each_tag_referring is_fast_fwd
$package_re $component_re $deliberately_re
+ $distro_re $versiontag_re
$branchprefix
initdebug enabledebug enabledebuglevel
printdebug debugcmd
$branchprefix
initdebug enabledebug enabledebuglevel
printdebug debugcmd
@@
-65,6
+66,8
@@
our @EXPORT_OK;
our $package_re = '[0-9a-z][-+.0-9a-z]*';
our $component_re = '[0-9a-zA-Z][-+.0-9a-zA-Z]*';
our $deliberately_re = "(?:TEST-)?$package_re";
our $package_re = '[0-9a-z][-+.0-9a-z]*';
our $component_re = '[0-9a-zA-Z][-+.0-9a-zA-Z]*';
our $deliberately_re = "(?:TEST-)?$package_re";
+our $distro_re = $component_re;
+our $versiontag_re = qr{[-+.\%_0-9a-zA-Z/]+};
our $branchprefix = 'dgit';
# policy hook exit status bits
our $branchprefix = 'dgit';
# policy hook exit status bits
@@
-78,10
+81,21
@@
sub NOCOMMITCHECK () { return 0x8; }
our $debugprefix;
our $debuglevel = 0;
our $debugprefix;
our $debuglevel = 0;
+our $forkcheck_mainprocess;
+
+sub forkcheck_setup () {
+ $forkcheck_mainprocess = $$;
+}
+
+sub forkcheck_mainprocess () {
+ # You must have called forkcheck_setup or setup_sigwarn already
+ getppid != $forkcheck_mainprocess;
+}
+
sub setup_sigwarn () {
sub setup_sigwarn () {
-
our $sigwarn_mainprocess = $$
;
+
forkcheck_setup()
;
$SIG{__WARN__} = sub {
$SIG{__WARN__} = sub {
- die $_[0]
unless getppid == $sigwarn
_mainprocess;
+ die $_[0]
if forkcheck
_mainprocess;
};
}
};
}
@@
-123,6
+137,7
@@
sub messagequote ($) {
sub shellquote {
my @out;
local $_;
sub shellquote {
my @out;
local $_;
+ defined or confess 'internal error' foreach @_;
foreach my $a (@_) {
$_ = $a;
if (!length || m{[^-=_./:0-9a-z]}i) {
foreach my $a (@_) {
$_ = $a;
if (!length || m{[^-=_./:0-9a-z]}i) {
@@
-311,6
+326,7
@@
sub git_rev_parse ($) {
sub git_cat_file ($) {
my ($objname) = @_;
# => ($type, $data) or ('missing', undef)
sub git_cat_file ($) {
my ($objname) = @_;
# => ($type, $data) or ('missing', undef)
+ # in scalar context, just the data
our ($gcf_pid, $gcf_i, $gcf_o);
if (!$gcf_pid) {
my @cmd = qw(git cat-file --batch);
our ($gcf_pid, $gcf_i, $gcf_o);
if (!$gcf_pid) {
my @cmd = qw(git cat-file --batch);