Code source, gestionnaire de versions/code: mercurial, bazaar, git
Posted by Noam sur juillet 7, 2008
Quelques informations concernant la gestion des programmes source sous GNU/Debian Ubuntu.
Comment obtenir les sources d’un programme sous Debian/Ubuntu ?
=========================================
Quand on installe une distribution Debian/Ubuntu nous avons un ensemble de logiciels sous forme de fichiers (ou paquets) binaires, la liste de ces « paquets » étant donné dans le fichier /etc/apt/sources.list. Si l’on veut consulter le code source correspondant à ces programmes, il faudra:
- modifier le fichier /etc/apt/sources.list (sudo gtkedit /etc/apt/sources.list) en rajoutant pour chaque ligne commençant par « deb http://xxxx… » une ligne « deb-src http://xxx… ».
- lancer commande « sudo apt-get update » pour mettre à jour la liste des paquets.
Si l’on veut voir à quoi ressemble les sources de l’interpréteur python on se crée un répertoire ~/src/python par exemple et un simple « apt-get source python2.5 » suffira pour télécharger les sources. A cette occasion, on aura le message suivant:
Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait NOTE : l'empaquetage de 'python2.5' est maintenu dans le système de contrôle de version 'Bzr' à: http://bazaar.launchpad.net/~doko/python/pkg2.5 Veuillez utiliser: bzr get http://bazaar.launchpad.net/~doko/python/pkg2.5 pour télécharger les dernières mises à jours (probablement non publiées) de ce module.
On apprend donc que ce paquet Ubuntu est géré avec un logiciel de gestion de version distribué appelé ‘bazaar’ (petit nom :’ bzr’) ce logiciel étant écrit en python (faire un apt-get source bzr pour voir le code python).
Pourquoi vouloir obtenir le code source d’un programme ?
==================================
- les logiciels libres/open source étant des logiciels de très bonne qualité, il est très intéressant de voir comment tel programme a été implémenté
- cela permet de contrôler le contenu d’un programme (absence de spywares par exemple) et/ou de faire une revue de code (http://en.wikipedia.org/wiki/Code_review)
- si on est très motivé, cela permet de participer au développement d’un logiciel ou si l’on n’est pas développeur de participer à sa documentation.
Les gestionnaires de versions
================
La participation à un projet open source implique l’utilisation d’un gestionnaire de versions. Depuis 2003 environ, CVS est progressivement remplacé par subversion. Et depuis quelques moi, subversion est remplacé par des systèmes de gestion distribué tels que Mercurial (ou hg, écrit lui aussi en python), git (écrit par Linus Torwals), et bazaar.
Ainsi le langage python actuellement géré avec subversion pourrait passer sous bazaar ou mercurial: http://www.python.org/dev/bazaar/ (« Python’s source code is maintained under the Subversion revision control system. We are experimenting with distributed revision control systems (dvcs) because of their greatly improved workflow, accessibility and merging facilities over Subversion. While there are several serious dvcs contenders in the open source world, this page describes the experimental Bazaar mirrors of the Python Subversion tree that we are making available to developers« )
A voir:
- http://en.wikipedia.org/wiki/Revision_control (« …Revision controlversion control (system) (VCS), source control(source) code management (SCM)) is the management of multiple revisions of the same unit of information. It is most commonly used in engineering and software development to manage ongoing development of digital documents like application source code, art resources such as blueprints or electronic models, and other projects that may be worked on by a team of people… « )
- http://fr.wikipedia.org/wiki/CVS (« …CVS, abréviation de Concurrent Versions System, est un système de gestion de versions libre, successeur de SCCS, originellement écrit par Dick Grune en 1986, puis complété par Brian Berliner (avec le programme cvs lui-même) en 1989, et par la suite amélioré par de très nombreux contributeurs…« )
- http://en.wikipedia.org/wiki/Git_(software) (« Git is a distributed revision control / software code management project created by Linus Torvalds, initially for the Linux kernel development…Git was designed as a set of programs written in C, and a number of shell scripts that provide wrappers around those programs.[15] Although most of those scripts have been rewritten in C as part of an ongoing effort to port it to Microsoft Windows, the design remains, and it is easy to chain the components together to do other clever things« )
- http://git.or.cz/gitwiki/GitProjects
- http://linux.yyz.us/git-howto.html
- http://en.wikipedia.org/wiki/Mercurial_(software) (« …it is written in Python, with a binary diff implementation written in C. Mercurial is primarily a command line program. All its commands begin with hg, a reference to the chemical symbol for mercury…Mercurial was written to run on Linux. It has been ported to Windows, Mac OS X, and most other Unix-like systems. »)
- http://www.selenic.com/mercurial/wiki/index.cgi/ProjectsUsingMercurial
- http://en.wikipedia.org/wiki/Bazaar_(software) (« Bazaar (formerly Bazaar-NG) is a distributed revision control system sponsored by Canonical Ltd., designed to make it easier for anyone to contribute to free and open source software projects…Bazaar is written in the Python programming language, with packages for major LinuxMac OS X and Windows. Bazaar is free software and part of the distributions, GNU project…Bazaar has support for working with some other revision control systems.[3] This allows users to branch from another system (such as Subversion), make local changes and commit them into a Bazaar branch, and then later merge them back into the other system. Bazaar has basic support for Subversion with the bzr-svn plugin.[4] There is also beginnings of support for both Mercurial[5] and Git.[6] Currently these are not feature complete, but are complete enough to show a graphical history. »)
- http://bazaar-vcs.org/WhoUsesBzr
- http://wiki.list.org/display/DEV/MailmanOnLaunchpad (« The Mailman source code was originally maintained using CVS, and only a few people had write access to the code. Later, development was moved to SourceForge and then the CVS repository was converted to Subversion. This proved to be a successful transition, as Subversion provided many benefits over CVS.Now however, it’s become clear that even Subversion has its limitations, and better options exist. Specifically, we are now using the distributed (or decentralized) revision control system (dvcs) called Bazaar. Bazaar has many beneficial features, both for the core developers and for casual, third party developers. »)
Laisser un commentaire