summaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-18 14:01:51 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-18 14:01:51 -0700
commit37248900e9aa3d9f82deed7ea006015403544bf2 (patch)
tree685efc4ff2422f26382403661d105b5a95ca160d /.bashrc
parent7d3bf9846b4e9c90d37822b7e35cd5eaf2b56f19 (diff)
downloaddotfiles-37248900e9aa3d9f82deed7ea006015403544bf2.tar.gz
pure bash 'dak' shell function
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc25
1 files changed, 21 insertions, 4 deletions
diff --git a/.bashrc b/.bashrc
index 65bd2730..82013853 100644
--- a/.bashrc
+++ b/.bashrc
@@ -80,10 +80,6 @@ alias test-package-plan="cabal --no-require-sandbox update \
# Useful for sbuilding an unreleased version of a package I maintain
# upstream
alias sbuild-prerelease="sbuild --dpkg-source-opts='-Zgzip -z1 --format=1.0 -sn'"
-# this is useful for processing removal requests
-command -v dak >/dev/null \
- || alias dak="perl -MString::ShellQuote \
- -we'system qw(ssh -t ftp-master.debian.org dak), shell_quote @ARGV'"
# alias develacc='sudo machinectl shell spw@develacc \
# $(sudo enter-develacc /bin/sh -c "getent passwd spw | cut -d: -f7")'
@@ -299,3 +295,24 @@ if [ -d "/srv/ftp-master.debian.org" ]; then
fi
}
fi
+
+# not ftp-master.debian.org
+
+# this is useful for processing removal requests
+# (credits to Mark Wooding)
+#
+# alternative, by me, but involves spawning another process or two:
+#
+# command -v dak >/dev/null \
+# || alias dak="perl -MString::ShellQuote \
+# -we'system qw(ssh -t ftp-master.debian.org dak), shell_quote @ARGV'"
+if ! command -v dak >/dev/null; then
+ dak () {
+ local i
+ local c=
+ for i; do # implicit "in $@"
+ c="$c '${i/\'/\'\\\'\'}'"
+ done
+ ssh -t ftp-master.debian.org dak "$c"
+ }
+fi