mtneug / freetz-docker

Docker image for building Freetz images

Home Page:https://hub.docker.com/r/mtneug/freetz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use "svn patch $p" instead of "patch -p1 < $p"

pfichtner opened this issue · comments

Would it be possible to use svn patch instead of (or additonally to) gnu patch?

patch -p1 < "$p"

Why it is actually not possible to use gnu patch for me:
I started implementing a new package. Some files have to been executable. As far as I know it is not possible to store file attributes using gnu diff nor it is possible to restore file attributes using gnu patch. Without the executable bit set on the files (rc initscript, cgi, ...) the package won't work.

So I did create a patch using svn add/svn diff and apply this patch using svn patch $file.

Hi @pfichtner, thanks for the suggestion. Since I don't actually use svn I must ask: how compatible is svn patch with patches created by GNU diff? Can we just safely replace patch? If not, we could certainly add it as an alternative. Would you check and file a pull request?

I also did not use svn diff before. But it seems to be the only way to create a patchfile where the executable bit is recorded. Do you know another way how to create a patch where the existing executable bit is restored when the patch is applied?
I am not bound to svn diff/patch any other way that satisfies my needs is welcome.
Nevertheless  I'll check if a svn patchfile is compatible with gnu patch.
Update: a svn patchfile is not compatible to be applied by gnu patch

Another more generic way would be that /entrypoint.sh checks for a script and if it exists execute it. So a script could be added to the container using a docker volume (as I do for image, config, etc.)