[Calypso] patches: git execution, user name in git commit, htpassword parsing

chrysn chrysn at fsfe.org
Wed Jan 18 13:23:26 PST 2012

next round :-)

On Tue, Jan 17, 2012 at 08:28:19AM -0800, Keith Packard wrote:
> I hoped to actually pull information from the file being changed as
> well; when looking at the log, it would be nice to see a brief
> description of the calendar or card entry listed, but just getting
> user agent information is pretty nice.

see attached 0003. i haven't found a way to easily test the fallbacks
(in case an event has neither summary nor date, or a contact entry has
no name, i'd like to fail safe to the uuid if present). the git side
even got a little simpler because messages are now just an action
description in context. some care had to be taken of encoding; afaict
it's common for git commit messages to be utf8, i'd just rather not rely
on environment settings because daemons might be run with LANG=C.

> We could have a configuration value that just says 'use xdg compliant
> paths' and make that 'false' by default for now, but put a warning in
> suggesting that people move things by hand and set the value to
> 'true'. Then create a script to set calypso up for a new user; this
> script would create things in the xdg-compliant spot and set the config
> value to 'true'. Eventually, we'd change the default.

after having a deeper look at xdg, it turned out it can use numerous
configuration dirs anyway (global configuration gets overridden by
local), so i just left the legacy locations in the lookup path and added
some magic to tell in which cases to show a warning (together with a
global warnings setting to just display the warning w/o the backtrace,
which is really not interesting for someone running calypso).

the resulting patch (0002) is currently configured to use the xdg
standard directory for global configuration too, which seems to be
/etc/xdg/calypso instead of /etc/calypso for reasons i can't yet follow,
but i've inquiried at [1] and am expecting the xdg's feedback. if
/etc/xdg turns out not to be the way, i can easily add /etc/ to
the lookup path again.

as of now, the config files are {/etc/xdg/calypso,~/.config/calypso}/
{config,server.crt,server.key,users}, and the data is stored in
{~/.local/share,/srv}/calypso/calendars. all old paths are recognized,
but yeild a warning unless the old path happens to be configured by
means of XDG environment variables.

(a corner case is the key files pointing to the apache keys. if someone
doesn't use ssl in calypso at all but has apache keys present, a warning
will be shown although the calypso config is ok. as the setting is
retrieved in the course of populating the option parser, i can't even
wait for it to be accessed to defer the warning; i guess it is ok for
the time being and will be phased out anyway.)

this introduces a new dependency on pyxdg, packaged as python-xdg in
debian. i think it's a good thing to do, even though the functionality
actually used is marginal (basically it's splitting up environment
variables into python lists). i'm not too familiar with setuptools, but
i think the dependency should be declared right the way i did.

from the random-fixes list, 0001 removes the explicit --version switch
which is already built in to optparse.


[1] http://lists.freedesktop.org/archives/xdg/2012-January/012262.html

To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-use-optparse-s-builtin-version-command.patch
Type: text/x-diff
Size: 1305 bytes
Desc: not available
URL: </pipermail/calypso/attachments/20120118/40946751/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-path-resolution-using-xdg.patch
Type: text/x-diff
Size: 7128 bytes
Desc: not available
URL: </pipermail/calypso/attachments/20120118/40946751/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-more-meaningful-commit-messages.patch
Type: text/x-diff
Size: 4402 bytes
Desc: not available
URL: </pipermail/calypso/attachments/20120118/40946751/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: </pipermail/calypso/attachments/20120118/40946751/attachment.pgp>

More information about the Calypso mailing list