summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2017-12-04 22:14:45 +0200
committerKevin Mitchell <kevmitch@gmail.com>2017-12-05 23:53:19 -0800
commit04d7bd6a19011c23939f8fec1a1839dd0a1d119f (patch)
tree045dc927dd2f9e86d7b3228059ce5220c3acc2da
parentdb21368c91ce789acab5fa0edd21c2c30525dbf3 (diff)
downloadmpv-build-04d7bd6a19011c23939f8fec1a1839dd0a1d119f.tar.bz2
mpv-build-04d7bd6a19011c23939f8fec1a1839dd0a1d119f.tar.xz
add use-<proj>-custom FOO for any commit/branch/tag
While it was possible before to build any branch of mpv/ffmpeg/etc by just git checkout $whatever and then ./build, it got reset after ./rebuild or ./update etc. Add use-mpv-custom and use-ffmpeg-custom which accept any commit/branch/tag which will survive ./rebuild, ./update, etc. This should make it slightly easier to build past versions of mpv. While at it, also add use-libass-{master|custom}
-rw-r--r--README.rst9
-rwxr-xr-xupdate15
-rwxr-xr-xuse-ffmpeg-custom10
-rwxr-xr-xuse-libass-custom10
-rwxr-xr-xuse-libass-master5
-rwxr-xr-xuse-mpv-custom10
6 files changed, 51 insertions, 8 deletions
diff --git a/README.rst b/README.rst
index 8a70fc0..d1aa4e7 100644
--- a/README.rst
+++ b/README.rst
@@ -181,8 +181,13 @@ And run ``./rebuild`` or similar. Use this to switch back to git master:
./use-mpv-master
-Likewise, you can use ``./use-ffmpeg-master`` and ``./use-ffmpeg-release`` to
-switch between git master and the latest FFmpeg release.
+Or this to switch to a custom tag/branch/commit FOO:
+
+ ./use-mpv-custom FOO
+
+Likewise, you can use ``./use-ffmpeg-master``, ``./use-ffmpeg-release`` or
+``./use-ffmpeg-custom BAR`` to switch between git master, the latest FFmpeg
+release, or to a custom tag/branch/commit BAR.
Use on your own risk.
diff --git a/update b/update
index d966018..dfe16f8 100755
--- a/update
+++ b/update
@@ -65,21 +65,24 @@ do_fixedref()
)
}
-# args: $1: project name, $2: release/master [,$3: non-empty to ignore the config file]
+# args: $1: project name, $2: release/master/@foo [,$3: non-empty to ignore the config file]
checkout()
{
- local arg="$2"
+ local branch="$2"
if [ -z "$3" ] && [ -d config/ ] && [ -f config/branch-$1 ]; then
- arg="$(cat config/branch-$1)"
+ branch="$(cat config/branch-$1)"
fi
- case "$arg" in
+ case "$branch" in
master) do_gitmaster $1;;
- *) do_releasetag $1;;
+ release) do_releasetag $1;;
+ @*) do_fixedref $1 "${branch#@}";; # everything after the '@' prefix
+ *) >&2 printf "%s\n" "Error: Don't know how to checkout '$branch'"
+ return 1
esac
}
-# fallback targets: release/master if no config file
+# fallback targets: release/master/@foo if no config file
checkout_ffmpeg=master
#checkout_fribidi=release
checkout_libass=master
diff --git a/use-ffmpeg-custom b/use-ffmpeg-custom
new file mode 100755
index 0000000..025edeb
--- /dev/null
+++ b/use-ffmpeg-custom
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+export LC_ALL=C
+
+if [ -z "$1" ]; then
+ echo "Aborting. Please provide a commit hash or a tag/branch name."
+ exit 1
+fi
+
+scripts/switch-branch ffmpeg "@$1"
diff --git a/use-libass-custom b/use-libass-custom
new file mode 100755
index 0000000..6bc2475
--- /dev/null
+++ b/use-libass-custom
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+export LC_ALL=C
+
+if [ -z "$1" ]; then
+ echo "Aborting. Please provide a commit hash or a tag/branch name."
+ exit 1
+fi
+
+scripts/switch-branch libass "@$1"
diff --git a/use-libass-master b/use-libass-master
new file mode 100755
index 0000000..f645acb
--- /dev/null
+++ b/use-libass-master
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+export LC_ALL=C
+
+scripts/switch-branch libass master
diff --git a/use-mpv-custom b/use-mpv-custom
new file mode 100755
index 0000000..cea8d10
--- /dev/null
+++ b/use-mpv-custom
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+export LC_ALL=C
+
+if [ -z "$1" ]; then
+ echo "Aborting. Please provide a commit hash or a tag/branch name."
+ exit 1
+fi
+
+scripts/switch-branch mpv "@$1"