Do we need to be able to define cp, mkdir, touch, mv, chmod ?

4 views
Skip to first unread message

Dr. David Kirkby

unread,
Oct 7, 2009, 7:11:02 AM10/7/09
to sage-...@googlegroups.com
Looking in sage-env I see:

if [ "$MKDIR" = "" ]; then
MKDIR="mkdir"
fi

if [ "$CHMOD" = "" ]; then
CHMOD="chmod"
fi

if [ "$TOUCH" = "" ]; then
TOUCH="touch"
fi

if [ "$MV" != "" ]; then
MM="$MV"
fi

if [ "$CP" = "" ]; then
CP="cp"
fi


I'm wondering if this is really necessary to have these environment
variables. I might have been the one guilty of adding these to sage-env,
as I did work on it years ago, but I'm wondering now if we need these to
be user definable, or just use 'cp', 'mkdir' etc in scripts?

I'd propose deleting these, then of course testing that none are
actually used.

In the case of 'make' and 'tar' I think there are good reasons for using
the environment variables, as there are often different versions of make
and tar around, but I'm not so sure with the very basic commands.

William Stein

unread,
Oct 7, 2009, 7:40:59 AM10/7/09
to sage-...@googlegroups.com
On Wed, Oct 7, 2009 at 4:11 AM, Dr. David Kirkby <david....@onetel.net> wrote:

Looking in sage-env I see:

if [ "$MKDIR" = "" ]; then
    MKDIR="mkdir"
fi

if [ "$CHMOD" = "" ]; then
    CHMOD="chmod"
fi

if [ "$TOUCH" = "" ]; then
    TOUCH="touch"
fi

if [ "$MV" != "" ]; then
    MM="$MV"
fi

if [ "$CP" = "" ]; then
    CP="cp"
fi


I'm wondering if this is really necessary to have these environment
variables. I might have been the one guilty of adding these to sage-env,
as I did work on it years ago, but I'm wondering now if we need these to
be user definable, or just use 'cp', 'mkdir' etc in scripts?

It turns out that we don't.   That was unclear in 2005.    It used to be that I used a lot of Linux-ism's, e.g., "cp -a", etc., and an initial idea about how to get around that was to (1) continue with Linux-ism's "$CP -a", but on systems that don't support -a make sure that $CP does the equivalent thing.    This approach is too unfamiliar and confusing to the large number of people that do small amounts of work on spkg's; also, rightfully so, people have generally been much more interested (and enthusiastic) about eliminating all GNU-ism's from spkg-install's.
 

I'd propose deleting these, then of course testing that none are
actually used.

I agree with your proposal.

William
 

In the case of 'make' and 'tar' I think there are good reasons for using
the environment variables, as there are often different versions of make
and tar around, but I'm not so sure with the very basic commands.





--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
Reply all
Reply to author
Forward
0 new messages