Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Sep 2011 18:07:00 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        talon@lpthe.jussieu.fr (Michel Talon)
Cc:        freebsd-ports@FreeBSD.ORG
Subject:   Re: Detecting dependencies
Message-ID:  <201109161607.p8GG70Fw072996@lurza.secnetix.de>
In-Reply-To: <20110916135320.GA44499@lpthe.jussieu.fr>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109161607.p8GG70Fw072996>