Setup a local macports repository

(Update: Official Guide Local Repositories)

Setting up a local macports repository is quite easy:

– create a repo folder, like: sudo mkdir /opt/local/var/localports

– update the config sudo vim /opt/local/etc/macports/sources.conf adding file:///opt/local/var/localports

– create your port mirroring the model in /opt/local/var/macports/sources/

– update the index with: sudo portindex /opt/local/var/localports

– install the new port!

Ho trovato un buggettino a cElementTree!

Giorni fa ho trovato il mio primo bug in un codice sorgente “serio”!

Playing with PyInstaller I have found that the final part of _elementtree.c:
Index: Modules/_elementtree.c
===================================================================
--- Modules/_elementtree.c (revisione 59540)
+++ Modules/_elementtree.c (copia locale)
@@ -2780,7 +2780,10 @@

);

- PyRun_String(bootstrap, Py_file_input, g, NULL);
+ if (PyRun_String(bootstrap, Py_file_input, g, NULL) == NULL) {
+ m = PyErr_Occurred();
+ return;
+ }

elementpath_obj = PyDict_GetItemString(g, "ElementPath");

execute a bit of python code without checking the return value.
That can lead to weird things playing with import hooks,
for example an assert like this can fail:

Continua a leggere