summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2013-11-16 16:46:37 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2013-11-24 17:45:26 +0000
commit3f109a333aa0186c183641312e36f34066dab9e2 (patch)
tree7f93f3df04883805068699511788ac13ad2a019b
parent5e025d9f8516ca8ba4786613c9693d51d99f9181 (diff)
Provide "test-dummy" distro with "dummycat" access method.
-rw-r--r--debian/changelog8
-rwxr-xr-xdgit53
2 files changed, 59 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index a1baad2..5a543d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,15 @@
+dgit (0.19~experimental1) experimental; urgency=low
+
+ Testing facilities:
+ * Provide "test-dummy" distro with "dummycat" access method.
+
+ --
+
dgit (0.18.2) unstable; urgency=high
Bump archive upload urgency to high.
-- Ian Jackson <ijackson@chiark.greenend.org.uk> Sun, 24 Nov 2013 17:42:57 +0000
-
dgit (0.18.1) unstable; urgency=low
Bugfixes:
diff --git a/dgit b/dgit
index 0f372f2..7030504 100755
--- a/dgit
+++ b/dgit
@@ -441,6 +441,8 @@ sub cmd_help () {
exit 0;
}
+our $td = $ENV{DGIT_TEST_DUMMY_DIR} || "DGIT_TEST_DUMMY_DIR-unset";
+
our %defcfg = ('dgit.default.distro' => 'debian',
'dgit.default.username' => '',
'dgit.default.archive-query-default-component' => 'main',
@@ -453,7 +455,17 @@ our %defcfg = ('dgit.default.distro' => 'debian',
'dgit-distro.debian.sshpsql-host' => 'coccia.debian.org',
'dgit-distro.debian.sshpsql-dbname' => 'service=projectb',
'dgit-distro.debian.upload-host' => 'ftp-master', # for dput
- 'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/');
+ 'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/',
+ 'dgit-distro.test-dummy.ssh' => "$td/ssh",
+ 'dgit-distro.test-dummy.username' => "alice",
+ 'dgit-distro.test-dummy.git-check' => "ssh-cmd",
+ 'dgit-distro.test-dummy.git-create' => "ssh-cmd",
+ 'dgit-distro.test-dummy.git-url' => "$td/git",
+ 'dgit-distro.test-dummy.git-host' => "git",
+ 'dgit-distro.test-dummy.git-path' => "$td/git",
+ 'dgit-distro.test-dummy.archive-query' => "dummycat:$td/aq",
+ 'dgit-distro.test-dummy.mirror' => "file://$td/mirror/",
+ );
sub cfg {
foreach my $c (@_) {
@@ -715,6 +727,45 @@ END
return $rows[0];
}
+sub canonicalise_suite_dummycat ($$) {
+ my ($proto,$data) = @_;
+ my $dpath = "$data/suite.$isuite";
+ if (!open C, "<", $dpath) {
+ $!==ENOENT or die "$dpath: $!";
+ printdebug "dummycat canonicalise_suite $isuite $dpath ENOENT\n";
+ return $isuite;
+ }
+ $!=0; $_ = <C>;
+ chomp or die "$dpath: $!";
+ close C;
+ printdebug "dummycat canonicalise_suite $isuite $dpath = $_\n";
+ return $_;
+}
+
+sub archive_query_dummycat ($$) {
+ my ($proto,$data) = @_;
+ canonicalise_suite();
+ my $dpath = "$data/package.$csuite.$package";
+ if (!open C, "<", $dpath) {
+ $!==ENOENT or die "$dpath: $!";
+ printdebug "dummycat query $csuite $package $dpath ENOENT\n";
+ return ();
+ }
+ my @rows;
+ while (<C>) {
+ next if m/^\#/;
+ next unless m/\S/;
+ die unless chomp;
+ printdebug "dummycat query $csuite $package $dpath | $_\n";
+ my @row = split /\s+/, $_;
+ @row==2 or die "$dpath: $_ ?";
+ push @rows, \@row;
+ }
+ C->error and die "$dpath: $!";
+ close C;
+ return @rows;
+}
+
sub canonicalise_suite () {
return if defined $csuite;
fail "cannot operate on $isuite suite" if $isuite eq 'UNRELEASED';