[one-users] possible bug on tm_mad/common/context
Olivier Sallou
olivier.sallou at irisa.fr
Mon Mar 3 05:46:57 PST 2014
After deeper tests, quotes are not the issue, it is just that if target
contains a directory path, it is not created, and cp fails.
A "mkdir -p basename_of_target" would solve the issue and allow to copy
files in a subdirectory.
Current code only allows the renaming of a file, not copying it in
sub-directories of the CDROM.
Olivier
On 03/03/2014 02:33 PM, Olivier Sallou wrote:
> Hi,
> I made some tests and looking at code of tm_context, I think there is
> a possible bug:
> (src/tm_mad/common/context)
>
> In code:
>
> for f in "${SRC[@]}"; do
> case "$f" in
> http://*)
> exec_and_set_error "$WGET -P $ISO_DIR $f" "Error downloading $f"
> ;;
> *)
> if echo "$f" | grep -q ':'; then
> target=$(echo "$f"|cut -d':' -f2-)
> target="'$target'"
> f=$(echo "$f"|cut -d':' -f1)
>
>
> If a target is set with something like : f =
> /path_to_my_file:subdir/my_file
>
> target is then set with quotes, in the above example
> target='subdir/myfile'
>
> Following command is:
>
> exec_and_set_error "cp -R $f $ISO_DIR/$target" \
> "Error copying $f to $ISO_DIR"
>
> The cp will fail: cp -R /path_to_my_file $ISO_DIR/'subdir/myfile'
> There are quotes in cp target path.
>
> Am I correct. I made a try and it failed, but I wonder if it is code
> part or an other error I made somewhere else.
>
> Olivier
>
> --
> Olivier Sallou
> IRISA / University of Rennes 1
> Campus de Beaulieu, 35000 RENNES - FRANCE
> Tel: 02.99.84.71.95
>
> gpg key id: 4096R/326D8438 (keyring.debian.org)
> Key fingerprint = 5FB4 6F83 D3B9 5204 6335 D26D 78DC 68DB 326D 8438
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
--
Olivier Sallou
IRISA / University of Rennes 1
Campus de Beaulieu, 35000 RENNES - FRANCE
Tel: 02.99.84.71.95
gpg key id: 4096R/326D8438 (keyring.debian.org)
Key fingerprint = 5FB4 6F83 D3B9 5204 6335 D26D 78DC 68DB 326D 8438
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20140303/ecab1d65/attachment-0002.htm>
More information about the Users
mailing list