From 009c29ec8c782ae1db00910fbecc1189bbfbab24 Mon Sep 17 00:00:00 2001 From: Jan Moringen Date: Sun, 8 Oct 2017 13:12:09 +0200 Subject: [PATCH] asdf: Adapt pull-asdf.sh --- contrib/asdf/Makefile | 2 -- contrib/asdf/pull-asdf.sh | 88 ++++++++++++++++++++++++++++++----------------- 2 files changed, 57 insertions(+), 33 deletions(-) rewrite contrib/asdf/pull-asdf.sh (86%) diff --git a/contrib/asdf/Makefile b/contrib/asdf/Makefile index 1255463b9..1fd4a3b1b 100644 --- a/contrib/asdf/Makefile +++ b/contrib/asdf/Makefile @@ -23,5 +23,3 @@ test:: $(FASL) UPSTREAM=../../obj/asdf-upstream up:: sh pull-asdf.sh - ln -f $(UPSTREAM)/doc/asdf.texinfo asdf.texinfo - ln -f $(UPSTREAM)/README.md README.md diff --git a/contrib/asdf/pull-asdf.sh b/contrib/asdf/pull-asdf.sh dissimilarity index 86% index d140aed39..d11dbf7fb 100755 --- a/contrib/asdf/pull-asdf.sh +++ b/contrib/asdf/pull-asdf.sh @@ -1,31 +1,57 @@ -#!/bin/sh -e - -# Get the current ASDF release from the upstream repo. - -if test -d asdf-upstream -then - if test -d ../../obj/asdf-upstream - then - rm -rf asdf-upstream - else - mv asdf-upstream ../../obj/asdf-upstream - fi -fi - -if test -d ../../obj/asdf-upstream -then - (cd ../../obj/asdf-upstream/ - git checkout release - git reset --hard release - git pull -a origin release) -else - (cd ../../obj/ - git clone --branch release https://gitlab.common-lisp.net/asdf/asdf.git asdf-upstream) -fi - -( echo -n ";;; This is UIOP " ; eval echo $(cat ../../obj/asdf-upstream/version.lisp-expr) ; - cd ../../obj/asdf-upstream && cat $(make --quiet driver-files) ; - echo '(provide "UIOP")' ; echo '(provide "uiop")' ) > uiop.lisp -( echo -n ";;; This is ASDF " ; eval echo $(cat ../../obj/asdf-upstream/version.lisp-expr) ; - echo '(eval-when (:compile-toplevel :load-toplevel :execute) (require :uiop))' ; - cd ../../obj/asdf-upstream && cat $(make --quiet defsystem-files) ) > asdf.lisp +#!/bin/sh -e + +REPOSITORY=https://gitlab.common-lisp.net/asdf/asdf.git +BRANCH=${1:-release} + +UPSTREAM_NAME=asdf-upstream +UPSTREAM_DIR="../../obj/${UPSTREAM_NAME}" + +# Get the current ASDF release from the upstream repo. + +echo "Pulling ASDF branch '${BRANCH}' from '${REPOSITORY}'" + +if test -d "${UPSTREAM_NAME}" +then + if test -d "${UPSTREAM_DIR}" + then + rm -rf "${UPSTREAM_NAME}" + else + mv "${UPSTREAM_NAME}" "${UPSTREAM_DIR}" + fi +fi + +if test -d "${UPSTREAM_DIR}" +then + (cd "${UPSTREAM_DIR}" + git checkout "${BRANCH}" + git reset --hard "${BRANCH}" + git pull -a origin "${BRANCH}") +else + (cd ../../obj/ + git clone --branch "${BRANCH}" "${REPOSITORY}" "${UPSTREAM_NAME}") +fi + +# Determine new version +VERSION=$( eval echo $(cat "${UPSTREAM_DIR}/version.lisp-expr") ) +echo "New ASDF version is ${VERSION}" + +# Update UIOP files +( + cd "${UPSTREAM_DIR}" \ + && echo ";;; This is UIOP ${VERSION}" \ + && cat $(make --quiet driver-files) \ + && echo '(provide "UIOP")' \ + && echo '(provide "uiop")' +) > uiop.lisp + +# Update ASDF files +( + cd "${UPSTREAM_DIR}" \ + && echo ";;; This is ASDF ${VERSION}" \ + && echo '(eval-when (:compile-toplevel :load-toplevel :execute) (require :uiop))' \ + && cat $(make --quiet defsystem-files) +) > asdf.lisp + +# Updated documentation +cp "${UPSTREAM_DIR}/README.md" . +cp "${UPSTREAM_DIR}/doc/asdf.texinfo" . -- 2.11.4.GIT