Opened 6 months ago

Closed 6 months ago

Last modified 4 months ago

#2689 closed Defect (fixed)

latest Fmake_WORK.sh changes assume ln understands the -r option

Reported by: acc Owned by: acc
Priority: low Milestone:
Component: tools Version: trunk
Severity: minor Keywords:
Cc: Branch review:
MP ready?: Task progress:

Description (last modified by acc)

Context

Recent improvements to correctly enable the specification and use of alternative MY_SRC directories may break on some systems.

Analysis

The cause is the use of ln -r to create links relative to the current directory. This option is not understood by all versions of ln.

Recommendation

It will be more robust to be set the links explicitly. This works:

  • Fmake_WORK.sh

     
    8282      ln -sf ${ZDIR}/*.[Ffh]90 ${ZCONF}/WORK/. 
    8383      echo ${ZDIR}' content is linked to '${ZCONF}/WORK 
    8484    elif [ -d ${ZCONF}/${ZDIR} ] ; then 
    85       ln -rsf ${ZCONF}/${ZDIR}/*.[Ffh]90 ${ZCONF}/WORK/. 
    86       echo ${ZDIR}' content is linked to '${ZCONF}/WORK 
     85        for ff in ${ZCONF}/${ZDIR}/*.[Ffh]90 
     86        do 
     87         f=`basename $ff` 
     88         ln -sf ../${ZDIR}/$f ${ZCONF}/WORK/. 
     89        done 
     90      echo ${ZCONF}/${ZDIR}' content is linked to '${ZCONF}/WORK 
    8791    else 
    88       ln -rsf ${ZCONF}/MY_SRC/*.[Ffh]90 ${ZCONF}/WORK/. 
    89       echo 'External directory for MY_SRC does not exist. Using default.' 
    90       echo 'MY_SRC content is linked to '${ZCONF}/WORK 
     92        for ff in ${ZCONF}/MY_SRC/*.[Ffh]90 
     93        do 
     94         f=`basename $ff` 
     95         ln -sf ../MY_SRC/$f ${ZCONF}/WORK/. 
     96        done 
     97      echo 'External directory for MY_SRC unspecified or does not exist. Using default.' 
     98      echo ${ZCONF}/MY_SRC' content is linked to '${ZCONF}/WORK 
    9199    fi 
    92100done 

and will be submitted later if no one has a better idea.

Commit History (2)

ChangesetAuthorTimeChangeLog
15186gsamson2021-08-12T18:39:09+02:00

simplify commit done at r14979 (#2689) and restore MY_SRC subdir links introduced at r13528

14979acc2021-06-11T15:25:26+02:00

#2689 . Replace use of ln -r in Fmake_WORK.sh with a POSIX2-compliant alternative. No change in behaviour expected but should work on all systems

Change History (5)

comment:1 Changed 6 months ago by acc

  • Description modified (diff)

comment:2 Changed 6 months ago by acc

  • Status changed from new to assigned
  • Summary changed from lates Fmake_WORK.sh changes assume ln understands the -r option to latest Fmake_WORK.sh changes assume ln understands the -r option

comment:3 Changed 6 months ago by acc

In 14979:

#2689 . Replace use of ln -r in Fmake_WORK.sh with a POSIX2-compliant alternative. No change in behaviour expected but should work on all systems

comment:4 Changed 6 months ago by acc

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:5 Changed 4 months ago by gsamson

In 15186:

simplify commit done at r14979 (#2689) and restore MY_SRC subdir links introduced at r13528

Note: See TracTickets for help on using tickets.