From c794c6169960fd6d625ec2eb292f4136ec276f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Wed, 15 May 2019 14:01:51 +0200 Subject: [PATCH] Don't rewrite the rewrite script itself, more robust script --- rewrite-local-opam-repository.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/rewrite-local-opam-repository.sh b/rewrite-local-opam-repository.sh index ef2fcf0af..dc11b55de 100755 --- a/rewrite-local-opam-repository.sh +++ b/rewrite-local-opam-repository.sh @@ -1,8 +1,11 @@ #!/bin/bash set -euET -o pipefail -root_dir="$(pwd | sed -e 's/\\/\\\\/' | sed -e 's/&/\\\&/' | sed -e 's/~/\\~/')" -cd vendors/ligo-opam-repository -git grep -z -l src: | xargs -0 \ - sed -i -e 's~src: "https://gitlab.com/gabriel.alfour/ligo/-/archive/master/ligo.tar.gz"~src: "git+file://'"$root_dir"'"~' \ - -e 's~src: "https://gitlab.com/gabriel.alfour/ligo-utils/-/archive/master/ligo-utils.tar.gz"~src: "git+file://'"$root_dir"'/vendors/ligo-utils"~' \ - -e 's~src: "https://gitlab.com/gabriel.alfour/tezos-modded/-/archive/master/tezos-modded.tar.gz"~src: "git+file://'"$root_dir"'/vendors/tezos-modded"~' +main(){ + root_dir="$(pwd | sed -e 's/\\/\\\\/' | sed -e 's/&/\\\&/' | sed -e 's/~/\\~/')" + cd vendors/ligo-opam-repository + git grep -z -l src: | grep -z 'opam$' | xargs -0 \ + sed -i -e 's~src: *"https://gitlab.com/gabriel.alfour/ligo/-/archive/master/ligo.tar.gz"~src: "file://'"$root_dir"'"~' \ + -e 's~src: *"https://gitlab.com/gabriel.alfour/ligo-utils/-/archive/master/ligo-utils.tar.gz"~src: "file://'"$root_dir"'/vendors/ligo-utils"~' \ + -e 's~src: *"https://gitlab.com/gabriel.alfour/tezos-modded/-/archive/master/tezos-modded.tar.gz"~src: "file://'"$root_dir"'/vendors/tezos-modded"~' +} +if main; then exit 0; else exit $?; fi