Skip to content

Commit

Permalink
fix(fpm): add patch for apk
Browse files Browse the repository at this point in the history
  • Loading branch information
curiositycasualty committed Dec 23, 2022
1 parent fc7a1c0 commit f1979a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ ENV DEBIAN_FRONTEND noninteractive

SHELL ["/bin/bash", "-e", "-x", "-c"]

COPY patches/fpm-apk-archive-header.patch /tmp/fpm.patch

RUN if [[ "$FPM_VERSION" == 'latest' ]]; then \
gem install --no-document fpm; \
else \
gem install --no-document fpm -v "$FPM_VERSION"; \
fi \
fi

# https://github.com/jordansissel/fpm/issues/1227
RUN cd $(gem env gemhome)/gems/fpm-* \
&& patch -p 0 -ruN < /tmp/fpm.patch \
&& mkdir -pv /src/ \
&& fpm --version

Expand Down
12 changes: 12 additions & 0 deletions patches/fpm-apk-archive-header.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --color -Naur lib/fpm/package/apk.rb.orig lib/fpm/package/apk.rb
--- lib.orig/fpm/package/apk.rb 2022-12-23 14:03:55.583865965 -0800
+++ lib/fpm/package/apk.rb 2022-12-23 14:06:56.040703096 -0800
@@ -252,7 +252,7 @@

# directories have a magic string inserted into their name
full_record_path = extension_header[TAR_NAME_OFFSET_START..TAR_NAME_OFFSET_END].delete("\0")
- full_record_path = add_paxstring(full_record_path)
+ # full_record_path = add_paxstring(full_record_path)

# hash data contents with sha1, if there is any content.
if(typeflag == '5')

0 comments on commit f1979a3

Please sign in to comment.