From owner-freebsd-arch@FreeBSD.ORG Wed Jul 30 03:26:13 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8078B967 for ; Wed, 30 Jul 2014 03:26:13 +0000 (UTC) Received: from smtp10.server.rpi.edu (gateway.canit.rpi.edu [128.113.2.230]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A8C12CCE for ; Wed, 30 Jul 2014 03:26:12 +0000 (UTC) Received: from smtp-auth2.server.rpi.edu (route.canit.rpi.edu [128.113.2.232]) by smtp10.server.rpi.edu (8.14.3/8.14.3/Debian-9.4) with ESMTP id s6U3L4Rh006289; Tue, 29 Jul 2014 23:21:04 -0400 Received: from smtp-auth2.server.rpi.edu (localhost [127.0.0.1]) by smtp-auth2.server.rpi.edu (Postfix) with ESMTP id 3D3A118018; Tue, 29 Jul 2014 23:21:04 -0400 (EDT) Received: from [128.113.24.47] (gilead-im124.netel.rpi.edu [128.113.124.180]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: drosih) by smtp-auth2.server.rpi.edu (Postfix) with ESMTPSA id 27307181BC; Tue, 29 Jul 2014 23:21:03 -0400 (EDT) From: "Garance A Drosehn" To: "Alfred Perlstein" Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML Date: Tue, 29 Jul 2014 23:19:39 -0400 Message-ID: <448BB170-6DDC-442B-A5C5-973EC35FF7B9@rpi.edu> In-Reply-To: <53D85495.4050408@mu.org> References: <20140725044921.9F0D3580A2@chaos.jnpr.net> <20140728054217.AC1A0580A2@chaos.jnpr.net> <20140728055336.GJ50802@ivaldir.etoilebsd.net> <20140729230345.31E9B580A2@chaos.jnpr.net> <53D85495.4050408@mu.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailer: MailMate (1.7.2r3905) X-Virus-Scanned: ClamAV using ClamSMTP X-Bayes-Prob: 0.0001 (Score 0, tokens from: outgoing, @@RPTN) X-Spam-Score: 0.00 () [Hold at 15.10] X-CanIt-Incident-Id: 03Mwrl4KQ X-CanIt-Geo: ip=128.113.124.180; country=US; region=New York; city=Troy; latitude=42.7495; longitude=-73.5951; http://maps.google.com/maps?q=42.7495,-73.5951&z=6 X-CanItPRO-Stream: outgoing X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.230 Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 03:26:13 -0000 On 29 Jul 2014, at 22:12, Alfred Perlstein wrote: > > How many utils are converted over at this point? > > Have you seen the GSOC project which aims to do this as well? > "machine readable output from userland utilities" -> = > https://www.google-melange.com/gsoc/project/details/google/gsoc2014/zar= ko_korchev/5676830073815040 > > -Alfred FWIW, I've been experimenting a bit with something like this for 'lpq' output, although I'm doing it in a script outside of 'lpq'. Which is to say, I haven't tried modifying the code of lpq itself because that's a real mess to modify due to the way lpq builds each line that it = prints. The above URL is just a pointer to the project listing at gsoc. The = wiki page might also be more informative: https://wiki.freebsd.org/SummerOfCode2014/MachineReadableFromUserlandUtil= s although I must admit I don't know how to check what source changes have been made so far by starting that that wiki entry. One question that comes up is how to organize the data in the output the command creates. For instance, my experiment is just trying to mimic a rather inefficient process was implemented by some student consultants, and I wouldn't have organized the JSON object the way they did. I = wouldn't have picked the same names for keys, for instance. But there are some = more complicated issues which come up, due to the fact that one 'lpq' command can be showing data from multiple processes which are running on = multiple hosts, and 'lpq' on the current host can't depend on getting JSON output from the other hosts or processes that it gets information from. Given the way lpq's source is organized, I'm also thinking that maybe = it'd be better to do this as a separate command, maybe something like = 'lpserialize'. I personally don't expect unix commands to output HTML, and I find XML a = bit unwieldy to work with. But in my own bikeshed I'm interested in formats = of json, yaml, and edn (from the world of Clojure). In any case, I am interested to see how the GSOC project works out, or whatever happens with this libxo project. -- = Garance Alistair Drosehn =3D drosih@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA