On 11/14/10 11:39 PM, Dan Drake wrote:
On Sun, 14 Nov 2010 at 02:00PM +0100, Jeroen Demeyer wrote:
There is some work being done at #9418 at make GNU patch a standard
package such that, in the future, spkgs will be able to use "patch"
instead of "cp" to apply patches.
It is a very simple solution which allows for:
* patching files depending on the system (e.g. if a patch needs to be
applied only on OS X systems)
* patching multiple files with one diff
* patching the same file with multiple diffs
* easily updating a spkg to a new upstream version
* easily adding a new patch to a spkg
* not being forced to update any spkgs, we can keep the old system if we
want (if there is a reason to do that for a particular spkg).
* low maintanance of the "patch" spkg: patch is a very stable program
with essentially no dependencies.
I dislike having complete files and patches in the patch/ directory, so
I'm in favor of somehow having patch available.
One concern I have: let's say we have a patch spkg in Sage. Many people
installing Sage will have patch already available, and it is easy to
imagine, if we're not careful in our scripts, that sometimes the system
patch would be called, and sometimes Sage's patch -- and since these
might not be the same version, strange, difficult-to-debug behavior
could result.
My questions:
* Is patch stable and standard enough so that this won't be a problem?
For example, can we stick to POSIX-standard commandline switches and so
on, and expect everything to work on Linux, *BSD, OS X, Solaris, etc,
even if an errant script calls the system patch?
Historically the Sun patch command has not been compatible with the GNU one.
Here's the man page for the Sun patch command
User Commands patch(1)
NAME
patch - apply changes to files
SYNOPSIS
patch [-blNR] [-c | -e | -n | -u] [-d dir] [-D define] [-
i patchfile] [-o outfile] [-p num] [-r rejectfile] [file]
DESCRIPTION
The patch command reads a source (patch) file containing any
and there's the POSIX defintion
http://www.opengroup.org/onlinepubs/009695399/utilities/patch.html
ie.. they are identical. But the GNU patch command has not been 100% compatible
with the Sun one. Perhaps if the GNU option --posix to diff was used, then it
might be ok.
* If the answer to the above question isn't a solid yes, how hard would
it be to rewrite spkg-install scripts to be very certain that we only
use "our" patch? (And to educate future spkg creators to do this as well?)
I'm guessing the answers are "yes" and "not very", but I thought I would
raise the issue.
Dan
Since $SAGE_LOCAL/bin is in the path before anything else, we should should find
the version in Sage before any oether version - irrespective of whether that
other version is newer, older, better or broken.
Dave
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org