summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2018-05-20 22:05:44 -0700
committerMartin Herkt <652892+lachs0r@users.noreply.github.com>2018-05-21 08:40:40 +0200
commit902c441e6967b96fd883244603e9f09791965d4f (patch)
tree19d671529ee77a81efdacb89e10556c6d2acf897 /scripts
parent8c9abd8c7914b71562e2d81faad76015526a9f8e (diff)
downloadmpv-build-902c441e6967b96fd883244603e9f09791965d4f.tar.bz2
mpv-build-902c441e6967b96fd883244603e9f09791965d4f.tar.xz
Revert "Remove Debian scripts"
This reverts commit 8c9abd8c7914b71562e2d81faad76015526a9f8e. I'm restoring them, bugs will be my own responsibility.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/debian-update-versions23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/debian-update-versions b/scripts/debian-update-versions
new file mode 100755
index 0000000..af59632
--- /dev/null
+++ b/scripts/debian-update-versions
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+get_version()
+{
+ (
+ cd $1 > /dev/null
+ VERSION=1:$(git name-rev --name-only --tags HEAD | sed -e 's/^[^0-9]*//' -e 's/\^0$//')
+ if [ "$VERSION" = "1:" ]; then
+ TIMESTAMP=$(git log -1 --date=short --format=%cd | sed 's/-/./g')
+ COMMIT=$(git rev-parse --short HEAD)
+ VERSION="2:${TIMESTAMP}.${COMMIT}"
+ fi
+ echo ${VERSION}
+ )
+}
+
+do_subst() {
+ sed -e "0,/^mpv (.*)/s/(.*)/($1)/" \
+ -e "s/^ \* local build.*/ \* local build with ffmpeg $2, libass $3/" \
+ -e"s/\(^ -- Local User <localuser@localhost>\).*/\1 $(date -R)/" debian/changelog.TEMPLATE > debian/changelog
+}
+
+do_subst $(get_version mpv) $(get_version ffmpeg) $(get_version libass)