From: Dave B. <da...@ff...> - 2001-12-06 16:32:19
|
On Wed, Dec 05, 2001 at 07:21:43PM -0800, John Fessenden wrote: > anyhow.. the real strange issue is that the patch is failing to apply on > solaris. It turns out that this is because patch doesn't have write > permision to the file it's trying to patch. That's because the archive has > the files stored without the write bit set, and solaris's tar preserves > those permissions when it unpacks it, ughh. > > currently patches are applied in ext/bin/build/expand-sources right after > the untar, so theres no hook in which to fix the perms. unless there's a better way, maybe a patch to add the hook is appropriate: --- doc/wigwam.sgml 2001/08/15 21:34:01 1.12 +++ doc/wigwam.sgml 2001/12/06 16:28:49 @@ -2230,7 +2230,25 @@ optional, and may contain support files, usually from the author of the package. </para> - +<para> + If a package's source files need modifications, + for example, for portability or to make them better adapted to wigwam, + you may include patches in the package. These should + be normal patches, produced with <command>diff -u</command>. + They will be automatically found and applied if + they end with <filename>.patch</filename>, <filename>.patch.bz2</filename> + or <filename>.patch.gz</filename>. +</para> +<para> + Sometimes patching sources is not enough to fix them so they build. + For example, sometimes a file's permission needs to be changed. + To do that, one can put code in the <filename>.prepatch</filename> + file: +<programlisting> + chmod +x configure-helper-script + chmod +w some-random-file +</programlisting> +</para> <para> Makefile-style packages recognized the additional variables: --- build-scripts/expand-sources 2001/07/28 13:45:58 1.2 +++ build-scripts/expand-sources 2001/12/06 16:28:48 @@ -14,8 +14,12 @@ Note that PATCHES must be included as an empty argument if there are no patches. -Recognized ARCHIVE formats: .tar.gz, .tar, .tar.bz2, .tgz, .zip, .arj" +Recognized ARCHIVE formats: .tar.gz, .tar, .tar.bz2, .tgz, .zip, .arj +Additionally, if .prepatch or .postpatch files are found +parallel to OPTIONS-FILE, those scripts are run before +or after the patches are applied." + options_file="$1" archives="$2" patches="$3" @@ -114,6 +118,11 @@ true fi +# Give the user a chance to fix up sources before applying +# the patches. This is mostly to allow permission fixes. +options_file_base=`echo "$options_file" | sed -e 's/\\.options$//'` +test -r "$options_file_base.prepatch" && ( . "$options_file_base.prepatch" ; ) + # _ _ _ # __ _ _ __ _ __| |_ _ _ __ __ _| |_ __| |_ ___ ___ # / _` | '_ \ '_ \ | || | | '_ \/ _` | _/ _| ' \/ -_|_-< @@ -163,5 +172,9 @@ echo "$id: patch $patch_flags" 1>&2 } done + +# Apply the postpatch script, if it exists. +# For example, maybe you want to 'chmod +x newly-created-file'. +test -r "$options_file_base.postpatch" && ( . "$options_file_base.postpatch" ; ) exit 0 |