about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/mail/postfix/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/mail/postfix/update.sh')
-rwxr-xr-xnixpkgs/pkgs/servers/mail/postfix/update.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/mail/postfix/update.sh b/nixpkgs/pkgs/servers/mail/postfix/update.sh
new file mode 100755
index 000000000000..eacb548bc002
--- /dev/null
+++ b/nixpkgs/pkgs/servers/mail/postfix/update.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl pcre common-updater-scripts
+
+set -eu -o pipefail
+
+# Expect the text in format of '<a href="official/postfix-3.7.4.tar.gz">Source code</a> |'
+# Stable release goes first.
+new_version="$(curl -s http://cdn.postfix.johnriley.me/mirrors/postfix-release/index.html |
+    pcregrep -o1 '"official/postfix-([0-9.]+)[.]tar[.]gz">' | head -n1)"
+update-source-version postfix "$new_version"