Minh Nguyen wrote:
> Hi David,
> 
> On Thu, Dec 31, 2009 at 3:42 AM, Dr. David Kirkby
> <david.kir...@onetel.net> wrote:
>> How can I produce a patch for Sage, if my Sage will not run on my machine?
> 
> If you don't have hg installed on your system, you can use the command
> diff instead. For example, say the following content is saved to a
> file called "myfile.txt":
> 
> <myfile-content>
> This sentense has a some typ0s.
> </myfile-content>
> 
> Next, you fix typos in the file to get the new file "mynewfile.txt":
> 
> <mynewfile-content>
> This sentence has a some typos.
> </mynewfile-content>
> 
> You have to make sure that you first create a copy of "myfile.txt" and
> rename it as "mynewfile.txt" before doing any editing. You can now
> produce a diff file between myfile.txt and mynewfile.txt:
> 
> diff -Naur myfile.txt mynewfile.txt > mydiff.patch

I've installed 'hg'.

But in any case, the 'diff' on Solaris does not support -N or -a. I've tended 
to 
just use -u when attaching patches, but Solaris supports the -r and

I just checked the POSIX spec

http://www.opengroup.org/onlinepubs/9699919799/utilities/diff.html

and do not see -N or -a.

> which produces the following diff content:
> 
> $ cat mydiff.patch
> --- myfile.txt        2009-12-30 08:50:54.462302935 -0800
> +++ mynewfile.txt     2009-12-30 08:51:15.389961721 -0800
> @@ -1 +1 @@
> -This sentense has a some typ0s.
> +This sentence has a some typos.

I get very similar.

bash-3.2$ echo "This sentance has a some typoOs" > myfile.txt
bash-3.2$ echo "This sentance no longer has a typo" > mynewfile.txt
bash-3.2$ diff -ur myfile.txt mynewfile.txtcd c_lib

--- myfile.txt  Wed Dec 30 17:33:41 2009
+++ mynewfile.txt       Wed Dec 30 17:34:13 2009
@@ -1,1 +1,1 @@
-This sentance has a some typoOs
+This sentance no longer has a typo
bash-3.2$


> When you compile Sage from source, Mercurial should also be built and
> installed during the build process. If the mercurial spkg is
> successfully installed, it should be in
> 
> SAGE_ROOT/local/bin/hg
> 
> In that case, make an alias to hg such as the following:
> 
> alias 'hg'='/path/to/SAGE_ROOT/local/bin/hg'

I've not got that far. I just tried to install it with:

bash-3.2$ ./sage -f mercurial-1.3.1.p0

but that fails. I do however have a somewhat older version installed in 
/usr/bin.

bash-3.2$ hg --version
Mercurial Distributed SCM (version 1.1.2)

or I could of course build Mercurial from source. Perhaps it would be sensible 
I 
updated to at least the version in Sage.

> If you're trying to edit the Sage library, i.e. SAGE_ROOT/dev/sage/,
> then cd to SAGE_ROOT/dev/sage, edit the necessary file(s). Afterwards,
> do "hg status" to see which files have changed. To see the actual new
> content, do "hg diff"; be careful here because the output of "hg diff"
> is sent to standard output by default so you might see a bunch of
> stuff flash through your terminal screen. However, you should be able
> to redirect the output of "hg diff" to a file and review your changes.
> You can review your changes by looking at the diff output. When you're
> certain that you've made all necessary changes, do "hg commit" to
> commit your changes. To produce a patch, do
> 
> $ hg export tip > mychanges.patch
> 
> The basic steps are more or less similar if you're trying to edit a
> file in an spkg. In any case, you need to make sure that the directory
> you're editing from has a Mercurial repository. The command "hg
> status" should not report any errors if your current directory is
> under revision control.

So lets assume the I'm trying to change spkg-install in 
$SAGE_ROOT/spkg/standard/foobar-1.0.spkg

what is the procedure? I can decompress that to spkg, which will create

spkg/standard/foobar-1.0/spkg-install

Then do I just cd to

$SAGE_ROOT/spkg/standard/foobar-1.0/

and make changes to $SAGE_ROOT/spkg/standard/foobar-1.0/spkg-install ?

Or should  $SAGE_ROOT/spkg/standard/foobar-1.0.spkg be copied somewhere else 
first? If so, does it matter where? (I normally tend to extract the file, then 
increment the patch number, so I'd be editing 
$SAGE_ROOT/spkg/standard/foobar-1.0.p0/spkg-install



Martin Albrecht added a patch for me to

http://trac.sagemath.org/sage_trac/ticket/7505

which adds two new files

$SAGE_ROOT/spkg/base/testcc.sh
$SAGE_ROOT/spkg/base/testcxx.sh

I noticed the diff is relative to /dev/null That patch needs updating now. I'm 
not sure the best way to do that. There's nothing in the patch which would 
suggest where the files go, though it is explained in the ticket, and the 
reason 
why.

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

Reply via email to