Sage: Ticket #10192: SageNB broken when SAGE_PATH contains flavours of '.' during installation
https://trac.sagemath.org/ticket/10192
<p>
When <code>SAGE_PATH</code> (and hence also <code>PYTHONPATH</code>) contains "<code>.</code>" (the current working directory) during the installation of <code>sagenb</code>, Python is able to find <code>sagenb</code> in its path and therefore refuses to add it to <code>easy-install.pth</code>. Later, Sage won't find it, leading to the following error message:
</p>
<pre class="wiki">ImportError: No module named sagenb.misc.sphinxify
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.
</pre><p>
This is a follow-up to <a class="closed ticket" href="https://trac.sagemath.org/ticket/10176" title="defect: ImportError: No module named sagenb on openSUSE (closed: invalid)">#10176</a>, and there has been some discussion on <a class="ext-link" href="http://groups.google.com/group/sage-release/browse_thread/thread/bb636656e2153332"><span class="icon"></span>sage-release</a>.
</p>
<hr />
<p>
Apply only
</p>
<p>
<a class="attachment" href="https://trac.sagemath.org/attachment/ticket/10192/10192-remove_dot_from_PYTHONPATH_in_sage-spkg.2.patch" title="Attachment '10192-remove_dot_from_PYTHONPATH_in_sage-spkg.2.patch' in Ticket #10192">10192-remove_dot_from_PYTHONPATH_in_sage-spkg.2.patch</a><a class="trac-rawlink" href="https://trac.sagemath.org/raw-attachment/ticket/10192/10192-remove_dot_from_PYTHONPATH_in_sage-spkg.2.patch" title="Download"></a>
to the Sage <strong>root repository</strong>.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/10192
Trac 1.1.6leifSat, 30 Oct 2010 17:12:42 GMTcc set
https://trac.sagemath.org/ticket/10192#comment:1
https://trac.sagemath.org/ticket/10192#comment:1
<ul>
<li><strong>cc</strong>
<em>leif</em> added
</li>
</ul>
TicketleifSat, 30 Oct 2010 22:53:09 GMTkeywords changed
https://trac.sagemath.org/ticket/10192#comment:2
https://trac.sagemath.org/ticket/10192#comment:2
<ul>
<li><strong>keywords</strong>
<em>dot</em> <em>PYTHONPATH</em> <em>easy_install</em> <em>easy-install</em> <em>pth</em> <em>sage-spkg</em> <em>setuptools</em> added
</li>
</ul>
<p>
From <code>sage-env</code>:
</p>
<div class="wiki-code"><div class="code"><pre><span class="k">if</span> <span class="o">[</span> -d <span class="s2">"$SAGE_ROOT/local/lib/python"</span> <span class="o">]</span>; <span class="k">then
</span><span class="nv">PYTHONPATH</span><span class="o">=</span><span class="s2">"$SAGE_PATH:$SAGE_ROOT/local/lib/python"</span> <span class="o">&&</span> <span class="nb">export </span>PYTHONPATH
<span class="nv">PYTHONHOME</span><span class="o">=</span><span class="s2">"$SAGE_ROOT/local"</span> <span class="o">&&</span> <span class="nb">export </span>PYTHONHOME
<span class="k">fi</span>
</pre></div></div><p>
We shouldn't add <code>$SAGE_PATH</code> there if it is empty btw., but the removal of "<code>.</code>" from <code>PYTHONPATH</code> should be performed in <code>sage-spkg</code> I think.
</p>
<p>
(<code>$SAGE_PATH</code> is also <em>appended</em> to an overwritten(?!) <code>PYTHONPATH</code> in <code>sage-doctest</code>.)
</p>
TicketleifSun, 31 Oct 2010 01:23:19 GMTcc, status changed; author set
https://trac.sagemath.org/ticket/10192#comment:3
https://trac.sagemath.org/ticket/10192#comment:3
<ul>
<li><strong>cc</strong>
<em>mpatel</em> added
</li>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>author</strong>
set to <em>Leif Leonhardy</em>
</li>
</ul>
<p>
Ok, after changing some instances of <code>PYTHON_PATH</code> to <code>PYTHONPATH</code> (argh!), the attached patch works for me.
</p>
<p>
You can try setting <code>SAGE_PATH</code> to something containing "<code>.</code>" (e.g. <code>":/foo/bar:.:/baz</code>, too), of course also doing <code>export SAGE_PATH</code>, then [re]installing the SageNB 0.8.7 spkg (or the newer ones, p1 or p2, but these aren't necessary, i.e., the patch here fixes the issue in a different way, not needing an additional work-around).
</p>
TicketleifSun, 31 Oct 2010 01:31:06 GMTcc changed
https://trac.sagemath.org/ticket/10192#comment:4
https://trac.sagemath.org/ticket/10192#comment:4
<ul>
<li><strong>cc</strong>
<em>mhansen</em> added
</li>
</ul>
<p>
As far as I know, Cygwin (as opposed to MS DOS/Windows) also uses "<code>:</code>" to separate directories in search paths, so this should work for Cygwin as well.
</p>
<p>
(Other shell and even Python scripts in Sage also hard-code that character.)
</p>
TicketleifSun, 31 Oct 2010 01:41:03 GMTcomponent changed
https://trac.sagemath.org/ticket/10192#comment:5
https://trac.sagemath.org/ticket/10192#comment:5
<ul>
<li><strong>component</strong>
changed from <em>notebook</em> to <em>build</em>
</li>
</ul>
TickethivertSun, 31 Oct 2010 08:55:44 GMTreviewer set
https://trac.sagemath.org/ticket/10192#comment:6
https://trac.sagemath.org/ticket/10192#comment:6
<ul>
<li><strong>reviewer</strong>
set to <em>Florent Hivert</em>
</li>
</ul>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/10192#comment:5" title="Comment 5">leif</a>:
</p>
<p>
Applying the patch give me
</p>
<pre class="wiki">patching file sage-spkg
Hunk #1 succeeded at 292 (offset -8 lines).
</pre><p>
Are you sure that you didn't change anything else from a vanilla 4.6.rc0 ?
</p>
<p>
Anyway, for what concerns openSUSE 11.1 and 11.3 the patch perfectly works. I also checked it on sage.sagemath.org. So I'm ok to give it a positive review, except for the Cygwin question where I'm not competent. Please do it on my behalf as soon as you have Mike answer.
</p>
TicketleifSun, 31 Oct 2010 09:04:20 GMT
https://trac.sagemath.org/ticket/10192#comment:7
https://trac.sagemath.org/ticket/10192#comment:7
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/10192#comment:6" title="Comment 6">hivert</a>:
</p>
<blockquote class="citation">
<p>
Applying the patch give me
</p>
</blockquote>
<pre class="wiki">patching file sage-spkg
Hunk #1 succeeded at 292 (offset -8 lines).
</pre><blockquote class="citation">
<p>
Are you sure that you didn't change anything else from a vanilla 4.6.rc0 ?
</p>
</blockquote>
<p>
Ok, not based on <em>vanilla</em> rc0; I've also applied a completely unrelated patch to <code>sage-spkg</code> (removing "<code>x</code>" from <code>tar</code> by default, <a class="closed ticket" href="https://trac.sagemath.org/ticket/10040" title="enhancement: Don't ask for verbose output from tar when installing packages (closed: fixed)">#10040</a>).
</p>
TicketleifSun, 31 Oct 2010 12:45:04 GMTattachment set
https://trac.sagemath.org/ticket/10192
https://trac.sagemath.org/ticket/10192
<ul>
<li><strong>attachment</strong>
set to <em>trac_10192-remove_dot_from_PYTHONPATH_in_sage-spkg-scripts_repo.patch</em>
</li>
</ul>
<p>
Apply to scripts repo. Based on vanilla Sage 4.6.rc0. (Updated version, handles more weird cases, too.)
</p>
TicketleifSun, 31 Oct 2010 13:16:29 GMT
https://trac.sagemath.org/ticket/10192#comment:8
https://trac.sagemath.org/ticket/10192#comment:8
<p>
I've uploaded a slightly improved patch, this time <em>really</em> based on <em>vanilla</em> 4.6.rc0.
</p>
<p>
Try again...
</p>
<p>
(also with <code>SAGE_PATH=".::./././//./://bingo//:baz:::://///:./.:."</code> and alike) ;-)
</p>
<p>
Although it <em>might</em> still fail with e.g. <code>SAGE_PATH="./foo/.."</code> (if <code>./foo/</code> happens to exist in the directory <code>setup</code> is run in), but this would at least for SageNB be catched by the 0.8.7.p{1,2} spkgs...
</p>
TicketleifThu, 11 Aug 2011 19:07:57 GMT
https://trac.sagemath.org/ticket/10192#comment:9
https://trac.sagemath.org/ticket/10192#comment:9
<p>
ping...
</p>
<p>
(Still needs review, only the Cygwin question seems still open, though I believe it'll also work on Cygwin.)
</p>
<p>
The patch will almost certainly have to get rebased, haven't tried yet.
</p>
TicketleifThu, 11 Aug 2011 20:14:06 GMTattachment set
https://trac.sagemath.org/ticket/10192
https://trac.sagemath.org/ticket/10192
<ul>
<li><strong>attachment</strong>
set to <em>trac_10192-remove_dot_from_PYTHONPATH_in_sage-spkg.rebased_to_4.7.1.rc2.scripts.patch</em>
</li>
</ul>
<p>
SCRIPTS repo. Same patch, rebased to Sage 4.7.1.rc2.
</p>
TicketleifThu, 11 Aug 2011 20:33:44 GMTdescription changed
https://trac.sagemath.org/ticket/10192#comment:10
https://trac.sagemath.org/ticket/10192#comment:10
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/10192?action=diff&version=10">diff</a>)
</li>
</ul>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/10192#comment:9" title="Comment 9">leif</a>:
</p>
<blockquote class="citation">
<p>
The patch will almost certainly have to get rebased, haven't tried yet.
</p>
</blockquote>
<p>
Wow, the patch still applied (with an offset of only a few lines); I've rebased it on Sage 4.7.1.rc2 despite of that to now apply cleanly.
</p>
<p>
There are currently some concurrent tickets also patching <code>sage-spkg</code> though.
</p>
TicketleifThu, 11 Aug 2011 20:45:19 GMTcc changed
https://trac.sagemath.org/ticket/10192#comment:11
https://trac.sagemath.org/ticket/10192#comment:11
<ul>
<li><strong>cc</strong>
<em>jdemeyer</em> <em>jhpalmieri</em> added
</li>
</ul>
TicketppurkaThu, 13 Oct 2011 12:34:50 GMTattachment set
https://trac.sagemath.org/ticket/10192
https://trac.sagemath.org/ticket/10192
<ul>
<li><strong>attachment</strong>
set to <em>trac_10192-remove_dot_and_more_from_PYTHONPATH_in_sage.spkg.2.patch</em>
</li>
</ul>
<p>
New attempt to clean up even nastier paths (including .., ./., etc)
</p>
TicketppurkaThu, 13 Oct 2011 12:50:18 GMTattachment set
https://trac.sagemath.org/ticket/10192
https://trac.sagemath.org/ticket/10192
<ul>
<li><strong>attachment</strong>
set to <em>trac_10192-remove_dot_and_more_from_PYTHONPATH_in_sage.spkg.patch</em>
</li>
</ul>
<p>
New attempt to clean up even nastier paths (including .., ./., etc) (Ignore the other patch)
</p>
TicketppurkaThu, 13 Oct 2011 12:51:23 GMT
https://trac.sagemath.org/ticket/10192#comment:12
https://trac.sagemath.org/ticket/10192#comment:12
<p>
Please check <a class="attachment" href="https://trac.sagemath.org/attachment/ticket/10192/trac_10192-remove_dot_and_more_from_PYTHONPATH_in_sage.spkg.patch" title="Attachment 'trac_10192-remove_dot_and_more_from_PYTHONPATH_in_sage.spkg.patch' in Ticket #10192">trac_10192-remove_dot_and_more_from_PYTHONPATH_in_sage.spkg.patch</a><a class="trac-rawlink" href="https://trac.sagemath.org/raw-attachment/ticket/10192/trac_10192-remove_dot_and_more_from_PYTHONPATH_in_sage.spkg.patch" title="Download"></a> against other platforms. I have checked it on Linux x86_64 and it cleans up nasty examples like the one mentioned earlier <code>".::./././//./://bingo//:baz:::://///:./.:."</code>. (Indented the paste below :))
</p>
<pre class="wiki"> ~ $ AAAA=".::./././//./://bingo//:baz:::://///:./.:."
~ $ new_pp=""
~ $ IFS=":"
~ $ for x in $AAAA; do
if [ -n "$x" -a -n "$(echo "$x" | sed -e 's/[\.\/]\+//g')" ]; then
if [ -z "$new_pp" ]; then
new_pp="$x"
else
new_pp="${new_pp}:$x"
fi
fi
done
~ $ echo "$new_pp"
//bingo//:baz
</pre><p>
This is against 4.7.0. I will later try to upload it rebased against 4.7.2.
</p>
TicketleifThu, 13 Oct 2011 15:00:03 GMT
https://trac.sagemath.org/ticket/10192#comment:13
https://trac.sagemath.org/ticket/10192#comment:13
<p>
And what's the advantage of running <code>sed</code> (and twice <code>test</code>, and <code>echo</code>) multiple times in a loop? B)
</p>
<p>
I'm not sure right now whether my patch is up-to-date btw., as the currently attached one doesn't remove redundant slashs and (e.g.) <code>./</code>... 8/
</p>
TicketppurkaThu, 13 Oct 2011 15:26:05 GMT
https://trac.sagemath.org/ticket/10192#comment:14
https://trac.sagemath.org/ticket/10192#comment:14
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/10192#comment:13" title="Comment 13">leif</a>:
</p>
<blockquote class="citation">
<p>
And what's the advantage of running <code>sed</code> (and twice <code>test</code>, and <code>echo</code>) multiple times in a loop? B)
</p>
<p>
I'm not sure right now whether my patch is up-to-date btw., as the currently attached one doesn't remove redundant slashs and (e.g.) <code>./</code>... 8/
</p>
</blockquote>
<p>
The main point in the patch is the separator that is redefined to ':'.
</p>
<p>
Now when you run a loop through the variable, it loops through all the parts separated by ':'. Once each part is separated, you can check whether it is empty (hence the first test <code>-n "$x"</code>), or whether it consists of only . and / (hence the echo + sed). This is important because this catches all the bad cases like <code>..</code>, <code>./.</code>, <code>.</code>, etc. ( In relation to <a class="closed ticket" href="https://trac.sagemath.org/ticket/11914" title="defect: `sage -n` fails when current directory is $SAGE_ROOT/devel/sage (closed: fixed)">#11914</a>, I tried to cd to devel/sage/sage and ran sage as <code>SAGE_PATH=.. sage -n</code> and it failed to run. So we should definitely weed out at least <code>..</code> by itself. ) I do feel that it is over-engineered, but I haven't been able to come up with a better solution that catches all the cases.
</p>
<p>
Since all the scripts in Sage are trying to conform to POSIX you need the echo + sed. In pure bash, you can replace the <code>"$( echo "$x" | sed ... )"</code> with simply <code>"${x//[\.\/]}"</code>
</p>
TicketleifThu, 13 Oct 2011 17:18:48 GMT
https://trac.sagemath.org/ticket/10192#comment:15
https://trac.sagemath.org/ticket/10192#comment:15
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/10192#comment:14" title="Comment 14">ppurka</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/10192#comment:13" title="Comment 13">leif</a>:
</p>
<blockquote class="citation">
<p>
And what's the advantage of running <code>sed</code> (and twice <code>test</code>, and <code>echo</code>) multiple times in a loop? B)
</p>
<p>
I'm not sure right now whether my patch is up-to-date btw., as the currently attached one doesn't remove redundant slashs and (e.g.) <code>./</code>... 8/
</p>
</blockquote>
<p>
The main point in the patch is the separator that is redefined to ':'.
</p>
</blockquote>
<p>
Well, I know <code>IFS</code>, but I don't want to run it in a loop; that was my point.
</p>
<p>
My improved code snippet (simplified and catching additional instances; using a single invocation of <code>sed</code>) looks like this:
</p>
<div class="wiki-code"><div class="code"><pre><span class="nv">$ </span><span class="nb">echo</span> <span class="nv">$EXAMPLE</span>; <span class="nb">echo</span>; <span class="nb">echo</span> <span class="s2">":$EXAMPLE:"</span> | sed <span class="se">\
</span>-e <span class="s1">'s|/\+|/|g'</span> <span class="se">\
</span>-e <span class="s1">'s|:\(\./\)\+|:|g'</span> <span class="se">\
</span>-e <span class="s1">'s|\(/\.\)\+:|:|g'</span> <span class="se">\
</span>-e <span class="s1">'s|\(:\.\)\+:|:|g'</span> <span class="se">\
</span>-e <span class="s1">'s|:\+|:|g'</span> -e <span class="s1">'s|^:\+||'</span> -e <span class="s1">'s|:\+$||'</span>
.::./././//./://bingo//:baz:::://///:./.:.
/bingo/:baz:/
</pre></div></div><p>
<br />
</p>
<blockquote class="citation">
<p>
This is important because this catches all the bad cases like <code>..</code>, <code>./.</code>, <code>.</code>, etc.
</p>
</blockquote>
<p>
We only have to catch "<code>.</code>" (i.e., the current working directory) <em>here</em>.
</p>
<p>
<br />
</p>
<blockquote class="citation">
<p>
(In relation to <a class="closed ticket" href="https://trac.sagemath.org/ticket/11914" title="defect: `sage -n` fails when current directory is $SAGE_ROOT/devel/sage (closed: fixed)">#11914</a>, I tried to cd to devel/sage/sage and ran sage as <code>SAGE_PATH=.. sage -n</code> and it failed to run. So we should definitely weed out at least <code>..</code> by itself.)
</p>
</blockquote>
<p>
IMHO not. If you put things into <code>SAGE_PATH</code>, you have to live with the results (or side-effects) <em>in that case</em>. Or we have to do that in <code>sage-sage</code>, before we (try to) start the notebook only, independently of the fix to <code>sage-env</code> at <a class="closed ticket" href="https://trac.sagemath.org/ticket/11914" title="defect: `sage -n` fails when current directory is $SAGE_ROOT/devel/sage (closed: fixed)">#11914</a> (and of course <code>sage-spkg</code>, which is patched here).
</p>
<p>
A better approach in the case of the notebook would perhaps be to directly test whether any component of <code>PYTHONPATH</code> yields <code>devel/sage-*/</code> (or has a subdirectory <code>sage</code> with an <code>__init__.py</code> file in it), or, probably easiest, <em>prepend</em> the correct directory to <code>PYTHONPATH</code> before running <code>sage-notebook</code>.
</p>
<p>
(We should better discuss the latter on <a class="closed ticket" href="https://trac.sagemath.org/ticket/11914" title="defect: `sage -n` fails when current directory is $SAGE_ROOT/devel/sage (closed: fixed)">#11914</a>.)
</p>
TicketleifThu, 13 Oct 2011 17:49:06 GMTattachment set
https://trac.sagemath.org/ticket/10192
https://trac.sagemath.org/ticket/10192
<ul>
<li><strong>attachment</strong>
set to <em>trac_10192-remove_dot_from_PYTHONPATH_in_sage-spkg.v2.scripts.patch</em>
</li>
</ul>
<p>
SCRIPTS repo. Improved version of my previous patch. Based on Sage 4.7.2.alpha4.
</p>
TicketleifThu, 13 Oct 2011 17:53:26 GMTdescription changed
https://trac.sagemath.org/ticket/10192#comment:16
https://trac.sagemath.org/ticket/10192#comment:16
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/10192?action=diff&version=16">diff</a>)
</li>
</ul>
<p>
New patch is up.
</p>
TicketleifThu, 13 Oct 2011 17:58:41 GMTsummary changed
https://trac.sagemath.org/ticket/10192#comment:17
https://trac.sagemath.org/ticket/10192#comment:17
<ul>
<li><strong>summary</strong>
changed from <em>SageNB fails to install when SAGE_PATH is set to '.'</em> to <em>SageNB broken when SAGE_PATH contains flavours of '.' during installation</em>
</li>
</ul>
TicketppurkaSun, 16 Oct 2011 12:48:14 GMT
https://trac.sagemath.org/ticket/10192#comment:18
https://trac.sagemath.org/ticket/10192#comment:18
<p>
New patch looks good to me. I will leave it to people who actually had the problem(s) to report back and change this to "positive review."
</p>
<p>
Personally, I had no problems in getting Sage compiled and up and running on two different Linux distributions, and with sage-4.7.0 and sage-4.7.2_alpha3.
</p>
TicketppurkaFri, 03 Feb 2012 19:27:45 GMTattachment set
https://trac.sagemath.org/ticket/10192
https://trac.sagemath.org/ticket/10192
<ul>
<li><strong>attachment</strong>
set to <em>trac_10192-remove_dot_from_PYTHONPATH_in_sage-spkg.v3.scripts.patch</em>
</li>
</ul>
<p>
Updated the v2 of the file so that it applies to sage-4.8
</p>
TicketppurkaFri, 03 Feb 2012 19:30:52 GMTstatus, description changed
https://trac.sagemath.org/ticket/10192#comment:19
https://trac.sagemath.org/ticket/10192#comment:19
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
<li><strong>description</strong>
modified (<a href="/ticket/10192?action=diff&version=19">diff</a>)
</li>
</ul>
<p>
Update patch to sage-4.8.
</p>
<p>
This has positive review from my side. If there is nothing else holding it up, then it should be merged, in my opinion.
</p>
TicketjdemeyerSat, 04 Feb 2012 14:10:38 GMTattachment set
https://trac.sagemath.org/ticket/10192
https://trac.sagemath.org/ticket/10192
<ul>
<li><strong>attachment</strong>
set to <em>10192-remove_dot_from_PYTHONPATH_in_sage-spkg.patch</em>
</li>
</ul>
TicketjdemeyerSat, 04 Feb 2012 14:12:54 GMTdescription changed; dependencies set
https://trac.sagemath.org/ticket/10192#comment:20
https://trac.sagemath.org/ticket/10192#comment:20
<ul>
<li><strong>dependencies</strong>
set to <em>#11073</em>
</li>
<li><strong>description</strong>
modified (<a href="/ticket/10192?action=diff&version=20">diff</a>)
</li>
</ul>
<p>
Rebased to <a class="closed ticket" href="https://trac.sagemath.org/ticket/11073" title="enhancement: remove the spkg/base repo! (closed: fixed)">#11073</a>.
</p>
TicketjdemeyerMon, 06 Feb 2012 21:23:06 GMTstatus changed; resolution, merged set
https://trac.sagemath.org/ticket/10192#comment:21
https://trac.sagemath.org/ticket/10192#comment:21
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
<li><strong>merged</strong>
set to <em>sage-5.0.beta3</em>
</li>
</ul>
TicketjdemeyerThu, 16 Feb 2012 09:44:21 GMTstatus changed; resolution, merged deleted
https://trac.sagemath.org/ticket/10192#comment:22
https://trac.sagemath.org/ticket/10192#comment:22
<ul>
<li><strong>status</strong>
changed from <em>closed</em> to <em>new</em>
</li>
<li><strong>resolution</strong>
<em>fixed</em> deleted
</li>
<li><strong>merged</strong>
<em>sage-5.0.beta3</em> deleted
</li>
</ul>
<p>
This needs work because "\+" in sed scripts isn't portable. You can replace "X\+" by "XX*", which is equivalent.
</p>
TicketjdemeyerThu, 16 Feb 2012 09:45:48 GMT
https://trac.sagemath.org/ticket/10192#comment:23
https://trac.sagemath.org/ticket/10192#comment:23
<p>
Another minor comment: use spaces instead of TABs for indenting.
</p>
TicketppurkaThu, 16 Feb 2012 09:50:15 GMT
https://trac.sagemath.org/ticket/10192#comment:24
https://trac.sagemath.org/ticket/10192#comment:24
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/10192#comment:22" title="Comment 22">jdemeyer</a>:
</p>
<blockquote class="citation">
<p>
This needs work because "\+" in sed scripts isn't portable. You can replace "X\+" by "XX*", which is equivalent.
</p>
</blockquote>
<p>
Is <code>\{1,\}</code> a portable version of <code>\+</code>?
</p>
TicketjdemeyerThu, 16 Feb 2012 09:56:45 GMT
https://trac.sagemath.org/ticket/10192#comment:25
https://trac.sagemath.org/ticket/10192#comment:25
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/10192#comment:24" title="Comment 24">ppurka</a>:
</p>
<blockquote class="citation">
<p>
Is <code>\{1,\}</code> a portable version of <code>\+</code>?
</p>
</blockquote>
<p>
As far as I can tell, yes. But I consider "XX*" to be more readable than "X\{1,\}", especially for short strings X, which is the case here.
</p>
TicketppurkaThu, 16 Feb 2012 11:46:15 GMTattachment set
https://trac.sagemath.org/ticket/10192
https://trac.sagemath.org/ticket/10192
<ul>
<li><strong>attachment</strong>
set to <em>10192-remove_dot_from_PYTHONPATH_in_sage-spkg.2.patch</em>
</li>
</ul>
<p>
Apply only this to SAGE_ROOT
</p>
TicketppurkaThu, 16 Feb 2012 11:46:58 GMTstatus, description changed
https://trac.sagemath.org/ticket/10192#comment:26
https://trac.sagemath.org/ticket/10192#comment:26
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>description</strong>
modified (<a href="/ticket/10192?action=diff&version=26">diff</a>)
</li>
</ul>
<p>
Updated the patch with the stated modifications. Please review.
</p>
<p>
Here is the output in busybox (probably the closest system to POSIX I have around here, but the earlier version also works fine):
</p>
<pre class="wiki">~> busybox sh
BusyBox v1.18.4 (Ubuntu 1:1.18.4-2ubuntu2) built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ $ EXAMPLE=".::./././//./://bingo//:baz:::://///:./.:."
~ $ echo :$EXAMPLE: | busybox sed -e 's|//*|/|g' -e 's|:\(\./\)\{1,\}|:|g' -e 's
|\(/\.\)\{1,\}:|:|g' -e 's|\(:\.\)\{1,\}:|:|g' -e 's|::*|:|g' -e 's|^::*||' -e '
s|::*$||'
/bingo/:baz:/
</pre>
TicketjdemeyerTue, 21 Feb 2012 10:55:13 GMTstatus, reviewer, author changed
https://trac.sagemath.org/ticket/10192#comment:27
https://trac.sagemath.org/ticket/10192#comment:27
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
<li><strong>reviewer</strong>
changed from <em>Florent Hivert</em> to <em>Florent Hivert, Jeroen Demeyer</em>
</li>
<li><strong>author</strong>
changed from <em>Leif Leonhardy</em> to <em>Leif Leonhardy, Punarbasu Purkayastha</em>
</li>
</ul>
TicketjdemeyerMon, 27 Feb 2012 11:20:06 GMTstatus changed; resolution, merged set
https://trac.sagemath.org/ticket/10192#comment:28
https://trac.sagemath.org/ticket/10192#comment:28
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
<li><strong>merged</strong>
set to <em>sage-5.0.beta6</em>
</li>
</ul>
Ticket