From: Richard Jones Date: Sun, 26 Apr 2009 06:05:12 +0000 (+0100) Subject: Don't echo output in scripts. X-Git-Tag: 1.0.13~8 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=e65e1d5d0053431702bc99e5d59725324adf1af5 Don't echo output in scripts. --- diff --git a/fish/fish.c b/fish/fish.c index 812197c..132c52c 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -277,17 +277,21 @@ rl_gets (int prompt) { #ifdef HAVE_LIBREADLINE - if (line_read) { - free (line_read); - line_read = NULL; - } + if (prompt) { + if (line_read) { + free (line_read); + line_read = NULL; + } - line_read = readline (prompt ? FISH : ""); + line_read = readline (prompt ? FISH : ""); - if (prompt && line_read && *line_read) - add_history_line (line_read); + if (line_read && *line_read) + add_history_line (line_read); -#else /* !HAVE_LIBREADLINE */ + return line_read; + } + +#endif /* HAVE_LIBREADLINE */ static char buf[8192]; int len; @@ -300,8 +304,6 @@ rl_gets (int prompt) if (len > 0 && buf[len-1] == '\n') buf[len-1] = '\0'; } -#endif /* !HAVE_LIBREADLINE */ - return line_read; } diff --git a/recipes/clone.example b/recipes/clone.example index 8e8a1c1..40b4df1 100644 --- a/recipes/clone.example +++ b/recipes/clone.example @@ -2,9 +2,6 @@ $ clone.sh /tmp/test.img /tmp/new.img /dev/sda1 192.168.1.1 newmachine 204800+0 records in 204800+0 records out 104857600 bytes (105 MB) copied, 2.02821 s, 51.7 MB/s -write-file /etc/resolv.conf "nameserver 192.168.1.1" 0 -write-file /etc/HOSTNAME "newmachine" 0 -sync $ guestfish -a /tmp/new.img -m /dev/sda1 diff --git a/recipes/rpmqa.example b/recipes/rpmqa.example index 44eb649..837186a 100644 --- a/recipes/rpmqa.example +++ b/recipes/rpmqa.example @@ -1,14 +1,14 @@ $ ./rpmqa.sh RHEL53PV32.img /dev/VolGroup00/LogVol00 > /tmp/rpms $ ls -l /tmp/rpms --rw-rw-r--. 1 rjones rjones 17324 2009-04-26 06:47 /tmp/rpms +-rw-rw-r--. 1 rjones rjones 17228 2009-04-26 07:02 /tmp/rpms $ head /tmp/rpms -add "RHEL53PV32.img" -run -mount-ro "/dev/VolGroup00/LogVol00" / -command "rpm -qa" tzdata-2008i-1.el5 nash-5.1.19.6-44 gnome-mime-data-2.4.2-3.1 dump-0.4b41-2.fc6 emacs-leim-21.4-20.el5 rootfiles-8.1-1.1.1 +glibc-2.5-34 +popt-1.10.2.3-9.el5 +libart_lgpl-2.3.17-4 +audit-libs-1.7.7-6.el5 diff --git a/recipes/show-devices.example b/recipes/show-devices.example index ccab9ef..d93857e 100644 --- a/recipes/show-devices.example +++ b/recipes/show-devices.example @@ -1,14 +1,8 @@ $ show-devices.sh /dev/mapper/Guests-RHEL53PV32 -run -list-devices /dev/sda -list-partitions /dev/sda1 /dev/sda2 -pvs /dev/sda2 -vgs VolGroup00 -lvs /dev/VolGroup00/LogVol00 /dev/VolGroup00/LogVol01 diff --git a/recipes/tar2vm.example b/recipes/tar2vm.example index 97a054f..1ca0379 100644 --- a/recipes/tar2vm.example +++ b/recipes/tar2vm.example @@ -1,8 +1 @@ -tar2vm.sh ../libguestfs-1.0.10.tar.gz /tmp/test.img 10M -alloc /tmp/test.img 10M -run -sfdisk /dev/sda 0 0 0 , -mkfs ext3 /dev/sda1 -mount /dev/sda1 / -tgz-in ../libguestfs-1.0.10.tar.gz / -umount-all +$ ./tar2vm.sh ../libguestfs-1.0.10.tar.gz /tmp/test.img 10M