From b843de1946be969ad7f377348572ef2aba135b4b Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Fri, 12 Apr 2024 12:49:05 +0000 Subject: [PATCH] Apply patches to the ckan Dockerfile --- ckan/Dockerfile | 19 +++++++++++++------ ckan/Dockerfile.ghcr | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 770ae47..a84f69f 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -67,12 +67,19 @@ COPY setup/who.ini ./ COPY patches patches RUN for d in $APP_DIR/patches/*; do \ - if [ -d $d ]; then \ - for f in `ls $d/*.patch | sort -g`; do \ - cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`" && patch -p1 < "$f"; \ - done; \ - fi; \ - done + if [ -d $d ]; then \ + for f in `ls $d/*.patch | sort -g`; do \ + cd $SRC_DIR/`basename "$d"` && \ + if patch -R --dry-run -p1 < "$f"; then \ + echo "$0: Patch $f has already been applied or reversed, skipping..."; \ + else \ + echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; \ + sed -i 's/\r$//' "$f" && \ + patch -p1 < "$f" ; \ + fi \ + done ; \ + fi ; \ +done # Workers ## Update start_ckan.sh with custom workers diff --git a/ckan/Dockerfile.ghcr b/ckan/Dockerfile.ghcr index 9ee4604..03dc78a 100644 --- a/ckan/Dockerfile.ghcr +++ b/ckan/Dockerfile.ghcr @@ -32,6 +32,7 @@ RUN for d in $APP_DIR/patches/*; do \ echo "$0: Patch $f has already been applied or reversed, skipping..."; \ else \ echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; \ + sed -i 's/\r$//' "$f" && \ patch -p1 < "$f" ; \ fi \ done ; \