From owner-freebsd-ports@FreeBSD.ORG Fri Sep 16 16:07:17 2011 Return-Path: Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6D8B1065676 for ; Fri, 16 Sep 2011 16:07:17 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3D69E8FC18 for ; Fri, 16 Sep 2011 16:07:17 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id p8GG70Ti072998; Fri, 16 Sep 2011 18:07:16 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id p8GG70Fw072996; Fri, 16 Sep 2011 18:07:00 +0200 (CEST) (envelope-from olli) From: Oliver Fromme Message-Id: <201109161607.p8GG70Fw072996@lurza.secnetix.de> To: talon@lpthe.jussieu.fr (Michel Talon) Date: Fri, 16 Sep 2011 18:07:00 +0200 (CEST) In-Reply-To: <20110916135320.GA44499@lpthe.jussieu.fr> X-Mailer: ELM [version 2.5 PL8] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Fri, 16 Sep 2011 18:07:16 +0200 (CEST) Cc: freebsd-ports@FreeBSD.ORG Subject: Re: Detecting dependencies X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2011 16:07:17 -0000 Michel Talon wrote: > Oliver Fromme wrote: > > > > That's what a script of mine does (it's also in Python): > > > > http://www.secnetix.de/olli/scripts/pkg_dep_view > > Waooh! this is very cute. > > While we are in python i have something which draws > graphviz dependency graphs for ports here > http://www.lpthe.jussieu.fr/~talon/pkg_check.py Very nice! Your script seems to do several jobs at once, while I have separate scripts for those tasks. E.g. I have a separate script for checking origins and the consistency of dependencies. > Seeing things like your script, the perl script port-easy by des, etc. > i really wonder why people write stuff in C or worse shell for ports. > One could write ten times smarter and ten times shorter things in real > languages like python, lisp, etc. This argument of being "included in > base system" is so completely bogus ... I think "high-level" languages like Python are very well suited for managing data structures like dependency graphs. These structures are native to the language, so reading the +REQUIRED_BY files into a tree structure is absolutely trivial and requires just a few lines, wereas in C it gets a lot more complicated and a lot more error-prone. In Python you don't have to care about pointers and memory allocation (the same is true for Ruby, Perl and others, of course, but I think that Perl's syntax is horrible). As for "it's not in the base system": I don't care much. The Python port is easy enough to install, and in fact it's installed on most machines anyway because quite a lot of ports depend on it. Actually, some of my scripts that deal with package began as awk scripts, precisely for the reason that it's in the base system. But while awk supports dynamic arrays and associative arrays, it doesn't support nesting them, so you can't directly make a tree-like structure (well, you can, but it gets ugly very quickly). So I started porting them to my favourite scripting language, which is Python. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "Being really good at C++ is like being really good at using rocks to sharpen sticks." -- Thant Tessman