Changeset 375 for branches


Ignore:
Timestamp:
07/02/2009 14:45:11 (3 years ago)
Author:
blee
Message:

Merging migration of global variables to functions from trunk.

Location:
branches/confman-1.9
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9

  • branches/confman-1.9/abspath.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/confman-1.9/conflock.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/confman-1.9/confman.in

    r358 r375  
    876876    local recipe="$1" 
    877877    local recipe_file=$(conf_tmp_file) 
    878     cat "${RECIPEDIR}/${recipe}" > "$recipe_file" 
     878    cat "$(conf_recipe_dir)/${recipe}" > "$recipe_file" 
    879879    $EDITOR "$recipe_file" 
    880880    for module in $(conf_get_recipe ${recipe_file}) ; do 
     
    911911    if [ -z "$1" ] ; then print_usage 1 ; fi 
    912912    local recipe="$1" 
    913     if ! [ -f "${RECIPEDIR}/${recipe}" ] ; then 
     913    if ! [ -f "$(conf_recipe_dir)/${recipe}" ] ; then 
    914914        echo "Error: recipe $recipe does not exist. Create it first!" >&2 
    915915        exit 1 
     
    921921    if [ -z "$1" ] ; then print_usage 1 ; fi 
    922922    local recipe="$1" 
    923     if ! [ -f "${RECIPEDIR}/${recipe}" ] ; then 
     923    if ! [ -f "$(conf_recipe_dir)/${recipe}" ] ; then 
    924924        echo "Error: recipe $recipe does not exist." >&2 
    925925        exit 1 
    926926    fi 
    927     cat "${RECIPEDIR}/${recipe}" 
     927    cat "$(conf_recipe_dir)/${recipe}" 
    928928} 
    929929     
    930930function recipe_list { 
    931     cd ${RECIPEDIR} 
     931    cd $(conf_recipe_dir) 
    932932    ls 
    933933} 
  • branches/confman-1.9/confmanlib.sh.in

    r372 r375  
    2929REPO_ACTION="${REPO_DB}/last_action" 
    3030REPO_SYNC_STATE="${REPO_DB}/state" 
    31 WCLOCKFILE="${WORK_PATH}/confman.lock" 
    32 METADIR="${WORK_PATH}/meta" 
    33 RECIPEDIR="${METADIR}/recipes" 
    3431RECIPE_NAME="$(cat "$RECIPE_FILE" 2>/dev/null)" 
    35 RECIPE_PATH="${RECIPEDIR}/${RECIPE_NAME}" 
    3632 
    3733VERSION="1.9.a" 
    3834REPO_VERSION="2" 
    39 REPO_VERSION_FILE="${METADIR}/rversion" 
    4035 
    4136# Prints the repository URI 
     
    5449 
    5550        echo $uri 
     51} 
     52 
     53function conf_meta_dir { 
     54    echo "${WORK_PATH}/meta" 
     55} 
     56 
     57function conf_recipe_dir { 
     58    echo "$(conf_meta_dir)/recipes" 
     59} 
     60 
     61function conf_recipe_path { 
     62    echo "$(conf_recipe_dir)/${RECIPE_NAME}" 
    5663} 
    5764 
     
    8592 
    8693# Functions for locking and unlocking both the system and the working copy 
     94function conf_wcopy_lockfile { 
     95    echo "${WORK_PATH}/confman.lock" 
     96} 
     97 
    8798function conf_lock_wcopy { 
    88     ${LOCK} lock $$ "$WCLOCKFILE" || exit 1 
     99    ${LOCK} lock $$ $(conf_wcopy_lockfile) || exit 1 
    89100} 
    90101 
    91102function conf_unlock_wcopy { 
    92     ${LOCK} unlock $$ "$WCLOCKFILE" 
     103    ${LOCK} unlock $$ $(conf_wcopy_lockfile) 
    93104} 
    94105 
    95106function conf_wcopy_is_locked { 
    96     ${LOCK} haslock $$ "$WCLOCKFILE" 
     107    ${LOCK} haslock $$ $(conf_wcopy_lockfile) 
    97108} 
    98109 
     
    253264            ;; 
    254265        recipe) 
    255             RECIPEDIR="${WORK_PATH}/meta/recipes" # until ticket #35 is resolved 
    256             for recipefile in ${RECIPEDIR}/*; do 
     266            for recipefile in $(conf_recipe_dir)/*; do 
    257267                modules="meta $(conf_get_recipe $recipefile)" 
    258                 tar -czf "$exportpath/${recipefile#$RECIPEDIR/}.tgz" -C "${WORK_PATH}" $modules 
     268                tar -czf "$exportpath/${recipefile#$(conf_recipe_dir)/}.tgz" -C "${WORK_PATH}" $modules 
    259269            done 
    260270            ;; 
     
    755765# Returns the current revision number of the repository on stdout 
    756766function conf_revision { 
    757     METADIR="${WORK_PATH}/meta" # until ticket #35 is resolved 
    758     @SVN@ info ${METADIR} | awk '/Last Changed Rev:/ {print $4}' 
     767    @SVN@ info $(conf_meta_dir) | awk '/Last Changed Rev:/ {print $4}' 
    759768} 
    760769 
     
    782791 
    783792    if [ -z "$recipe" ] ; then 
    784         recipe_file="$RECIPE_PATH" 
     793        recipe_file="$(conf_recipe_path)" 
    785794    fi 
    786795 
     
    812821function conf_recipe_create { 
    813822    local recipe="$1" 
    814     local recipe_file="${RECIPEDIR}/${recipe}" 
     823    local recipe_file="$(conf_recipe_dir)/${recipe}" 
    815824    if [ -f "${recipe_file}" ] ; then 
    816825        echo "Recipe $recipe already exists!" >&2 
     
    824833    local recipe="$1" 
    825834    local recipe_file="$2" 
    826     cat "$recipe_file" > "${RECIPEDIR}/${recipe}" 
    827     @SVN@ commit "${RECIPEDIR}/${recipe}" 
     835    cat "$recipe_file" > "$(conf_recipe_dir)/${recipe}" 
     836    @SVN@ commit "$(conf_recipe_dir)/${recipe}" 
    828837} 
    829838 
    830839function conf_remove_recipe { 
    831840    local recipe="$1" 
    832     local recipe_file="${RECIPEDIR}/${recipe}" 
     841    local recipe_file="$(conf_recipe_dir)/${recipe}" 
    833842    if ! [ -f "${recipe_file}" ] ; then 
    834843        echo "Recipe $recipe doesn't exist!" >&2 
Note: See TracChangeset for help on using the changeset viewer.