[FFmpeg-devel] [PATCH] configure: Detect old git domain and optionally update to it
Clément Bœsch
ubitux at gmail.com
Sun Sep 2 09:09:57 CEST 2012
On Sun, Sep 02, 2012 at 03:46:59AM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
> configure | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/configure b/configure
> index 3abe231..ca461e1 100755
> --- a/configure
> +++ b/configure
> @@ -2119,6 +2119,24 @@ else
> die "Out of tree builds are impossible with config.h in source dir."
> fi
>
> +if test -f "$source_path/.git/config" &&
> + git remote -v | grep -i 'origin.*git at git.videolan.org:ffmpeg' > /dev/null ; then
> + echolog "Outdated domain in git config, the official domain for ffmpeg git is since
> +November 2011, source.ffmpeg.org, both the old and the new point to the same
> +repository and server. To update to it press enter or CTRL-C to abort"
> + read tmp
> + git remote set-url origin git at source.ffmpeg.org:ffmpeg
> +fi
> +
> +if test -f "$source_path/.git/config" &&
> + git remote -v | grep -i 'origin.*git://git.videolan.org/ffmpeg' > /dev/null ; then
> + echolog "Outdated domain in git config, the official domain for ffmpeg git is since
> +November 2011, source.ffmpeg.org, both the old and the new point to the same
> +repository and server. To update to it press enter or CTRL-C to abort"
> + read tmp
> + git remote set-url origin git://source.ffmpeg.org/ffmpeg
> +fi
> +
> for v in "$@"; do
> r=${v#*=}
> l=${v%"$r"}
This is causing problems for people using something else than "origin" (to
prevent bad push). I think something like this would be more appropriate:
fix_ffmpeg_remote(){
remote_from=$1
remote_to=$2
fixme_remote=$(git remote -v | grep $remote_from | cut -f 1 | sort | uniq)
if [ "$fixme_remote" != "" ]; then
echolog "fix bad remotes: $fixme_remote ? [FIXME msg]"
read tmp
for remote in $fixme_remote; do
echolog "$remote: $remote_from -> $remote_to"
git remote set-url $remote $remote_to
done
fi
}
if test -f "$source_path/.git/config"; then
remote_from=git.videolan.org
remote_to=source.ffmpeg.org
fix_ffmpeg_remote git@$remote_from:ffmpeg git@$remote_to:ffmpeg
fix_ffmpeg_remote git://$remote_from/ffmpeg git://$remote_to/ffmpeg
fi
[...]
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120902/2aed736e/attachment.asc>
More information about the ffmpeg-devel
mailing list