Changeset 586
- Timestamp:
- 12/23/2011 00:42:07 (5 months ago)
- Location:
- branches/confman-1.9
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
confexport.in (modified) (1 diff)
-
confman.conf.5.in (modified) (1 diff)
-
confman.conf.in (modified) (2 diffs)
-
confmancommon.sh.in (modified) (1 diff)
-
confmanlib.sh.in (modified) (9 diffs)
-
confsync.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/confman-1.9
-
branches/confman-1.9/confexport.in
r571 r586 145 145 old_conf_export=$(conf_tmp_dir) 146 146 if [ -e "${CONF_EXPORT_FILE}" ]; then 147 mv "${CONF_EXPORT_FILE}" "${old_conf_export}" || exit 1147 mv "${CONF_EXPORT_FILE}" "${old_conf_export}" || exit 1 148 148 fi 149 149 mv "${temp_conf_export}" "${CONF_EXPORT_FILE}" -
branches/confman-1.9/confman.conf.5.in
r567 r586 121 121 .Xr cp 1 . This option can only be used if temporary files are created 122 122 on the same filesystem partition as CONF_EXPORT_FILE. 123 .It CONF_EXPORT_FILEDB 124 This option optimizes 125 .Xr confexport 8 and 126 .Xr confsync 8 performance. When enabled, 127 .Xr confexport 8 will convert repository metadata from Subversion metadata 128 into a proprietary file-backed metadata format and exclude all Subversion 129 working-copy-related files from exports. This significantly reduces the 130 file size of export tarballs. This also eliminates the previous requirement 131 that the version of Subversion be matched between 132 .Xr confexport 8 and 133 .Xr confsync 8 machines. 123 134 .It CONF_FETCH_SSH_KEY 124 135 This is a private SSH keyfile for use with "sftp://" and "scp://" URIs above. -
branches/confman-1.9/confman.conf.in
r567 r586 18 18 REPO_DOCS_CONFMAN="@pkgdatadir@/confmandoc.sh" 19 19 REPO_DOCS_CONFADMIN="@pkgdatadir@/confadmindoc.sh" 20 21 # The location of the filedb library 22 FILEDB_LIBRARY="@pkgdatadir@/libfiledb.sh" 20 23 21 24 # The system lockfile … … 82 85 CONF_EXPORT_INCREMENTAL="false" 83 86 CONF_EXPORT_INCREMENTAL_LN="false" 87 CONF_EXPORT_FILEDB="false" 84 88 EXPORT_REPO_PROTOCOL="" 85 89 EXPORT_REPO_HOSTNAME="" -
branches/confman-1.9/confmancommon.sh.in
r560 r586 133 133 fi 134 134 135 # Source the filedb library 136 if [ -r "${FILEDB_LIBRARY}" ]; then 137 . "${FILEDB_LIBRARY}" 138 else 139 echo "Could not load filedb library: ${FILEDB_LIBRARY}" >&2 140 exit 1 141 fi 142 135 143 # Create and/or fix permissions on our local state directory 136 144 if ! [ -d "$REPO_DB" ] ; then -
branches/confman-1.9/confmanlib.sh.in
r580 r586 34 34 CONF_EXPORT="false" 35 35 LOG_MESSAGE_SET="false" 36 CONF_GET_PROP_USE_FDB="false" # XXX: Until ticket #151 is resolved 36 37 37 38 VERSION='@VERSION@' … … 401 402 function conf_status { 402 403 @SVN@ status $* 404 } 405 406 # XXX: Until we completely change metadata formats (ticket #151), provide 407 # a way to convert Subversion properties into an fdb 408 function conf_convert_metadata { 409 local module="$1" 410 411 local moduledir 412 declare -A metadata 413 414 metadata["module"]="${module}" 415 416 if [ "${module}" = "meta" ]; then 417 metadata["revision"]=`conf_revision_svn` 418 filedb_write "metadata" "`conf_meta_dir`/${module}.fdb" 419 unset metadata 420 return 0 421 fi 422 423 moduledir="${WORK_PATH}/${module}" 424 425 for directory in `find -L "${moduledir}" -mindepth 1 -type d -not -name '.svn' -not -path '*/.svn/*'`; do 426 owner=`conf_get_prop ${directory} owner` 427 group=`conf_get_prop ${directory} group` 428 mode=`conf_get_prop ${directory} mode` 429 430 directory="${directory#${moduledir}}" 431 metadata["${directory}:owner"]="${owner}" 432 metadata["${directory}:group"]="${group}" 433 metadata["${directory}:mode"]="${mode}" 434 done 435 436 for file in `find -L "${moduledir}" -mindepth 1 -type f -not -path '*/.svn/*'`; do 437 owner=`conf_get_prop ${file} owner` 438 group=`conf_get_prop ${file} group` 439 mode=`conf_get_prop ${file} mode` 440 symlink="`conf_get_prop ${file} symlink`" 441 442 file="${file#${moduledir}}" 443 metadata["${file}:owner"]="${owner}" 444 metadata["${file}:group"]="${group}" 445 metadata["${file}:mode"]="${mode}" 446 metadata["${file}:symlink"]="${symlink}" 447 done 448 449 filedb_write "metadata" "`conf_meta_dir`/${module}.fdb" 450 unset metadata 403 451 } 404 452 … … 431 479 432 480 # Preserve old module exports where possible 433 for module in $(ls -1 ${WORK_PATH} | egrep -v '^(\.svn| checkpoints)$'); do481 for module in $(ls -1 ${WORK_PATH} | egrep -v '^(\.svn|meta|checkpoints)$'); do 434 482 # If this module has changed, move on to the next one 435 483 for changed_module in ${changed_modules}; do … … 449 497 450 498 modules="${changed_modules}" 499 500 # XXX: Metadata needs to be regenerated unconditionally for now 501 modules="meta ${modules}" 451 502 else 452 modules=$(ls -1 ${WORK_PATH} | egrep -v '^(\.svn|checkpoints)$') # until ticket $40 is resolved 503 # XXX: Until ticket #40 is resolved 504 modules=$(ls -1 ${WORK_PATH} | egrep -v '^(\.svn|checkpoints)$') 453 505 fi 454 506 455 for module in ${modules}; do 456 echo "Generating new export for module: ${module}" 457 tar -hczf "${exportpath}/${module}.tgz" -C "${WORK_PATH}" ${module} || return 1 458 done 507 if ${CONF_EXPORT_FILEDB}; then 508 for module in ${modules}; do 509 echo "Converting metadata for module: ${module}" 510 conf_convert_metadata "${module}" 511 512 echo "Generating new export for module: ${module}" 513 tar -hczf "${exportpath}/${module}.tgz" -C "${WORK_PATH}" --exclude='*.svn*' ${module} "meta/${module}.fdb" || return 1 514 515 # XXX: The fdbs aren't versioned yet (ticket #151), so 516 # it's not necessary to keep them around because they 517 # will be regenerated anyway when the module changes 518 rm -f "$(conf_meta_dir)/${module}.fdb" || return 1 519 done 520 else 521 for module in ${modules}; do 522 echo "Generating new export for module: ${module}" 523 tar -hczf "${exportpath}/${module}.tgz" -C "${WORK_PATH}" ${module} || return 1 524 done 525 fi 459 526 ;; 460 527 recipe) … … 507 574 conf_debug "updated_recipes: ${updated_recipes}" 508 575 576 modules="${changed_modules}" 509 577 recipes="${changed_recipes} ${updated_recipes}" 578 579 # XXX: Metadata needs to be regenerated unconditionally for now 580 modules="meta ${modules}" 510 581 else 582 # XXX: Until ticket #40 is resolved 583 modules=`ls -1 ${WORK_PATH} | egrep -v '^(\.svn|checkpoints)$'` 511 584 recipes=$(ls -1 "$(conf_recipe_dir)"| egrep -v '^\.svn$') 512 585 fi 513 586 514 for recipe in ${recipes}; do 515 echo "Generating new export for recipe: ${recipe}" 516 modules=$(conf_get_recipe $(conf_recipe_dir)/${recipe}) 517 tar -hczf "${exportpath}/${recipe}.tgz" -C "${WORK_PATH}" "meta/.svn/entries" "meta/recipes/${recipe}" ${modules} || return 1 518 done 587 if ${CONF_EXPORT_FILEDB}; then 588 for module in ${modules}; do 589 echo "Regenerating metadata for module: ${module}" 590 conf_convert_metadata "${module}" 591 done 592 593 for recipe in ${recipes}; do 594 echo "Generating new export for recipe: ${recipe}" 595 modules=$(conf_get_recipe $(conf_recipe_dir)/${recipe}) 596 tar -hczf "${exportpath}/${recipe}.tgz" -C "${WORK_PATH}" --exclude='*.svn*' "meta/meta.fdb" "meta/recipes/${recipe}" $(for module in ${modules}; do echo "meta/${module}.fdb"; done) ${modules} || return 1 597 done 598 else 599 for recipe in ${recipes}; do 600 echo "Generating new export for recipe: ${recipe}" 601 modules=$(conf_get_recipe $(conf_recipe_dir)/${recipe}) 602 tar -hczf "${exportpath}/${recipe}.tgz" -C "${WORK_PATH}" "meta/.svn/entries" "meta/recipes/${recipe}" ${modules} || return 1 603 done 604 fi 519 605 ;; 520 606 *) … … 556 642 ${NFS_HACK:-false} && chmod o+rx ${WORK_PATH} 557 643 558 # Test to see if the SVN working copy is out of date 559 if ! @SVN@ info $moduledir >/dev/null ; then 560 echo "Error: $moduledir isn't usable by svn." >&2 561 exit 1 644 # XXX: Until ticket #151 is resolved, prefer to use the fdb metadata 645 # when it is available 646 if ! ${CONF_GET_PROP_USE_FDB}; then 647 # Test to see if the SVN working copy is out of date 648 if ! @SVN@ info $moduledir >/dev/null ; then 649 echo "Error: $moduledir isn't usable by svn." >&2 650 exit 1 651 fi 562 652 fi 563 653 … … 775 865 myfile="${WORK_PATH}/${layer}/${file}-${layer}" 776 866 if [ -f $myfile ] && $SUDO [ -f $livepart ] ; then 777 owner=`conf_get_prop ${myfile} owner` 778 group=`conf_get_prop ${myfile} group` 779 mode=`conf_get_prop ${myfile} mode` 780 comment=`conf_get_prop ${myfile} comment` 867 eval `$SUDO ${stat_cmd} "${stat_opts}" "${livepart}"` 781 868 $SUDO cat $livepart >> $tmpfile 782 869 $SUDO rm $livepart … … 901 988 # This function will print the value of the specified property to STDOUT 902 989 function conf_get_prop { 903 local file=$1 904 local prop=$2 905 local result=`@SVN@ propget "confman:${prop}" ${file}` 906 if [ -z "$result" ] ; then 907 file=`$readlink_cmd -m ${file}` 908 @SVN@ propget "confman:${prop}" ${file} 909 else 910 echo $result 911 fi 990 local file="$1" 991 local prop="$2" 992 993 local moduledir 994 local result 995 996 # XXX: Until ticket #151 is resolved, prefer to use the fdb metadata 997 # when it is available 998 if ${CONF_GET_PROP_USE_FDB}; then 999 moduledir="${WORK_PATH}/${metadata[module]}" 1000 file="${file#${moduledir}}" 1001 result="${metadata[${file}:${prop}]}" 1002 else 1003 result=`@SVN@ propget "confman:${prop}" ${file}` 1004 if [ -z "$result" ] ; then 1005 file=`$readlink_cmd -m ${file}` 1006 result=`@SVN@ propget "confman:${prop}" ${file}` 1007 fi 1008 fi 1009 1010 echo "${result}" 912 1011 } 913 1012 … … 1131 1230 # Returns the current revision number of the repository on stdout 1132 1231 function conf_revision { 1133 @SVN@ info $(conf_meta_dir) | awk '/^Revision:/ {print $2}' 1232 # XXX: Until ticket #151 is resolved, prefer to use the fdb 1233 # when it is available 1234 if [ -r "$(conf_meta_dir)/meta.fdb" ]; then 1235 conf_revision_fdb "$@" 1236 else 1237 conf_revision_svn "$@" 1238 fi 1239 } 1240 1241 # Returns the current revision number of the repository using Subversion 1242 function conf_revision_svn { 1243 @SVN@ info "$(conf_meta_dir)" | awk '/^Revision:/ {print $2}' 1244 } 1245 1246 # Returns the current revision number of the repository using filedb 1247 function conf_revision_fdb { 1248 declare -A metadata 1249 filedb_load "$(conf_meta_dir)/meta.fdb" metadata 1250 echo "${metadata["revision"]}" 1251 unset metadata 1134 1252 } 1135 1253 -
branches/confman-1.9/confsync.in
r568 r586 134 134 for layer in $(conf_get_reverse_recipe) ; do 135 135 echo "Rolling on $layer..." 136 137 # XXX: Until ticket #151 is resolved, prefer to use the fdb metadata 138 # when it is available 139 if [ -r "$(conf_meta_dir)/${layer}.fdb" ]; then 140 declare -A metadata 141 filedb_load "$(conf_meta_dir)/${layer}.fdb" "metadata" 142 CONF_GET_PROP_USE_FDB="true" 143 fi 144 136 145 conf_rollout $layer $statefile || conf_cleanExit 146 147 if ${CONF_GET_PROP_USE_FDB}; then 148 unset metadata 149 fi 137 150 done 138 151 for file in $SINGULARITIES ; do
Note: See TracChangeset
for help on using the changeset viewer.
