Pino Toscano
2014-Feb-12 14:30 UTC
[Libguestfs] [PATCH 2/2] mllib: hostname: add a newline in /etc/hostname
/etc/hostname usually has an ending newline, so add it when changing it. --- mllib/hostname.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mllib/hostname.ml b/mllib/hostname.ml index e1c5d4b..cffba6b 100644 --- a/mllib/hostname.ml +++ b/mllib/hostname.ml @@ -79,7 +79,7 @@ and replace_line_in_file g filename key value g#write filename content and update_etc_hostname g hostname - g#write "/etc/hostname" hostname + g#write "/etc/hostname" (hostname ^ "\n") and update_etc_machine_info g hostname replace_line_in_file g "/etc/machine-info" "PRETTY_HOSTNAME" hostname -- 1.8.3.1
Richard W.M. Jones
2014-Feb-12 17:37 UTC
Re: [Libguestfs] [PATCH 2/2] mllib: hostname: add a newline in /etc/hostname
On Wed, Feb 12, 2014 at 03:30:53PM +0100, Pino Toscano wrote:> /etc/hostname usually has an ending newline, so add it when changing it. > --- > mllib/hostname.ml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mllib/hostname.ml b/mllib/hostname.ml > index e1c5d4b..cffba6b 100644 > --- a/mllib/hostname.ml > +++ b/mllib/hostname.ml > @@ -79,7 +79,7 @@ and replace_line_in_file g filename key value > g#write filename content > > and update_etc_hostname g hostname > - g#write "/etc/hostname" hostname > + g#write "/etc/hostname" (hostname ^ "\n") > > and update_etc_machine_info g hostname > replace_line_in_file g "/etc/machine-info" "PRETTY_HOSTNAME" hostname > -- > 1.8.3.1ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Maybe Matching Threads
- [PATCH 1/2] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).
- Re: [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).
- [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).
- [PATCH] inspect: recognize the Kali Linux distribution (RHBZ#1544227)
- [PATCH] customize, sysprep, v2v: handle Kali Linux as Debian