summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-27 18:23:59 +0100
committerwm4 <wm4@nowhere>2014-10-27 18:23:59 +0100
commita85d34bf9b0570b028533e3f96675fceec49ba86 (patch)
tree5cc32ff3fccd05c117a8e03edb81f0119fe99431
parentb38387044631aa433ae1612efbe9b1ed1e264b51 (diff)
downloadmpv-build-a85d34bf9b0570b028533e3f96675fceec49ba86.tar.bz2
mpv-build-a85d34bf9b0570b028533e3f96675fceec49ba86.tar.xz
Add a simpler way to switch between release and master versions
This remembers the selection, and users are not tricked into accidentally switching back to the release all the time. Don't do this for libass, we always use master. (No reason to use a usually buggy and outdated release.) We don't do it for fribidi either, because fribidi is just in a permanent state of bitrotting and brokenness.
-rw-r--r--.gitignore1
-rw-r--r--README.rst18
-rwxr-xr-xscripts/switch-branch10
-rwxr-xr-xupdate61
-rwxr-xr-xuse-ffmpeg-master4
-rwxr-xr-xuse-ffmpeg-release4
-rwxr-xr-xuse-mpv-master4
-rwxr-xr-xuse-mpv-release4
8 files changed, 78 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 37cb1fb..1b9eedd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ debian/mpv.debhelper.log
debian/mpv.postinst.debhelper
debian/mpv.postrm.debhelper
debian/mpv.substvars
+/config/
diff --git a/README.rst b/README.rst
index 9bf5e33..c40dae8 100644
--- a/README.rst
+++ b/README.rst
@@ -150,18 +150,20 @@ In general, changes to the mpv-build repository itself are relatively safe,
keeping branches in sub-repositories might be ok, and making local, uncommitted
changes in sub-repositories will break.
-Forcing master versions of all parts
-====================================
+Forcing master versions for some parts
+======================================
The following command can be used to delete all local changes, and to checkout
-the current master versions for all parts (libass, ffmpeg, mpv, as well as
-mpv-build itself):
+the current master version for mpv:
- ./update --master
+ ./use-mpv-master
-All local modifications are overwritten (including changes to the scripts),
-and git master versions are checked out. Breakages/bugs are to be expected,
-because these are untested bleeding-edge development versions of the code.
+And run ``./rebuild`` or similar. Use this to switch back to the latest release:
+
+ ./use-mpv-release
+
+Likewise, you can use ``./use-ffmpeg-master`` and ``./use-ffmpeg-release`` to
+switch between git master and the latest FFmpeg release.
Use on your own risk.
diff --git a/scripts/switch-branch b/scripts/switch-branch
new file mode 100755
index 0000000..b2cd407
--- /dev/null
+++ b/scripts/switch-branch
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+mkdir -p config
+
+FILENAME="branch-$1"
+BRANCH="$2"
+echo "$BRANCH" > config/"$FILENAME"
+
+echo "Run ./rebuild to update the source and to compile the selected branch."
diff --git a/update b/update
index 047a08e..d03d7f9 100755
--- a/update
+++ b/update
@@ -31,16 +31,6 @@ do_gitmaster()
)
}
-do_gitmaster_all()
-{
- set -ex
- do_clone_all
- do_gitmaster ffmpeg
- do_gitmaster fribidi
- do_gitmaster libass
- do_gitmaster mpv
-}
-
versort_with_prefix()
{
# Emulate sort -V using a known prefix. Filter out anything else.
@@ -68,16 +58,19 @@ do_fixedref()
)
}
-do_releasetag_all()
+checkout_ffmpeg=do_releasetag
+checkout_fribidi=do_releasetag
+checkout_libass=do_gitmaster
+checkout_mpv=do_releasetag
+
+checkout_all()
{
set -ex
do_clone_all
- do_releasetag ffmpeg 'n'
- do_releasetag fribidi ''
- #do_releasetag libass ''
- #do_fixedref libass refs/tags/0.10.2
- do_gitmaster libass
- do_releasetag mpv 'v'
+ $checkout_ffmpeg ffmpeg 'n'
+ $checkout_fribidi fribidi ''
+ $checkout_libass libass
+ $checkout_mpv mpv 'v'
}
do_bootstrap()
@@ -99,12 +92,38 @@ if [ x"$1" != x"--skip-selfupdate" ]; then
fi
shift
+select_branch()
+{
+ if [ -d config/ ] && [ -f config/"branch-$1" ]; then
+ case `cat config/"branch-$1"` in
+ master)
+ echo do_gitmaster
+ ;;
+ *)
+ # "release" is the defined value; but default anything else to it
+ echo do_releasetag
+ ;;
+ esac
+ else
+ echo "$2"
+ fi
+}
+
+checkout_ffmpeg=`select_branch ffmpeg $checkout_ffmpeg`
+checkout_mpv=`select_branch mpv $checkout_mpv`
+
case "$1" in
--master)
- do_gitmaster_all
+ checkout_ffmpeg=do_gitmaster
+ checkout_fribidi=do_gitmaster
+ checkout_libass=do_gitmaster
+ checkout_mpv=do_gitmaster
+ ;;
+ --release)
+ checkout_ffmpeg=do_releasetag
+ checkout_mpv=do_releasetag
;;
- --release|'')
- do_releasetag_all
+ '')
;;
*)
echo >&2 "$0 --master"
@@ -113,6 +132,8 @@ case "$1" in
;;
esac
+checkout_all
+
do_update_debian_versions $1
do_bootstrap
diff --git a/use-ffmpeg-master b/use-ffmpeg-master
new file mode 100755
index 0000000..af87e19
--- /dev/null
+++ b/use-ffmpeg-master
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+scripts/switch-branch ffmpeg master
diff --git a/use-ffmpeg-release b/use-ffmpeg-release
new file mode 100755
index 0000000..7c2cbb8
--- /dev/null
+++ b/use-ffmpeg-release
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+scripts/switch-branch ffmpeg release
diff --git a/use-mpv-master b/use-mpv-master
new file mode 100755
index 0000000..bcb35be
--- /dev/null
+++ b/use-mpv-master
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+scripts/switch-branch mpv master
diff --git a/use-mpv-release b/use-mpv-release
new file mode 100755
index 0000000..21f48cd
--- /dev/null
+++ b/use-mpv-release
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+scripts/switch-branch mpv release