chiark
/
gitweb
/
~ian
/
chiark-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dc09ff6
)
git-cache-proxy: new "utility functions" section, nfc
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 10 Nov 2013 00:39:03 +0000
(
00:39
+0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 10 Nov 2013 00:39:03 +0000
(
00:39
+0000)
scripts/git-cache-proxy
patch
|
blob
|
history
diff --git
a/scripts/git-cache-proxy
b/scripts/git-cache-proxy
index 4b83ebac754dab7855435cfb60ef8f5ff407f187..520f1e5f28c8cbdf9a2cb0a4406f5d386f974a6e 100755
(executable)
--- a/
scripts/git-cache-proxy
+++ b/
scripts/git-cache-proxy
@@
-155,13
+155,7
@@
for (;;) {
!@ARGV or fail "bad usage: no non-option arguments permitted";
!@ARGV or fail "bad usage: no non-option arguments permitted";
-#---------- main program ----------
-
-chdir $cachedir or fail "chdir $cachedir: $!";
-
-our ($service,$specpath,$spechost,$subdir);
-our ($tmpd,$gitd,$lock);
-our ($fetch,$url);
+#---------- utility functions ----------
sub xread {
my $length = shift;
sub xread {
my $length = shift;
@@
-175,6
+169,14
@@
sub xread {
return $buffer;
}
return $buffer;
}
+#---------- main program ----------
+
+chdir $cachedir or fail "chdir $cachedir: $!";
+
+our ($service,$specpath,$spechost,$subdir);
+our ($tmpd,$gitd,$lock);
+our ($fetch,$url);
+
sub servinfo ($) {
my ($msg) = @_;
logm 'info', "service `$specpath': $msg";
sub servinfo ($) {
my ($msg) = @_;
logm 'info', "service `$specpath': $msg";