From 04d7bd6a19011c23939f8fec1a1839dd0a1d119f Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Mon, 4 Dec 2017 22:14:45 +0200 Subject: add use--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} --- README.rst | 9 +++++++-- update | 15 +++++++++------ use-ffmpeg-custom | 10 ++++++++++ use-libass-custom | 10 ++++++++++ use-libass-master | 5 +++++ use-mpv-custom | 10 ++++++++++ 6 files changed, 51 insertions(+), 8 deletions(-) create mode 100755 use-ffmpeg-custom create mode 100755 use-libass-custom create mode 100755 use-libass-master create mode 100755 use-mpv-custom 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" -- cgit v1.2.3