#3537: [with patch] sage-env should set RM="rm -f"
----------------------+-----------------------------------------------------
Reporter: gfurnish | Owner: gfurnish
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7
Component: build | Resolution:
Keywords: | Author: gfurnish
Upstream: N/A | Reviewer:
Merged: | Work_issues:
----------------------+-----------------------------------------------------
Comment(by drkirkby):
Replying to [comment:18 jdemeyer]:
> My opinion still is that `RM` should simply be left unset (of course, a
few install scripts will have to be changed).
I agree 100%.
I can understand the logic of variables like $CC, $CXX, $MAKE, but not
$RM. I don't know of any system where one might want to specify what
version of {{{rm}}} gets used, so I don't see the point in having a
variable for it. If some dump package needs {{{$RM}}} defined, then either
try to fix the code so it is not so dumb, or add {{{$RM}}} to
{{{dump_package.spkg}}}.
BTW, take a look at
http://boxen.math.washington.edu/home/kirkby/bad-
code/sympow-1.018.1.p7/src/Configure
where you will find some ''interesting'' use of variable names. A script
which starts
{{{#!/bin/sh}}}
has a function
{{{whichexe()}}}
This function makes use of a non-POSIX command {{{which}}}, so there's no
reason for {{{which}}} to exist. Then {{{whichexe()}}} function sets
variables for things like SH, RM, SED, whilst checking if the commands
(including {{{sh}}}) exist. If not the script exits. An abbreviated
version is below.
{{{
#!/bin/sh
whichexe() {
if [ -f /bin/$1 ]; then
echo /bin/$1
return;
fi;
if [ -f /usr/bin/$1 ]; then
echo /usr/bin/$1
return;
fi;
if [ -f /usr/local/bin/$1 ]; then
echo /usr/local/bin/$1
return;
fi;
echo `which $1`
}
RM=`whichexe rm`
GREP=`whichexe grep` && echo "#define GREP \"$GREP\"" >> $CONFIG
SED=`whichexe sed` && echo "#define SED \"$SED\"" >> $CONFIG
SH=`whichexe sh` && echo "#define SH \"$SH\"" >> $CONFIG
if [ -z "$SH" ]; then
echo "**ERROR**: Could not find sh"; exit 1;
else
echo "SH = $SH"
fi
}}}
I might have cleaned this up, so the current version in Sage might not be
quite so dumb.
Dave
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/3537#comment:19>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.