Merge remote-tracking branch 'ni/master'

This commit is contained in:
lassulus 2020-03-17 21:04:36 +01:00
commit c2685109c0
3 changed files with 20 additions and 14 deletions

View File

@ -24,7 +24,12 @@ pkgs.writeDashBin "irc-announce" ''
# echo2 and cat2 are used output to both, stdout and stderr # echo2 and cat2 are used output to both, stdout and stderr
# This is used to see what we send to the irc server. (debug output) # This is used to see what we send to the irc server. (debug output)
echo2() { echo "$*"; echo "$*" >&2; } echo2() { echo "$*"; echo "$*" >&2; }
cat2() { (read x ; echo "$x" ; echo "$x" >&2) } cat2() {
while read -r line; do
echo "$line"
echo "$line" >&2
done
}
# privmsg_cat transforms stdin to a privmsg # privmsg_cat transforms stdin to a privmsg
privmsg_cat() { awk '{ print "PRIVMSG "ENVIRON["IRC_CHANNEL"]" :"$0 }'; } privmsg_cat() { awk '{ print "PRIVMSG "ENVIRON["IRC_CHANNEL"]" :"$0 }'; }

View File

@ -31,18 +31,19 @@
}; };
}; };
stockholm.file = toString ../.; stockholm.file = toString ../.;
stockholm-version.pipe = toString (pkgs.writeDash "${name}-version" '' stockholm-version.pipe =
set -efu toString (pkgs.writers.writeDash "${name}-version" ''
cd ${lib.escapeShellArg stockholm.file} set -efu
V=$(${pkgs.coreutils}/bin/date +%y.%m) cd ${lib.escapeShellArg stockholm.file}
if test -d .git; then V=$(${pkgs.coreutils}/bin/date +%y.%m)
V=$V.git.$(${pkgs.git}/bin/git describe --always --dirty) if test -d .git; then
case $V in (*-dirty) V=$V.git.$(${pkgs.git}/bin/git describe --always --dirty)
V=$V@''${HOSTNAME-$(${pkgs.nettools}/bin/hostname)} case $V in (*-dirty)
esac V=$V@''${HOSTNAME-$(${pkgs.nettools}/bin/hostname)}
fi esac
printf %s "$V" fi
''); printf %s "$V"
'');
}; };
source ={ test }: lib.evalSource [ source ={ test }: lib.evalSource [

@ -1 +1 @@
Subproject commit f1b7112ac3cbe090e96f2c82c525b6db69b82034 Subproject commit ed9fc6658226b1525bc008205d76276f0054c6c5