<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Emile "iMil" Heitor 's home &#187; pkgin</title>
	<atom:link href="http://imil.net/wp/tag/pkgin/feed/" rel="self" type="application/rss+xml" />
	<link>http://imil.net/wp</link>
	<description>life, unix and stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 22:31:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>pkgin (probably not weekly) news 3</title>
		<link>http://imil.net/wp/2011/10/29/pkgin-probably-not-weekly-news-3/</link>
		<comments>http://imil.net/wp/2011/10/29/pkgin-probably-not-weekly-news-3/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 14:46:21 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[pkgin]]></category>
		<category><![CDATA[pkgsrc]]></category>

		<guid isPermaLink="false">http://imil.net/wp/?p=645</guid>
		<description><![CDATA[I&#8217;ve just commited 0.5.2.1. As the version shows, it is a bugfix release; is@ got a very nasty bug that took me a while to figure out. For 3 years, the only pkg_summary(5) format I&#8217;ve seen was:

PKGNAME=foo
[...]

or, in case of conflicting packages:

CONFLICTS=bar
CONFLICTS=baz
PKGNAME=foo
[...]

Well it turns out that we can also find:

PKGNAME=foo
CONFLICTS=bar
[...]

which is pretty annoying when it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just commited 0.5.2.1. As the version shows, it is a bugfix release; is@ got a very nasty bug that took me a while to figure out. For 3 years, the only <a href="http://netbsd.gw.com/cgi-bin/man-cgi?pkg_summary+5+NetBSD-current">pkg_summary(5)</a> format I&#8217;ve seen was:</p>
<pre>
PKGNAME=foo
[...]
</pre>
<p>or, in case of conflicting packages:</p>
<pre>
CONFLICTS=bar
CONFLICTS=baz
PKGNAME=foo
[...]
</pre>
<p>Well it turns out that we can also find:</p>
<pre>
PKGNAME=foo
CONFLICTS=bar
[...]
</pre>
<p>which is pretty annoying when it comes to stick to an anchor. Until now, I did the following:</p>
<pre>
static int
chk_pkgname(char *field)
{
        if (strncmp(field, "PKGNAME=", 8) == 0 ||
                strncmp(field, "CONFLICTS=", 10) == 0)
                return 1;

        return 0;
}
[...]
                /* browse entries following PKGNAME and build the SQL query */
                while (*psum != NULL &#038;&#038; !chk_pkgname(*psum)) {
                        update_col(sum, pkgid, *psum);
                        psum++;
                }
</pre>
<p>But with that new case, I had to check a little bit further:</p>
<pre>
static int
chk_pkgname(char *field, char *last_field)
{
	if (strncmp(field, "PKGNAME=", 8) == 0)
		return 1;
	/* in some very rare cases, CONFLICTS appears *after* PKGNAME */
	if (strncmp(last_field, "PKGNAME=", 8) != 0 &#038;&#038;
		/* never seen many CONFLICTS after PKGNAME, but just in case... */
		strncmp(last_field, "CONFLICTS=", 10) != 0 &#038;&#038;
		strncmp(field, "CONFLICTS=", 10) == 0)
		return 1;

	return 0;
}
[...]
		/* browse entries following PKGNAME and build the SQL query */
		while (*psum != NULL &#038;&#038; !chk_pkgname(*psum, *(psum - 1))) {
			update_col(sum, pkgid, *psum);
			psum++;
		}
</pre>
<p>I really don&#8217;t like the way it&#8217;s done but I&#8217;ve no sexier way in mind at the moment. Maybe after some glasses of wine&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/10/29/pkgin-probably-not-weekly-news-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pkgin 0.5.1 released</title>
		<link>http://imil.net/wp/2011/10/16/pkgin-0-5-1-released/</link>
		<comments>http://imil.net/wp/2011/10/16/pkgin-0-5-1-released/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 10:15:56 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[pkgin]]></category>
		<category><![CDATA[pkgsrc]]></category>

		<guid isPermaLink="false">http://imil.net/wp/2011/10/16/pkgin-0-5-1-released/</guid>
		<description><![CDATA[Finally, here comes a release ! Read the full announcement and changelog on pkgsrc-users.

]]></description>
			<content:encoded><![CDATA[<p>Finally, here comes a release ! Read the full announcement and changelog on <a href="http://mail-index.netbsd.org/pkgsrc-users/2011/10/16/msg015198.html">pkgsrc-users</a>.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/10/16/pkgin-0-5-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pkgin (probably not weekly) news 2</title>
		<link>http://imil.net/wp/2011/10/06/pkgin-probably-not-weekly-news-2/</link>
		<comments>http://imil.net/wp/2011/10/06/pkgin-probably-not-weekly-news-2/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 09:01:57 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[pkgin]]></category>

		<guid isPermaLink="false">http://imil.net/wp/2011/10/06/pkgin-probably-not-weekly-news-2/</guid>
		<description><![CDATA[And here we are for week 2 !
There have been some fixes last week, issues were mainly spotted by orgrim, thanks to him !
The big one concerns a type of dewey/glob I&#8217;ve never been through before:

libao-[a-z]*-[0-9]*

Until now, I was able to handle the following (from pkg_str.c)

/*
 * AFAIK, here are the dewey/glob we can find [...]]]></description>
			<content:encoded><![CDATA[<p>And here we are for week 2 !</p>
<p>There have been some fixes last week, issues were mainly spotted by <a href="http://orgrim.net/">orgrim</a>, thanks to him !</p>
<p>The big one concerns a type of dewey/glob I&#8217;ve never been through before:</p>
<pre>
libao-[a-z]*-[0-9]*
</pre>
<p>Until now, I was able to handle the following (from <code>pkg_str.c</code>)</p>
<pre>
/*
 * AFAIK, here are the dewey/glob we can find as dependencies
 *
 * foo>=1.0 - 19129 entries
 * foo&lt;1.0 - 1740 entries (only perl)
 * foo>1.0 - 44 entries
 * foo< =2.0 - 1
 * {foo>=1.0,bar>=2.0}
 * foo>=1.0&lt;2.0
 * foo{-bar,-baz}>=1.0
 * foo{-bar,-baz}-[0-9]*
 * foo-{bar,baz}
 * foo-1.0{,nb[0-9]*} - 260
 * foo-[0-9]* - 3214
 * foo-1.0 - 20
 */
</pre>
<p>As there was no &#8220;easy&#8221; way of handling those double-globs dependencies, I took a simple approach: resolve dependency with a matching package when the pattern is too complex (<code>sqlite_callback.c</code>):</p>
<pre>
    /* map corresponding pkgname */
    if ((pkg_map = map_pkg_to_dep(plisthead, deptree->depend)) != NULL)
        XSTRDUP(deptree->name, pkg_map->name);
    else
        /* some dependencies just don't match anything */
        XSTRDUP(deptree->name, DEPS_PKGNAME);
</pre>
<p>Only drawback, this takes a bit more time, but at last, there&#8217;s no possible error on dependency resolution. Maybe there&#8217;s some more optimizations I can do to reduce time taken with this mapping.</p>
<p>As planned, <code>pkgin</code> now depends on <i>pkgsrc&#8217;s</i> <code>pkg_install</code>, and the latter is pushed on top of the upgrade-list if there&#8217;s a new version.<br />
I also fixed the many-versions-of-the-same-package problem with the following query (<code>pkgindb_queries.c</code>)</p>
<pre>
const char DIRECT_DEPS[] = /* prefer higher version */
    "SELECT REMOTE_DEPS_DEWEY, REMOTE_DEPS_PKGNAME "
    "FROM REMOTE_DEPS WHERE PKG_ID = "
    "(SELECT PKG_ID FROM REMOTE_PKG WHERE PKGNAME = '%s' "
    "ORDER BY FULLPKGNAME DESC LIMIT 1);";
</pre>
<p>Needs to be done:</p>
<ul>
<li>Tests, tests, tests !</li>
<li>reproduce and fix 2 different bugs two users had; I&#8217;ve been unable to reproduce them at the moment</li>
<li>test Minix 3.2.0</li>
</ul>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/10/06/pkgin-probably-not-weekly-news-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pkgin (probably not weekly) news</title>
		<link>http://imil.net/wp/2011/09/28/pkgin-probably-not-weekly-news/</link>
		<comments>http://imil.net/wp/2011/09/28/pkgin-probably-not-weekly-news/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 21:10:05 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[DragonFlyBSD]]></category>
		<category><![CDATA[NetBSD]]></category>
		<category><![CDATA[pkgin]]></category>
		<category><![CDATA[pkgsrc]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://imil.net/wp/?p=634</guid>
		<description><![CDATA[Foreword: this post will be written in english as many pkgin users don&#8217;t speak french. Sorry to my french readers then, and sorry also to my english readers as i&#8217;m not as fluent in english as i am in french :)
I subscribed to jmmv&#8217;s blog, The Julipedia, a while ago and found his idea of [...]]]></description>
			<content:encoded><![CDATA[<p><i>Foreword: this post will be written in english as many <code>pkgin</code> users don&#8217;t speak french. Sorry to my french readers then, and sorry also to my english readers as i&#8217;m not as fluent in english as i am in french :)</i></p>
<p>I subscribed to jmmv&#8217;s blog, <a href="http://blog.julipedia.org/">The Julipedia</a>, a while ago and found his idea of the <a href="http://blog.julipedia.org/2011/09/kyua-weekly-status-report_26.html">&#8220;Kyua: Weekly status report&#8221;</a> very inspiring, that&#8217;s a good way to keep your users informed on how the project is moving and keeps you focused on your TODO (although i hate TODO&#8217;s&#8230;). I doubt i&#8217;ll have the time to write a weekly report, but at last i&#8217;ll try to write a post whenever important updates are made to <a href="http://pkgin.net/">my beloved project</a>.</p>
<p>So let&#8217;s begin !<br />
As you, pkgin users, may be aware of, i&#8217;m working on the future 0.5 release, which includes massive internal changes plus some features that have been asked and i found interesting. So, in addition to the features i already listed in <a href="http://mail-index.netbsd.org/pkgsrc-users/2011/08/29/msg014870.html">this mail</a> sent to <i>pkgsrc-users@</i>, here are some hilights on recent changes:</p>
<ul>
<li>pkgin now has a <a href="http://imil.net/gfx/pkgin-logo-new.png">new logo</a> !</li>
<li>it is now possible to export / import your keep-list, pretty much like <code>dpkg</code>&#8216;s <code>get/set-selection</code>. The exported list is in <code>pkg_chk</code>&#8216;s format. Thanks wiz@ for the idea</li>
<li>pkgin install can now take a &#8220;blob&#8221; as an argument, i.e. <code>pkgin in 'mysql-server&lt;5.5'</code>, thanks filip@ for the idea</li>
<li>pkgin now uses pkgsrc&#8217;s <code>pkg_install</code> for NetBSD also</li>
<li>added the <code>-t</code> modifier, mostly for debugging purposes, in order to trace the dependency tree and impact lists</li>
<li><code>pkg_install</code> error logs are handled in a nicer way</li>
<li>enlisted pkgin&#8217;s code to <a href="http://www.ohloh.net/p/pkgin">ohloh</a> (click on &#8220;i use this&#8221; !)</li>
<li>plus usual bugfixes</li>
</ul>
<p>Yeah, these were fairly productive holidays :) Of course most of these changes are only available in CVS, see http://pkgin.net for details. Some of them have already made their way to <a href="http://pkgsrc-wip.sourceforge.net/">pkgsrc-wip</a>, i try not to insert big changes now, so wip and CVS should be sync&#8217;ed quite often.</p>
<p>Needs to be done:</p>
<ul>
<li>make pkgin&#8217;s pkgsrc <strong>package</strong> depend on pkgsrc&#8217;s <code>pkg_install</code></li>
<li>reproduce and fix 2 different bugs two users had</li>
<li>optimize the dependency loop regarding packages that exists in many versions (i.e. bash)</li>
<li>check if <code>pkg_install</code> is to be upgraded and then push it on top of ordered list</li>
<li>test Minix 3.2.0</li>
</ul>
<p>Hope i&#8217;ll make it to <i>pkgsrc 2011Q4</i> !</p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/09/28/pkgin-probably-not-weekly-news/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Un logo en carton</title>
		<link>http://imil.net/wp/2011/09/05/un-logo-en-carton/</link>
		<comments>http://imil.net/wp/2011/09/05/un-logo-en-carton/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 18:23:33 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[Gimp]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[pkgin]]></category>
		<category><![CDATA[pkgsrc]]></category>

		<guid isPermaLink="false">http://imil.net/wp/?p=626</guid>
		<description><![CDATA[J&#8217;aime aussi les vacances parce qu&#8217;elles me donnent des idées, et ce matin, alors que j&#8217;attendais que la piscine se réchauffe, j&#8217;ai pondu ça:

]]></description>
			<content:encoded><![CDATA[<p>J&#8217;aime aussi les vacances parce qu&#8217;elles me donnent des idées, et ce matin, alors que j&#8217;attendais que la piscine se réchauffe, j&#8217;ai pondu ça:<br />
<a href="http://imil.net/gfx/pkgin-logo-new.png"><img src="/gfx/pkgin-logo-new.png" width="450"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/09/05/un-logo-en-carton/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>pkgin 0.5, faster pussycat kill kill</title>
		<link>http://imil.net/wp/2011/08/29/pkgin-0-5-faster-pussycat-kill-kill/</link>
		<comments>http://imil.net/wp/2011/08/29/pkgin-0-5-faster-pussycat-kill-kill/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 10:25:58 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[pkgin]]></category>
		<category><![CDATA[pkgsrc]]></category>

		<guid isPermaLink="false">http://imil.net/wp/2011/08/29/pkgin-0-5-faster-pussycat-kill-kill/</guid>
		<description><![CDATA[Avant de partir me dorer la pilule à la maison, je vous jette en pâture une toute nouvelle pre-release de pkgin, j&#8217;ai nommé 0.5.0.
Fruit des conseils avisés du sieur Bapt, fort de son experience avec son fâmeux pkgng, ainsi que des multiples feedbacks d&#8217;horizons très differents, le code de pkgin 0.5.0 est plus rapide, plus [...]]]></description>
			<content:encoded><![CDATA[<p>Avant de partir <a href="http://en.wikipedia.org/wiki/Marbella">me dorer la pilule</a> à <a href="http://en.wikipedia.org/wiki/Andalusia">la maison</a>, je vous jette en pâture une toute nouvelle <a href="http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/pkgin/">pre-release de pkgin</a>, j&#8217;ai nommé 0.5.0.</p>
<p>Fruit des conseils avisés du sieur <a href="http://blog.etoilebsd.net/">Bapt</a>, fort de son experience avec son fâmeux <a href="http://wiki.freebsd.org/pkgng">pkgng</a>, ainsi que des multiples <i>feedbacks</i> d&#8217;horizons très differents, le code de pkgin 0.5.0 est plus rapide, plus simple et embarque un certain nombre de <i>features requests</i>.</p>
<p>Dans l&#8217;ordre d&#8217;implémentation:</p>
<ul>
<li>Migration silencieuse d&#8217;une base 0.4 vers 0.5</li>
<li>Fonction check_yesno() plus souple</li>
<li>&#8220;Yes&#8221; par defaut pour pkgin install / remove / upgrade</li>
<li>Une unique structure pour toutes les formes de listes de packages</li>
<li>Nettoyage de dizaines de calculs de listes inutiles (perfs x10)</li>
<li>Introduction du champs FULLPKGNAME, accélération des recherches</li>
<li>unique_pkg(): plus de &#8220;many versions of foo available&#8221;, le plus récent est toujours choisi</li>
<li>Import du progressmeter d&#8217;OpenSSH</li>
</ul>
<p>Cette version restera en gestation dans <a href="http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/pkgin/">wip</a> le temps qu&#8217;elle soit correctement testée, les changements sont nombreux et profonds, je dois m&#8217;assurer que tout fonctionne comme il se doit.<br />
Vous l&#8217;aurez compris, il faut tester, TESTER, <strong>TESTER</strong> !<br />
Je vous invite à rapporter les problèmes potentiels sur la liste de developpement de pkgin, à pkgin-devel-at-lists-point-sourceforge-point-net.</p>
<p><a href="http://imil.net/gfx/pkgin_upgrade.png"><img src="/gfx/pkgin_upgrade.png" width="450" alt="pkgin upgrade"/></a></p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/08/29/pkgin-0-5-faster-pussycat-kill-kill/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leeeeeeeet the sun shiiiiiiiiiine</title>
		<link>http://imil.net/wp/2011/03/14/leeeeeeeet-the-sun-shiiiiiiiiiine/</link>
		<comments>http://imil.net/wp/2011/03/14/leeeeeeeet-the-sun-shiiiiiiiiiine/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 08:27:41 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[Illumos]]></category>
		<category><![CDATA[pkgin]]></category>
		<category><![CDATA[pkgsrc]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://imil.net/wp/2011/03/14/leeeeeeeet-the-sun-shiiiiiiiiiine/</guid>
		<description><![CDATA[En fevrier dernier, je vous parlais d&#8217;Illumos, incubateur libre permettant à OpenIndiana de garder l&#8217;haleine fraiche et le teint pétillant.
Les choses ont pas mal évolué depuis, en particulier, je me suis un chouillat impliqué dans le projet visant à intégrer parfaitement pkgsrc à Illumos.
De discussions en reflexions, j&#8217;en suis venu à me demander s&#8217;il ne [...]]]></description>
			<content:encoded><![CDATA[<p>En fevrier dernier, je vous <a href="http://www.gcu-squad.org/2011/02/gcuitter-montre-moi-ton-cote-sombre/">parlais d&#8217;Illumos</a>, incubateur libre permettant à <a href="http://openindiana.org/">OpenIndiana</a> de garder l&#8217;haleine fraiche et le teint pétillant.</p>
<p>Les choses ont pas mal évolué depuis, en particulier, je me suis un chouillat <a href="http://www.illumos.org/projects/worsoe">impliqué</a> dans le projet visant à intégrer parfaitement <a href="http://www.netbsd.org/docs/software/packages.html">pkgsrc</a> à Illumos.</p>
<p>De discussions en reflexions, j&#8217;en suis venu à me demander s&#8217;il ne serait pas judicieux de monter un repository de binaires <i>pkgsrc</i> pour OpenIndiana/Illumos/Solaris puisque cette plateforme est finalement parfaitement supportée depuis des lustres mais qu&#8217;aucun repo digne de ce nom n&#8217;a été maintenu plus de 2 mois. (et puis evidemment, il faut bien un <a href="http://pkgin.net/">package manager</a> pour gêrer tous ces binaires hin hin hin&#8230;)<br />
Ainsi, Mads Worsøe Duun, l&#8217;initiateur du projet pkgsrc pour Illumos, a demandé aux gentils administrateurs du projet OpenIndiana (ouais, faut suivre) de nous mettre à disposition une buildbox afin de proposer des packages à jour, et bien plus de logiciels que n&#8217;en proposent <a href="http://www.blastwave.org/">Blastwave</a> ou les repos <a href="http://hub.opensolaris.org/bin/view/Project+pkg/WebHome">IPS/pkg</a> d&#8217;<a href="http://pkg.opensolaris.org/release/en/index.shtml">OpenSolaris</a> (*ricane* *ricane*).</p>
<p>Ce qui est réellement à notre disposition ici, c&#8217;est une <a href="http://en.wikipedia.org/wiki/Solaris_Containers">Zone</a>, or, dans la plupart des documentations <a href="http://www.perkin.org.uk/blog/2009/09/pkgsrc-on-solaris/">sur ce sujet</a> (pkgsrc et Solaris), la méthode préférée, c&#8217;est de justement créer une zone pour faire son <a href="http://www.netbsd.org/docs/pkgsrc/bulk.html">bulk build</a>, mais comme ne nous pouvons pas créer de zone dans une zone (<a href="http://knowyourmeme.com/memes/xzibit-yo-dawg">YO DAWG</a>), il faudra procéder autrement, et c&#8217;est la raison même de cet article.</p>
<p>Comme l&#8217;explique la documentation officielle, il serait parfaitement inconscient de réaliser son <i>bulk build</i> sur une arborescence opérationnelle, en effet, sur les 10000 packages disponibles, une quantité non négligeable d&#8217;entre eux vont ajouter des utilisateurs, des groupes, des repertoires, des logs, des modules, des librairies etc etc etc. Il vous faut une <a href="http://en.wikipedia.org/wiki/Sandbox_(computer_security)">sandbox</a>. Fort heureusement, la &#8220;création&#8221; d&#8217;une sandbox Solaris est d&#8217;une grande simplicité.</p>
<p>Je vous livre ici les differentes étapes que vous pourrez bien entendu concaténer dans un joli petit script.</p>
<p>On déclare tout d&#8217;abord la localisation du bac à sable sur le <i>filesystem</i>, puis on s&#8217;y rend :</p>
<pre>SANDBOX="/export/home/pkgsrc/sandbox"
cd ${SANDBOX}</pre>
<p>Là, nous créons tous les répertoires nécessaires au bon fonctionnement du <i>chroot</i>, <code>/tmp</code> possède evidemment des droits particuliers :</p>
<pre>mkdir -p bin sbin usr lib etc tmp dev opt var/run proc
chmod 777 tmp; chmod +t tmp</pre>
<p>On peuple un peu <code>/etc</code> de fichiers indispensables :</p>
<pre>cp /etc/passwd etc/
cp /etc/group etc/
cp /etc/shadow etc/
cp /etc/nsswitch.conf etc/
cp /etc/vfstab etc/
cp /etc/resolv.conf etc/
cp /etc/hosts etc/
cp /etc/netconfig etc/
cp /etc/datemsk etc/
cp /etc/user_attr etc/
cp /etc/auto_home etc/
cp /etc/project etc/
cp -r /etc/skel /etc/

chmod 400 etc/shadow</pre>
<p>Enfin, point de copie de fichiers inutiles, nous <i>mountons</i> en <i>loopback</i> les repertoires <code>/dev</code> et <code>/proc</code> en lecture et écriture, puis <code>bin sbin usr lib</code> en lecture seule afin de ne pas faire de bêtises.</p>
<pre>
for rwfs in proc dev
do
        mount -F lofs /${rwfs} ${SANDBOX}/${rwfs}
done

for rofs in bin sbin usr lib
do
        mount -F lofs -o ro /${rofs} ${SANDBOX}/${rofs}
done
</pre>
<p>C&#8217;est prêt !</p>
<pre>
imil@pkgsrc:~$ pfexec chroot pkgsrc/sandbox /usr/bin/bash
bash-4.0#
</pre>
<p>Afin de pouvoir correctement compiler l&#8217;ensemble des paquets de pkgsrc, vous aurez également besoin d&#8217;installer les logiciels suivants à l&#8217;aide de la commande <code>pkg install</code> : <code>SUNWgcc, gnu-patch, gnu-tar, system/xopen/xcu4, gnu-grep, developer/object-file</code>.</p>
<p>Enfin, voici les particularités de mon <code>mk.conf</code>, à ajouter aux directives du <i>mk.conf chrooté</i> grace au <i>bootstrap</i> et son drapeau <code>--mk-fragment</code> :</p>
<pre>
PKGSRC_COMPILER=                ccache gcc

ACCEPTABLE_LICENSES+=           vim-license
ACCEPTABLE_LICENSES+=           sendmail-license

FAILOVER_FETCH=                 yes
ALLOW_VULNERABLE_PACKAGES=      yes
PKG_DEVELOPER=                  yes

MAKE_JOBS=              16

PASSIVE_FETCH=          1

X11_TYPE=               native
X11BASE=                /usr/X11
</pre>
<p>Ainsi que la commande complète de <i>bootstrap</i> :</p>
<pre>
./bootstrap --workdir=/tmp/pkgsrc --prefix=/opt/ipp/pkg --abi=32 --mk-fragment=mk-fragment.conf
</pre>
<p>Happy building.<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/03/14/leeeeeeeet-the-sun-shiiiiiiiiiine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Less politics, more fun</title>
		<link>http://imil.net/wp/2011/01/23/less-politics-more-fun/</link>
		<comments>http://imil.net/wp/2011/01/23/less-politics-more-fun/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 09:13:37 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[MINIX]]></category>
		<category><![CDATA[pkgin]]></category>

		<guid isPermaLink="false">http://imil.net/wp/2011/01/23/less-politics-more-fun/</guid>
		<description><![CDATA[On peut lire ici : As of release 3.1.8, pkgin is the binary package manager for MINIX 3. This page describes how to use pkgin.
Comme MINIX 3 fait partie des cibles de pkgin 0.4.0, je me suis fendu d&#8217;une install fraîche. Et au premier boot, j&#8217;ai pu contempler ceci :

mmmmmm :)

]]></description>
			<content:encoded><![CDATA[<p>On peut lire <a href="http://wiki.minix3.org/en/UsersGuide/InstallingBinaryPackages">ici</a> : <em>As of release 3.1.8, pkgin is the binary package manager for MINIX 3. This page describes how to use pkgin.</em></p>
<p>Comme MINIX 3 fait partie des cibles de <a href="http://pkgin.net">pkgin</a> 0.4.0, je me suis fendu d&#8217;une install fraîche. Et au premier boot, j&#8217;ai pu contempler ceci :<br />
<a href="http://imil.net/gfx/MINIX3.png"><img src="/gfx/MINIX3.png" width="450"/></a></p>
<p>mmmmmm :)<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/01/23/less-politics-more-fun/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Armaged^WAmalgamation</title>
		<link>http://imil.net/wp/2011/01/22/armagedwamalgamation/</link>
		<comments>http://imil.net/wp/2011/01/22/armagedwamalgamation/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 14:36:41 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[pkgin]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://imil.net/wp/2011/01/22/armagedwamalgamation/</guid>
		<description><![CDATA[Depuis la semaine dernière, j&#8217;ai corrigé plusieurs bugs dans pkgin, comme vous l&#8217;avez peut-être lu ici ou là.
Ces fixes devraient marquer la fin de la branche 0.3, actuellement disponible dans pkgsrc, et je me permets de rappeler que si vous ne l&#8217;avez pas déjà fait, je ne saurais trop vous conseiller que de mettre à [...]]]></description>
			<content:encoded><![CDATA[<p>Depuis la semaine dernière, j&#8217;ai corrigé plusieurs bugs dans <a href="http://pkgin.net">pkgin</a>, comme vous l&#8217;avez peut-être lu <a href="http://www.gcu-squad.org/2011/01/gcuitter-intruder-alert/">ici</a> ou <a href="http://www.shiningsilence.com/dbsdlog/2011/01/17/7105.html">là</a>.<br />
Ces fixes <i>devraient</i> marquer la fin de la branche 0.3, actuellement disponible dans <i>pkgsrc</i>, et je me permets de rappeler que si vous ne l&#8217;avez pas déjà fait, je ne saurais trop vous conseiller que de mettre à jour vos <i>pkgin 0.3.3.1</i> en 0.3.3.4 dès que possible, les correctifs étant assez violents.</p>
<p>Je démarre donc aujourd&#8217;hui la branche 0.4, et comme je l&#8217;ai annoncé à droite et à gauche, cette branche a 3 objectifs majeurs :</p>
<ul>
<li>Inclusion de SQLite dans le source tree
</li>
<li>Amélioration des performances</li>
<li>Integration propre des patchs MINIX</li>
</ul>
<p>J&#8217;avais adressé le premier point lors du 1er <a href="http://blog.netbsd.org/tnf/entry/announcing_netbsd_hackathon_in_paris">Hackathon Parisien</a>, mais plusieurs éléments m&#8217;empêchaient d&#8217;être pleinement satisfait. Étant d&#8217;un naturel maniaque, evincer ce magnifique <code>WARNS=2</code> me fend le coeur, mais en l&#8217;occurrence, c&#8217;est la seule façon de mener à bien la compilation de <code>sqlite3.c</code> lorsqu&#8217;on désactive un certain nombre de fonctions :</p>
<pre>
COPTS.sqlite3.c+=       -DSQLITE_OMIT_AUTHORIZATION             \
                        -DSQLITE_OMIT_EXPLAIN                   \
                        -DSQLITE_OMIT_PROGRESS_CALLBACK         \
                        -DQLITE_OMIT_TCL_VARIABLE               \
                        -DSQLITE_OMIT_LOAD_EXTENSION            \
                        -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT     \
                        -DSQLITE_OMIT_ALTERTABLE                \
                        -DSQLITE_OMIT_ANALYZE                   \
                        -DSQLITE_OMIT_ATTACH                    \
                        -DSQLITE_OMIT_CAST                      \
                        -DSQLITE_OMIT_CONFLICT_CLAUSE           \
                        -DSQLITE_OMIT_EXPLAIN                   \
                        -DSQLITE_OMIT_REINDEX                   \
                        -DSQLITE_OMIT_SUBQUERY                  \
                        -DSQLITE_OMIT_TEMPDB                    \
                        -DSQLITE_OMIT_TRIGGER                   \
                        -DSQLITE_OMIT_VIEW                      \
                        -DSQLITE_OMIT_VIRTUALTABLE
</pre>
<p>La directive <code>WARNS=2</code> intègre entre autre le drapeau <code>-Wunused</code>, et lorsqu&#8217;on inclut le fichier <code>sqlite.c</code> officiel, c&#8217;est une myriade d&#8217;insultes que <code>gcc</code> vous jette à la figure.</p>
<p>Je vous livre l&#8217;état de mes recherches. SQLite, sous license &#8220;public domain&#8221;, permet l&#8217;inclusion d&#8217;un fichier dit &#8220;Amalgamation&#8221;, sqlite3.c, de pres de 130000 lignes, qui represente l&#8217;ensemble de SQLite en un seul <i>.c</i>. Très pratique. Mais ce fichier est en réalité le résultat d&#8217;une petite manipulation effectuée depuis les sources officielles et originales. Ainsi, on téléchargera depuis <a href="http://www.sqlite.org/src/timeline?t=release">le site officiel</a> le <i>zip</i> (allez comprendre) de la version souhaitée, puis réalisera les opérations suivantes :</p>
<pre>
$ unzip SQLite-a586a4deeb253300.zip
$ mkdir custom-sqlite
$ cd custom-sqlite
$ chmod +x ../SQLite-a586a4deeb253300/configure
$ CFLAGS="-DSQLITE_OMIT_AUTHORIZATION -DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_PROGRESS_CALLBACK -DQLITE_OMIT_TCL_VARIABLE -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT -DSQLITE_OMIT_ALTERTABLE -DSQLITE_OMIT_ANALYZE -DSQLITE_OMIT_ATTACH -DSQLITE_OMIT_CAST -DSQLITE_OMIT_CONFLICT_CLAUSE -DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_REINDEX -DSQLITE_OMIT_SUBQUERY -DSQLITE_OMIT_TEMPDB -DSQLITE_OMIT_TRIGGER -DSQLITE_OMIT_VIEW -DSQLITE_OMIT_VIRTUALTABLE" ../SQLite-a586a4deeb253300/configure --disable-tcl --disable-readline
$ make sqlite3.c
</pre>
<p>And voilà, le fichier <code>sqlite3.c</code> alors généré est une <i>amalgamation</i> de SQLite exempte des fonctions sus-citées, qu&#8217;on peut notemment voir <a href="http://www.sqlite.org/howtocompile.html">ici</a>.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2011/01/22/armagedwamalgamation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Un parc à jour</title>
		<link>http://imil.net/wp/2010/03/06/un-parc-a-jour/</link>
		<comments>http://imil.net/wp/2010/03/06/un-parc-a-jour/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 12:25:53 +0000</pubDate>
		<dc:creator>iMil</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[NetBSD]]></category>
		<category><![CDATA[packaging]]></category>
		<category><![CDATA[pkgin]]></category>

		<guid isPermaLink="false">http://imil.net/wp/?p=411</guid>
		<description><![CDATA[Sur le &#8220;SuperPlan Mini&#8221; qui héberge désormais iMil.net, les services sont portés par des DomUs paravirtualisés Xen. Ces machines virtuelles fonctionnent avec les mêmes versions de noyau, d&#8217;espace utilisateur et surtout, de packages. Je ne partage pas via NFS l&#8217;espace utilisateur car je ne garantis pas la sécurité des applications hébergées sur l&#8217;une et l&#8217;autre [...]]]></description>
			<content:encoded><![CDATA[<p>Sur le <a href="http://www.ovh.com/fr/produits/superplan_mini.xml">&#8220;SuperPlan Mini&#8221;</a> qui héberge désormais <a href="http://imil.net">iMil.net</a>, les services sont portés par des <a href="http://wiki.xensource.com/xenwiki/DomU">DomUs</a> paravirtualisés <a href="http://wiki.xensource.com/xenwiki/">Xen</a>. Ces machines virtuelles fonctionnent avec les mêmes versions de noyau, d&#8217;espace utilisateur et surtout, de packages. Je ne partage pas via NFS l&#8217;espace utilisateur car je ne garantis pas la sécurité des applications hébergées sur l&#8217;une et l&#8217;autre des VMs (du php, beaucoup trop de php&#8230;).</p>
<p>Afin de simplifier la mise à jour des packages, j&#8217;utilise, devinez quoi: <a href="http://imil.net/pkgin">pkgin</a>. Seulement voila, comme je l&#8217;expliquais quelques posts plus bas, j&#8217;ai besoin de spécifier certaines options à quelques packages, et de fait, je ne peux pas uniquement fonder mes mises à jour sur les paquets binaires fournis par le <a href="http://www.netbsd.org/">Projet NetBSD</a>.<br />
Dans l&#8217;exemple qui suit, on considèrera une machine &#8220;maître&#8221;, à qui revient la bonne gestion des packages et qui exporte son repertoire <code>/usr/pkgsrc</code> en NFS :</p>
<pre>
$ cat /etc/exports
/usr/pkgsrc  -alldirs -maproot=root -network 10.20.30.0 -mask 255.255.255.0
$ tail -3 /etc/rc.conf
rpcbind=yes
mountd=yes
nfs_server=yes
</pre>
<p>Voici la méthodologie que j&#8217;utilise pour le moment, pas trop fastidieuse mais tout de même pas d&#8217;une convivialité extrème :</p>
<ul>
<li><b>Sur la machine maitre</b></li>
<li>Mise à jour des binaires sur la machine &#8220;maître&#8221; :
<pre>
# pkgin up &#038;&#038; pkgin fug
</pre>
</li>
<li>Remplacement des packages &#8220;custom&#8221; (je pourrais le faire avec <code>pkg_chk</code>, ce serait probablement plus propre)
<pre>
# cd /usr/pkgsrc/chat/irssi &#038;&#038; make replace clean
</pre>
</li>
<li>Regénération de tous les packages :
<pre>
# pkg_tarup -a -d /usr/pkgsrc/packages/All/ '*'
</pre>
</li>
<li>Préparation du <code>pkg_summary</code> :
<pre>
# cd /usr/pkgsrc/packages/All/
# pkg_info -X * |bzip2 -c > pkg_summary.bz2
</pre>
</li>
<li><b>Sur les machines &#8220;slave&#8221;</b></li>
<li>Renseignement du repository local :
<pre>
$ cat /usr/pkg/etc/pkgin/repositories.conf
file:///usr/pkgsrc/packages/All
</pre>
</li>
<li>Mise à jour de la base et des packages
<pre>
# pkgin up &#038;&#038; pkgin fug
</pre>
</li>
</ul>
<p>Et le tour est joué.</p>
]]></content:encoded>
			<wfw:commentRss>http://imil.net/wp/2010/03/06/un-parc-a-jour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: imil.net @ 2012-02-09 09:42:53 by W3 Total Cache -->
