Re: when and why did python(-minimal) become essential?

2006-01-19 Thread Andreas Schuldei
* Anthony Towns aj@azure.humbug.org.au [2006-01-19 19:21:07]:
  In Ubuntu, we've split the package in
  order to make -minimal essential, but never install it alone (both are part
  of base).
 
 Then what's the benefit of having python(-minimal) be essential at all?

you are able to do init.d scripts, pre- and postinsts etc in
python. That is a ease of development helper for ubuntu.

how agressive does debian use it's perl in this regard? i think
hardly at all.

i would welcome to either kick both higher level scrip languages
out (to shrink essential) and rewrite stuff like adduser in c or
c++ or see if we cant really use perl (or perhaps even
python-minimal) more for scripting in these places. it is an
underutilized resource currently and would be a win in
readability, structure and even speed. 


signature.asc
Description: Digital signature


python postinst scripts

2004-11-03 Thread Andreas Schuldei
which packages do have a nice python postinst that i could copy
from?

i would especially like one that does config file creation as
described in man 7 debconf-devel
ADVANCED PROGRAMING WITH DEBCONF
   Config file handling

preferably with several config options, like in 
http://developer.skolelinux.no/cgi-bin/viewcvs.cgi/~checkout~/skolelinux/src/webmin-ldap-skolelinux/debian/postinst

please cc me, i am not on this list.



help! broken setup.py install on rampage

2004-02-04 Thread Andreas Schuldei
 /usr/./share/cerebrum/contrib/no/uio/run_privileged_command.py
 /usr/./share/cerebrum/contrib/no/uio/uio_migrate.conf.py
 /usr/./share/cerebrum/contrib/no/uio/update_LT_mailadr.py
 /usr/./share/cerebrum/contrib/no/uio/import_uio_globals_XML.py
 /usr/./share/cerebrum/contrib/no/uio/make_home2spool.py
 /usr/./share/cerebrum/contrib/no/uio/dbfg_update.py
 /usr/./share/cerebrum/contrib/no/uio/generate_frida_export.py
 /usr/./share/cerebrum/contrib/no/uio/generate_portal_export.py
 /usr/./share/cerebrum/contrib/no/uio/pq_update.py
 /usr/./share/cerebrum/contrib/no/uio/subscribe_imap.py
 /usr/./share/cerebrum/contrib/no/uio/update_employee_groups.py
 /usr/./share/cerebrum/contrib/no/uio/get_kurs_evu_kurs.py
 /usr/./share/cerebrum/contrib/no/uio/get_uname_emnekode.py
 /usr/./share/cerebrum/contrib/no/uio/get_uname_evu_kurs.py
 /usr/./share/cerebrum/contrib/no/uio/ifi_auto.py
 /usr/./share/cerebrum/contrib/no/uio/join_persons.py
 /usr/./share/cerebrum/contrib/no/uio/mailman.py
 /usr/./bin/bofh.py
 /usr/./bin/fix_jbofh_jar.py
 /usr/./share/cerebrum/client/passweb.py
 /usr/./share/cerebrum/client/passweb_form.html
 /usr/./share/cerebrum/client/passweb_receipt.html
 /usr/./etc/cerebrum/cereconf.py
 /usr/./etc/cerebrum/config.dat
 /usr/./etc/cerebrum/scheduled_jobs.py
 /usr/./etc/cerebrum/logging.ini

 what is the rational for these files to be owned by user
 cerebrum?

If you haven't already noticed, large parts of Cerebrum's setup.py
script is rather much of a hack.  The files you list above are
installed as part of the data installation phase, even though they
clearly are source.

The reason for this hack is a combination of 1) us Cerebrum developers
not being much of Python distutils hackers and 2) convincing Python
distutils to install scripts in more than one directory being damn
cumbersome, at best.

As a result, we ended up going down the path of least resistance,
towards a solution that is good enough for the uses we envisioned
ourselves.

I suspect your work on making debian packages of Cerebrum is pushing
the limits of that good enough solution -- and while I happen to
think that it would be swell to get a *proper* setup.py in place, I
also think the problems needs new eyes looking at it, rather than us
old-timers trying to extend the current hack further.

 i would have thought it would be better to let root own most of
 them.

Could be.  The design decision that Cerebrum should (mostly) run under
a non-root UID can be seen as being independent of what UID owns the
installed files.

However, as things are currently standing here at UiO, we regularly
update (parts of) the installation from CVS.  I suspect we would see
requiring root privilege for that operation as mostly cumbersome.

The fact that the user name 'cerebrum' is hardcoded and
non-overridable is likely yet another consequence of the hackish
nature of the current setup.py, though, and we would be better off it
was fixed.

==

==2nd mail ===


[Andreas Schuldei]

 in line 205 of setup.py the prefix stuff starts:

 prefix=.  # Should preferably be initialized from the command-line argument
 sharedir=%s/share % prefix
 sbindir=%s/sbin % prefix
 bindir=%s/bin % prefix
 sysconfdir = %s/etc/cerebrum % prefix # Should be /etc/cerebrum/
 logdir = %s/var/log/cerebrum % prefix # Should be /var/log/cerebrum/

 here the installation paths are defined where stuff should go.

Uhm, well, actually there is quite a bit of magic in the various
distutils modules that partake in the decision; the above definitions
are just part of the picture.

 somewhere (not sure where) usr is prepended.

This happens somewhere inside distutils; actually, it is sys.path
that is prepended.

 This results in install-paths like this for me:

 [...]
 creating 
 /home/andreas/src/deb/cerebrum-0.0.20040131/debian/tmp/usr/etc/cerebrum
 copying design/cereconf.py - 
 /home/andreas/src/deb/cerebrum-0.0.20040131/debian/tmp/usr/./etc/cerebrum
 [...]

Darn.  Another unwanted consequence of Cerebrum's installation using
install_data for the rather more than we should, is that if one
tries to do

  python setup.py install --install-data=/ --root=/foo

one will end up with cereconf.py in /foo/etc/cerebrum/cereconf.py --
but will also get lots of other stuff outside /foo/usr,
e.g. /foo/sbin/bofhd.py.

 is there a reason for this?

This was not our intention, no.

 how can i get rid of it? are there intentions to change this?

Yet again, I'm afraid that the answer is fix the current setup.py --
and I suspect that we here at UiO won't have time to work on that
until we've reduced the amount of more pressing issues by quite a bit.

 i suggest to add usr to the first three dirs statically and stop
 adding /usr automatically to all.

You're of course welcome to have a look inside the distutils magic to
see if that's easily doable.
 
==