forked from ungleich-public/cdist
bugfix: tell schroot which chroot to use
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
4faad3926b
commit
eea9a72676
1 changed files with 8 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
#
|
#
|
||||||
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
|
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
|
||||||
#
|
#
|
||||||
# This file is part of cdist.
|
# This file is part of cdist.
|
||||||
#
|
#
|
||||||
|
@ -49,7 +49,8 @@ my_name="${0##*/}"
|
||||||
mode="$1"; shift
|
mode="$1"; shift
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
echo "$@" | logger -t "cdist-$my_name-$mode"
|
# uncomment me for debugging
|
||||||
|
#echo "$@" | logger -t "cdist-$my_name-$mode"
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +110,9 @@ else
|
||||||
copy_prefix="cp"
|
copy_prefix="cp"
|
||||||
copy_destination_prefix=""
|
copy_destination_prefix=""
|
||||||
fi
|
fi
|
||||||
|
log "exec_prefix: $exec_prefix"
|
||||||
|
log "copy_prefix: $copy_prefix"
|
||||||
|
log "copy_destination_prefix: $copy_destination_prefix"
|
||||||
|
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
exec)
|
exec)
|
||||||
|
@ -118,8 +122,9 @@ case "$mode" in
|
||||||
;;
|
;;
|
||||||
copy)
|
copy)
|
||||||
# get directory for given chroot_name
|
# get directory for given chroot_name
|
||||||
schroot_directory="$($exec_prefix schroot $chroot_name --config | awk -F = '/directory=/ {print $2}')"
|
schroot_directory="$($exec_prefix schroot -c $schroot_name --config | awk -F = '/directory=/ {print $2}')"
|
||||||
[ -n "$schroot_directory" ] || die "Failed to retreive schroot directory for schroot: $schroot_name"
|
[ -n "$schroot_directory" ] || die "Failed to retreive schroot directory for schroot: $schroot_name"
|
||||||
|
log "schroot_directory: $schroot_directory"
|
||||||
# prefix destination with chroot
|
# prefix destination with chroot
|
||||||
code="$copy_prefix $(echo "$@" | sed "s|$uri:|${copy_destination_prefix}${schroot_directory}|g")"
|
code="$copy_prefix $(echo "$@" | sed "s|$uri:|${copy_destination_prefix}${schroot_directory}|g")"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue