Changeset 500


Ignore:
Timestamp:
11/12/2009 14:30:46 (2 years ago)
Author:
blee
Message:

Merge from trunk singularity fixes for confman install and
minor recipe creation fix.

Resolves #102, #103, #104

Location:
branches/confman-1.9
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9

  • branches/confman-1.9/confman.in

    r494 r500  
    254254function inst { 
    255255    local file livefile 
    256     local msg status files file sing 
     256    local msg status files 
    257257    local nocommit=true 
    258258    local system_lock wcopy_lock 
    259259    local opt OPTIND OPTARG 
     260    local module 
    260261 
    261262    while getopts ":m:F:" opt ; do 
     
    270271    shift $(($OPTIND - 1)) 
    271272 
     273    [ -n "$1" ] || print_usage 1 
     274 
    272275    system_lock=$(conf_lock_system) 
    273276    wcopy_lock=$(conf_lock_wcopy) 
     
    290293     
    291294    for layer in $(conf_get_recipe) ; do 
    292         conf_install $layer "$@" 
     295        for file in "$@"; do 
     296            module=$(conf_wfile_module $file) 
     297            if conf_wfile_is_singularity $file; then 
     298                conf_install $layer "${file%-$module}-${layer}" 
     299            else 
     300                conf_install $layer "$file" 
     301            fi 
     302        done 
    293303    done 
    294304    for file in $SINGULARITIES ; do 
     
    10101020    if [ -z "$new_recipe_file" ] ; then 
    10111021        if ! recipe_edit "$recipe" ; then 
    1012             conf_rm_file --force "${new_recipe_file}" 
     1022            conf_rm_file --force "${recipe_file}" 
    10131023            conf_unlock_wcopy $wcopy_lock 
    10141024            return 1 
  • branches/confman-1.9/confmanlib.sh.in

    r494 r500  
    455455} 
    456456 
     457# Takes a working copy file path and returns the corresponding live file path 
    457458function conf_livefile { 
    458459    local file="$1" 
    459460    local path=$(conf_rel_path "$file") || return 
    460     echo ${path#*/}/ 
    461 } 
    462  
     461    echo /${path#*/} 
     462} 
     463 
     464# Takes a working copy file path and returns whether it is a singularity 
    463465function conf_wfile_is_singularity { 
     466    local file=$(${readlink_cmd} -m "$1") 
     467    local module=$(conf_wfile_module $file) 
     468    local livefile=$(conf_livefile $file) 
     469    local sing 
     470    for sing in $SINGULARITIES ; do 
     471        if [ "$sing" = ${livefile%-$module} ] ; then 
     472            return 0 
     473        fi 
     474    done 
     475    return 1 
     476} 
     477 
     478# Takes a working copy file path and returns the associated module 
     479function conf_wfile_module { 
    464480    local file=$(${readlink_cmd} -m "$1") 
    465481    ABS_WORK=$(${readlink_cmd} -m "$WORK_PATH") 
    466482    local module=${file#${ABS_WORK}/} 
    467483    module=${module%%/*} 
    468     local livefile=$(conf_livefile $file) 
    469     local sing 
    470     for sing in $SINGULARITIES ; do 
    471         if [ "$sing" = "${livefile%-$module}" ] ; then 
    472             return 0 
    473         fi 
    474     done 
    475     return 1 
     484    echo "$module" 
    476485} 
    477486 
Note: See TracChangeset for help on using the changeset viewer.