On Fri, Feb 18, 2022 at 07:01:22PM +0100, Luk?? Doktor wrote:> Hello Rich, > > by any chance do you know whether it's possible to escape ':' in "virt-customize" command? I'm trying to upload a file: > > --upload '/etc/yum.repos.d/_copr\:copr.devel.redhat.com\:ndokos\:pbench.repo:/etc/yum.repos.d/' > > tried various combinations of doubling the ':' or escaping them and so on, but it always considers the first ':' as splitter.It's not possible because the function always splits on the first ':'... https://github.com/libguestfs/libguestfs-common/blob/41126802097f0a864cab8679ae8672b45914d54b/mlcustomize/customize_cmdline.ml#L139 ... but there's several workarounds. * Make a local copy of the file; you can still give the full name when you upload: $ cp /etc/yum.repos.d/_copr:copr.devel.redhat.com:ndokos:pbench.repo tmp.repo $ virt-customize .. --upload tmp.repo:/etc/yum.repos.d/full:name:including:colons.repo * If the file is small, --write + --move. * Use --copy-in (if you can copy the whole directory). * Use guestfish or the API. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
That was quick, thank you Rich. Temporarily I used the "cp" approach, but escaping possibility would be IMO useful, especially for automated setups where "--upload" args are generated automatically (my case). Regards, Luk?? Dne 18. 02. 22 v 20:00 Richard W.M. Jones napsal(a):> On Fri, Feb 18, 2022 at 07:01:22PM +0100, Luk?? Doktor wrote: >> Hello Rich, >> >> by any chance do you know whether it's possible to escape ':' in "virt-customize" command? I'm trying to upload a file: >> >> --upload '/etc/yum.repos.d/_copr\:copr.devel.redhat.com\:ndokos\:pbench.repo:/etc/yum.repos.d/' >> >> tried various combinations of doubling the ':' or escaping them and so on, but it always considers the first ':' as splitter. > > It's not possible because the function always splits on the first ':'... > > https://github.com/libguestfs/libguestfs-common/blob/41126802097f0a864cab8679ae8672b45914d54b/mlcustomize/customize_cmdline.ml#L139 > > ... but there's several workarounds. > > * Make a local copy of the file; you can still give the full name when > you upload: > > $ cp /etc/yum.repos.d/_copr:copr.devel.redhat.com:ndokos:pbench.repo tmp.repo > > $ virt-customize .. --upload tmp.repo:/etc/yum.repos.d/full:name:including:colons.repo > > * If the file is small, --write + --move. > > * Use --copy-in (if you can copy the whole directory). > > * Use guestfish or the API. > > Rich. >-------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0x26B362E47FCF22C1.asc Type: application/pgp-keys Size: 11966 bytes Desc: OpenPGP public key URL: <http://listman.redhat.com/archives/libguestfs/attachments/20220219/90eea22c/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 495 bytes Desc: OpenPGP digital signature URL: <http://listman.redhat.com/archives/libguestfs/attachments/20220219/90eea22c/attachment.sig>