https://trac.sagemath.org/ticket/33786 makes some related changes. Everyone is welcome to participate in the review of the ticket.
On Tuesday, May 3, 2022 at 2:30:00 PM UTC-7 hohoa...@gmail.com wrote: > Dear All, > > This hitch hiker has been enjoying scratching her itch (caused by a virus > from the Forth camp she visited many moons ago, smiley) > > She has been wondering, it cannot be this simple. She must have missed > something very important. Please help her to find out what she is missing. > > Her itch was to reduce the number of occurrence of 'resolvelinks()' from 3 > (1 in *$SAGE_ROOT/sage*, 1 in *$SAGE_SRC_BIN/sage* and 1 in > *$SAGE_SRC_BIN/sage-env*) to 1. > > - *$SAGE_ROOT/sage* was renamed to *$SAGE_ROOT/sage.sage* and the > function '*resolvelinks()*' was removed. > - *$SAGE_SRC_BIN/sage* was renamed to* > $SAGE_SRC_BIN/sage.src.bin.sage* and the function '*resolvelinks(*)' > was removed. > - *$SAGE_SRC_BIN/sage-env* was factored into > *$SAGE_SRC_BIN/sage.src.bin.sage-env* and *$SAGE_SRC_BIN/resolvelinks* > > You can name these files whatever you like, just modify the scripts below > (just one place to change for each name) > > Then, 3 glue files were created, it is critical that these files have > these names (all or just one of them?), otherwise the configuration scripts > will break: > > 1. *$SAGE_ROOT/sage* > 2. *$SAGE_SRC_BIN/sage* > 3. *$SAGE_SRC_BIN/sage-env* > > When copy&paste is needed(?) should only the glue files be so? They will > find out where are the files to be sourced based on these sign posts. > The code as it is now will break when there are fake sign posts in front > of true $SAGE_ROOT. It is just a proof of concept, right now. (Heavy duty > sed, awk scripts should be able to fix this?) > > If you build your own 'Sage' and like to have some fun with this > factoring, please try it out with your favorite use case scenarios to see > what is broken (Sage team might be able to help in fixing it?). > If the Sage team thinks Sage might benefit from this idea, please feel > free to do whatever they like to with it. > > Please find appended below the glue codes and your help is much > appreciated. > > Regards, > > phiho > > > > *<$SAGE_ROOT/sage>* > > > > > > > > > > > > > > > *SELF=$(readlink -f $0)SAGE_ROOT=`dirname > $SELF`RESOLVELINKS=$SAGE_ROOT/src/bin/resolvelinksSAGE_SAGE=$SAGE_ROOT/sage.sageif > > [ ! -f $RESOLVELINKS -o ! -f $SAGE_SAGE ]; then echo "$RESOLVELINKS > and/or $SAGE_SAGE not found" >&2 exit 1fi. $RESOLVELINKS. $SAGE_SAGE* > > *</$SAGE_ROOT/sage>* > > *<$SAGE_SRC_BIN/sage>* > > # > # Please note the following line need be replaced with a copy&paste > # > # . $SAGE_SRC_BIN/sage.src.bin.sage-sage-env.common > # > > > > > > > > > > > *SAGE_SRC_BIN_SAGE=$SAGE_SRC_BIN/sage.src.bin.sageif [ ! -f $RESOLVELINKS > ] || [ ! -f $SAGE_SRC_BIN_SAGE ]; then echo "$RESOLVELINKS and/or > $SAGE_SRC_BIN_SAGE not found" >&2 exit 1fi. $RESOLVELINKS. > $SAGE_SRC_BIN_SAGE* > *</$SAGE_SRC_BIN/sage>* > > > > *<$SAGE_SRC_BIN/sage-env>* > # > # Please note the following line need be replaced with a copy&paste > # > # . $SAGE_SRC_BIN/sage.src.bin.sage-sage-env.common > # > > > > > > > > > > *SAGE_ENV=$SAGE_SRC_BIN/sage.src.bin.sage-envif [ ! -f $RESOLVELINKS ] || > [ ! -f $SAGE_ENV ]; then echo "$RESOLVELINKS and/or $SAGE_ENV not found" > >&2 returnfi. $RESOLVELINKS. $SAGE_ENV* > > > *</$SAGE_SRC_BIN/sage-env>* > > > *<$SAGE_SRC_BIN/sage.src.bin.sage-sage-env.common>* > *SELF=$(readlink -f $0)* > > # > # Maybe the Sage team can help to verify if the list of sing posts is > exhaustive. > # > > > > > > > > > > > > > > > > > > > > > > > > > > *if [ ! -d "$SAGE_ROOT" ]; then for signpost in \ "/src/bin/" > \ "/build/bin/" \ "/local/var" \ > "/build/pkgs/sagelib/src/bin/" \ > "/build/pkgs/sagemath_categories/src/bin/" \ > "/build/pkgs/sagemath_objects/src/bin/" \ > "/pkgs/sagemath-categories/bin/" \ "/pkgs/sagemath-objects/bin/" \ > "/pkgs/sagemath-standard/bin/" \ > "/pkgs/sage-conf_pypi/sage_root/" \ "/pkgs/sagemath-standard/bin/" > \ "/pkgs/sage-conf_pypi/sage_root/" do SAGE_ROOT=$(echo > $SELF | sed "s:$pat.*$::") if [ -f $SAGE_ROOT/src/bin/resolvelinks > ]; then break fi > donefiSAGE_SRC_BIN=$SAGE_ROOT/src/binRESOLVELINKS=$SAGE_SRC_BIN/resolvelinks* > > ################################################################################################################# > # The above snippet is common to sage and sage-env copied and pasted > from sage.src.bin.sage-sage-env.common # > > ################################################################################################################# > > > *</$SAGE_SRC_BIN/sage.src.bin.sage-sage-env.common>* > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/f6791b0e-218b-4234-8118-0067a5c7a060n%40googlegroups.com.