search for: read_lines

Displaying 20 results from an estimated 95 matches for "read_lines".

2015 Oct 09
1
[PATCH] inspect: Don't free uninitialized string.
libguestfs: trace: v2v: read_lines "/etc/os-release" [...] libguestfs: trace: v2v: read_lines = ["NAME=Fedora", "VERSION="20 (Heisenbug)"", "ID=fedora", "VERSION_ID=20", "PRETTY_NAME="Fedora 20 (Heisenbug)"", "ANSI_COLOR="0;34"", &quo...
2012 Apr 18
1
[PATCH RFC] sysprep: remove user accounts
...fth Floor, Boston, MA 02110-1301 USA. + *) + +open Sysprep_operation + +module G = Guestfs + +let user_account_perform g root = + let typ = g#inspect_get_type root in + if typ <> "windows" then ( + let login_def = "/etc/login.defs" in + let lines = Array.to_list (g#read_lines login_def) in + let line_min = Array.filter ( + fun line -> (string_prefix line "UID_MIN") + ) lines in + let _,min_uid = sscanf line_min "%s %d" (fun a b -> a,b) in + let line_max = Array.filter ( + fun line -> (string_prefix line "UID_MAX&qu...
2012 Sep 19
1
[PATCH 1/1] lua: Enabling io.read() in Lua.c32 with some restrictions
From: Hung-chi Lihn <hlihn at google.com> The current Lua.c32 does not enable io.read() due to some missing library functions. However, this strongly limits the Lua script from getting user inputs and reading files (even in pxelinux via TFTP). This patch enables io.read() in Lua.c32 with some restrictions: 1. the io.read("*line") is fully supported. 2. the
2002 Apr 03
4
Patch to avoid 'Connection reset by peer' error for rsync on cygwin
The problem is caused because rsync does not close its sockets, and WinSock is a quite strict on this. The solution is to shutdown and close the fd. This is a 5-minute hack I've done to fix the obvious occurrences of the problem. It might be better to extend rsyncs cleanup functions for this, but here it is anyway to alert people to the problem and its fix. Max. BEGIN PATCH diff -mru
2001 Nov 20
2
rsync server over SSH [includes code patches]
Hi Folks -- I've recently had the need to add a piece of functionality to rsync that allows one to run 'rsync --daemon' (rsync in "rsync server" mode) over SSH. My main goal was to be able to use some of the features from rsyncd.conf(5) (notably modules) while still using SSH for authentication and network transport. Background: I wanted to have the capability of setting
2002 May 09
0
[PATCH] (Resubmission) 'Connection reset by peer' with rsync server on cygwin
Hello? Concerns were raised about the action of shutdown() on Unices - I replied with evidence suggesting that this would not be a problem. I have not heard anything since. If this has to be held over to 2.6.0, fair enough - but please tell me whether itjust needs time, or me to go and fix something??? Thanks Max. BEGIN PATCH diff -mru rsync-2.5.5/clientserver.c
2001 Aug 22
1
@RSYNC EXIT / @RSYNC EOF
tridge and Wayne in particular: I checked in this patch, which is meant to consolidate the ones from both of you for handling EOF in a modules list. The idea is that we need to handle servers that just close the socket rather than sending a nice ending token, but we want to keep EOF detection on in general. (The IO code is such a mess!) -- Martin Index: clientserver.c
2014 Feb 13
2
Re: [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).
On Thursday 13 February 2014 13:33:16 Richard W.M. Jones wrote: > On Thu, Feb 13, 2014 at 02:15:31PM +0100, Pino Toscano wrote: > > + let expr = "/files/etc/hosts/*[label() != '#comment']/*[label() > > != 'ipaddr'][. = '" ^ oldhost ^ "']" in > Quoting? If oldhost contains a ' character + some Augeas code, this > might be
2014 Feb 12
2
[PATCH 1/2] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).
...ostname g hostname = and update_etc_machine_info g hostname = replace_line_in_file g "/etc/machine-info" "PRETTY_HOSTNAME" hostname + +and read_etc_hostname g = + let filename = "/etc/hostname" in + if g#is_file filename then ( + let lines = Array.to_list (g#read_lines filename) in + match lines with + | hd :: _ -> Some hd + | [] -> None + ) else + None + +and replace_host_in_etc_hosts g oldhost newhost = + let filename = "/etc/hosts" in + if g#is_file filename then ( + Perl_edit.edit_file ~debug:false g filename + ("s,...
2002 Jan 13
0
rsynd-2.5.1 / io.c patches
Platform: Compaq OpenVMS Alpha 7.3 Compiler: Compaq C T6.5 The following patch resolves compile problems with the IO.C module. The (char) type was being used where (void) was more appropriate based on the actual use of the code. The (char) type was also being used where the usage was actually an (unsigned char). const qualifiers were added to improve compile efficiency. EAGLE> type
2012 Sep 03
2
[PATCH] sysprep: remove hostname from ifcfg-*
..."|"centos"|"scientificlinux"|"redhat-based") -> + let filenames = g#glob_expand "/etc/sysconfig/network-scripts/ifcfg-*" in + Array.iter ( + fun filename -> + (* Replace HOSTNAME=... entry. *) + let lines = Array.to_list (g#read_lines filename) in + let lines = List.filter ( + fun line -> not (string_prefix line "HOSTNAME=") + ) lines in + let file = String.concat "\n" lines ^ "\n" in + g#write filename file + ) filenames; + + if filenames <> [||]...
2017 Dec 14
4
cannot destroy connection (?) created by readLines in a tryCatch
..., that's often a possible workaround, but since this connection was opened by readLines() internally, I don't necessarily know which one it is. E.g. I might open multiple connections to the same file, so I can't choose based on the file name. Btw. this workaround seems to work for me: read_lines <- function(con, ...) { if (is.character(con)) { con <- file(con) on.exit(close(con)) } readLines(con, ...) } This is basically the same as readLines(), but on.exit() does its job here. That's another clue that it might be an on.exit() issue. Wild guess: on.exit() does not...
2017 Jan 03
0
[PATCH 5/5] Add a virt-builder-repository tool
virt-builder-repository allows users to easily create or update a virt-builder source repository out of disk images. The tool can be run in either interactive or automated mode. --- .gitignore | 3 + builder/Makefile.am | 91 ++++++- builder/builder_repository.ml | 493 ++++++++++++++++++++++++++++++++++++ builder/virt-builder-repository.pod | 144
2006 Mar 20
1
RJS & IE Woes
Hi, I''m trying to do a very simple slide_down effect with RJS templates. Basically a user selects a check box and a text box slides down. This works great in firefox, but causes IE to crash. The text box appears and slides down. Then the browser crashes. the in the partial is <div id=''forklift_div''> <label for=''incident_forklift''>Was
2017 Mar 07
0
[PATCH v4 9/9] Add a virt-builder-repository tool
virt-builder-repository allows users to easily create or update a virt-builder source repository out of disk images. The tool can be run in either interactive or automated mode. --- .gitignore | 3 + builder/Makefile.am | 81 ++++++- builder/repository_main.ml | 466 ++++++++++++++++++++++++++++++++++++ builder/test-docs.sh | 2
2017 Mar 23
0
[PATCH v5 10/10] Add a virt-builder-repository tool
virt-builder-repository allows users to easily create or update a virt-builder source repository out of disk images. The tool can be run in either interactive or automated mode. --- .gitignore | 3 + builder/Makefile.am | 81 +++++- builder/repository_main.ml | 488 ++++++++++++++++++++++++++++++++++++ builder/test-docs.sh | 2
2017 Feb 10
0
[PATCH v3 10/10] Add a virt-builder-repository tool
virt-builder-repository allows users to easily create or update a virt-builder source repository out of disk images. The tool can be run in either interactive or automated mode. --- .gitignore | 3 + builder/Makefile.am | 82 +++++- builder/repository_main.ml | 487 ++++++++++++++++++++++++++++++++++++ builder/test-docs.sh | 3
2002 Feb 18
1
fixes for bugs in error handling in rsync-2.5.2; and updates for rsync3.txt
Rsync-2.5.2 does not gracefully report connection and transfer errors and always properly return with a non-zero exit code, despite many assurances to the contrary in the code and commit logs. It seems a kludge to handle a special case of lost connections to older servers was FAR too aggressive! With '-vvv' I also print the source of the exit_cleanup() call, and optionally with
2017 Feb 28
1
[PATCH] sysprep: Remove DHCP_HOSTNAME= from ifcfg-* files (RHBZ#1427529).
...root side_effects = let filenames = g#glob_expand "/etc/sysconfig/network-scripts/ifcfg-*" in Array.iter ( fun filename -> - (* Replace HOSTNAME=... entry. *) + (* Remove HOSTNAME=... and DHCP_HOSTNAME=... entries. *) let lines = Array.to_list (g#read_lines filename) in let lines = List.filter ( - fun line -> not (String.is_prefix line "HOSTNAME=") + fun line -> + not (String.is_prefix line "HOSTNAME=") && + not (String.is_prefix line "DHCP_HOSTNAME=")...
2006 Feb 22
0
Can you make an HTTP request inside an Ajax action?
I have a regular controller action which, when called, makes an HTTP GET request to another server. That works fine. I''d like to throw that inside an action called with link_to_remote, but that''s having problems. The error I get follows. Any ideas? Pat http://localhost:3000/main/ -> /javascripts/prototype.js [2006-02-22 06:08:11] ERROR ThreadError: timeout within