guadalinex-members team mailing list archive
-
guadalinex-members team
-
Mailing list archive
-
Message #00266
[Merge] lp:~ehbello/gcs/trunk into lp:gcs
Enrique Hernández Bello has proposed merging lp:~ehbello/gcs/trunk into lp:gcs.
Requested reviews:
Guadalinex Members (guadalinex-members)
Related bugs:
#545003 gcs uses python-syck as YAML parser
https://bugs.launchpad.net/bugs/545003
This branch releases a new personal version of GCS for karmic. It fixes some bugs, implements some items described in TODO file and also, another issues needed by Bardinux distribution.
Please, check if my changes are in line with your development policy.
--
https://code.launchpad.net/~ehbello/gcs/trunk/+merge/24073
Your team Guadalinex Members is subscribed to branch lp:gcs.
=== modified file 'TODO'
--- TODO 2009-03-12 21:03:28 +0000
+++ TODO 2010-04-25 14:24:21 +0000
@@ -1,5 +1,3 @@
- * Add <AUTHOR> token to the copyright template
- * Removed execution permission to the templates and give them to the post and pre scripts
* Added the Architecture field to the info file
* Checking the best way to put the versions
* See how get the changelog from the svn log instead of from the info (which usually doesn't change
=== modified file 'builder.py'
--- builder.py 2008-03-25 17:29:55 +0000
+++ builder.py 2010-04-25 14:24:21 +0000
@@ -5,7 +5,7 @@
import os.path
import shutil
-import syck
+import yaml
from config import config
from generators.file import ControlGenerator
@@ -26,7 +26,7 @@
def __init__(self, path):
config['source_path'] = path
- config['info'] = syck.load(open(path + '/gcs/info').read())
+ config['info'] = yaml.load(open(path + '/gcs/info').read())
extension = config['info'].get('config_extension', None)
if extension:
config['config_extension'] = extension
@@ -53,15 +53,24 @@
CompatGenerator().activate()
CopyrightGenerator().activate()
- os.system('debuild -us -uc')
-
- self.__delete_tmpfiles()
-
-
+ # FIXME: At the moment we need to keep the configuration files because
+ # the conversion doesn't transparently (dh_install rename problem)
+ #self.__delete_tmpfiles()
+
+
+
+
+ def build_package(self):
+ """ Build the package. Use a simply debuild for this propouse.
+ """
+ try:
+ os.system('debuild -us -uc')
+ except:
+ pass
def __prepare_conffiles(self):
- """ Add .gv4 extension at all conffiles (making a copy)
+ """ Add .gcs extension at all conffiles (making a copy)
"""
def copy_file(arg, dirname, file_names):
@@ -79,7 +88,7 @@
def __delete_tmpfiles(self):
- """ Add .gv4 extension at all conffiles (making a copy)
+ """ Add .gcs extension at all conffiles (making a copy)
"""
def delete_file(arg, dirname, file_names):
=== modified file 'config.py'
--- config.py 2008-03-25 17:29:55 +0000
+++ config.py 2010-04-25 14:24:21 +0000
@@ -5,14 +5,16 @@
import sys
-import syck
+import yaml
try:
- config = syck.load(open('/etc/gcs.conf').read())
+ config = yaml.load(open('/etc/gcs.conf').read())
# Add default options
config['source_path'] = './'
config['info'] = {}
+ if not config.has_key('diverts_basepath'):
+ config['diverts_basepath'] = '/'
except:
print "Can't read /etc/gcs.conf file."
=== modified file 'debian/changelog'
--- debian/changelog 2009-06-17 09:08:22 +0000
+++ debian/changelog 2010-04-25 14:24:21 +0000
@@ -1,3 +1,29 @@
+gcs (0.3.20+ehbello1) karmic; urgency=low
+
+ * Added support for all architectures.
+ * Added preremoval script to delete all remaining pyc files for a clean
+ uninstall.
+ * Added support for Recommends and Suggests control fields.
+ preparation process is no longer necessary.
+ * Changed default config_extension to .gcs
+ * Added an option parameter for gcs_build to don't build the Debian source
+ generated. It's useful to build it later.
+ * Created <DISTRIB> tag with the codename of the parent distribution for the
+ changelog template.
+ * Added support for <AUTHOR> tag in copyright template.
+ * Deleted some old stuff.
+ * Replaced python-syck dependence by a newer python-yaml.
+ * The example section in the info file of the skeleton by default couldn't
+ have multiple words.
+ * Fixed almost all lintian warnings coming from this debian package and the
+ debian templates for gcs.
+ * Added feature to change the base directory of diverted files. Useful for a
+ run-parts style of directory. [config: diverts_basepath]
+ * Removed execution permission to the templates and gave them later to the
+ post and pre scripts
+
+ -- Enrique Hernández Bello <quique@xxxxxxxxxx> Sat, 20 Feb 2010 14:25:20 +0000
+
gcs (0.3.20) jaunty; urgency=low
* Added Provides: control's field support
=== modified file 'debian/control'
--- debian/control 2009-03-12 21:28:24 +0000
+++ debian/control 2010-04-25 14:24:21 +0000
@@ -4,14 +4,14 @@
Maintainer: Junta de Andalucia <packmaster@xxxxxxxxxxxxxx>
Uploaders: Juanje Ojeda Croissier <jojeda@xxxxxxxxxx>
Build-Depends: debhelper (>= 7.0)
-Standards-Version: 3.8.0
+Standards-Version: 3.8.3
Homepage: http://launchpad.net/gcs
Vcs-Browser: http://codebrowse.launchpad.net/~guadalinex-members/gcs/trunk/changes
Vcs-Bzr: http://bazaar.launchpad.net/~guadalinex-members/gcs/trunk
Package: gcs
-Architecture: i386
-Depends: python, python-syck, python-support, debhelper, devscripts, make, fakeroot, gcc
+Architecture: all
+Depends: ${misc:Depends}, python, python-yaml, python-support, debhelper, devscripts, make, fakeroot, gcc
Description: Guadalinex Configuration System
gcs (Guadalinex Configuration System) is a system which was originally created
to generate plane metapackages (just dependences) and configuration
=== added file 'debian/prerm'
--- debian/prerm 1970-01-01 00:00:00 +0000
+++ debian/prerm 2010-04-25 14:24:21 +0000
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+#DEBHELPER#
+
+set -e
+
+find /usr/share/gcs/ -iname "*.pyc" -delete
=== modified file 'debian/rules'
--- debian/rules 2008-03-25 17:29:55 +0000
+++ debian/rules 2010-04-25 14:24:21 +0000
@@ -10,7 +10,7 @@
install: build
dh_testdir
dh_testroot
- dh_clean -k
+ dh_prep
dh_install "builder.py" "/usr/share/gcs"
dh_install "config.py" "/usr/share/gcs"
@@ -22,9 +22,7 @@
dh_install "gcs_skel" "/usr/bin"
dh_install "gcs.conf" "/etc"
-binary-indep: build install
-
-binary-arch: build install
+binary-indep: build install
dh_testdir
dh_testroot
dh_installdebconf
@@ -39,8 +37,11 @@
dh_installdeb
dh_shlibdeps
dh_gencontrol
+ dh_md5sums
dh_builddeb
+binary-arch: build install
+
binary: binary-indep binary-arch
.PHONY: build clean install binary binary-indep binary-arch
=== removed directory 'gcs'
=== modified file 'gcs.conf'
--- gcs.conf 2009-05-11 15:36:33 +0000
+++ gcs.conf 2010-04-25 14:24:21 +0000
@@ -8,5 +8,8 @@
postrm_template: /usr/share/gcs/templates/postrm.template
copyright_template: /usr/share/gcs/templates/copyright.template
-# Extensión en la que acaban los ficheros de configuración
-config_extension: .gv6
+## Final extension for the configuration files.
+config_extension: .gcs
+
+## This variable change the base path where you want to store the diversions.
+# diverts_basepath: /diverts
=== removed file 'gcs/changelog'
--- gcs/changelog 2008-03-25 17:29:55 +0000
+++ gcs/changelog 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
-gcs (0.3.13) edgy; urgency=low
-
- * Added support for desktop files.
-
- -- Junta de Andalucia <packmaster@xxxxxxxxxxxxxx> Tue, 25 Mar 2008 17:20:59 -0000
-
-
-gcs (0.3.12) edgy; urgency=low
-
- * Added support for pre-depends.
- * Added support for conflict fields.
-
- -- Gumersindo Coronel Pérez <gcoronel@xxxxxxxxxxxx> Mon, 19 Mar 2007 09:00:14 -0000
-
-
-gcs (0.3.9) edgy; urgency=low
-
- * 0.4 rc1.
-
- -- Gumersindo Coronel Pérez <gcoronel@xxxxxxxxxxxx> Wed, 20 Dec 2006 11:55:20 -0000
-
-
-gcs (0.3.8) edgy; urgency=low
-
- * Development release.
- * Fixing a minor bug with skel.
-
- -- Gumersindo Coronel Pérez <gcoronel@xxxxxxxxxxxx> Thu, 30 Nov 2006 16:08:22 -0000
-
-
=== removed directory 'gcs/conffiles_skel'
=== removed file 'gcs/depends'
--- gcs/depends 2008-03-25 17:29:55 +0000
+++ gcs/depends 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
-# Dependencias del paquete. Un paquete por lÃnea. Si se desea, se puede indicar la versión del paquete en una segunda columna
-# Ejemplos:
-#
-# gnome-terminal
-# nautilus >=2.6.10
-#
-python
-python-syck
-python-support
-debhelper
-devscripts
-make
-fakeroot
-gcc
=== removed file 'gcs/info'
--- gcs/info 2008-03-25 17:29:55 +0000
+++ gcs/info 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
-# YAML 1.1
-# Fichero de configuración de paquetes de personalización de Guadalinex v4
-
-# Nombre del paquete (minúsculas-separado-con-guiones)
-name: gcs
-
-# Autor
-author: Junta de Andalucia <packmaster@xxxxxxxxxxxxxx>
-
-# Priority
-priority: optional
-
-# Section
-section: admin
-
-shortdesc: "Sistema de configuración de Guadalinex v4"
-
-longdesc: "Consiste en un conjunto de herramientas que facilitan\n la creacion de metapaquetes y paquetes de configuración."
-
-# Versión del paquete
-version: 0.3.13
-
-# Cambios en esta versión
-changes:
- - Added support for desktop files.
-
=== removed directory 'gcs/install_scripts'
=== removed file 'gcs/newfiles'
--- gcs/newfiles 2008-03-25 17:29:55 +0000
+++ gcs/newfiles 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-# File/Dir InstallDir
-builder.py /usr/share/gcs
-config.py /usr/share/gcs
-generators /usr/share/gcs
-skel /usr/share/gcs
-templates /usr/share/gcs
-doc /usr/share/gcs
-gcs_build /usr/bin
-gcs_skel /usr/bin
-gcs.conf /etc
=== removed directory 'gcs/newfiles_skel'
=== removed file 'gcs/predepends'
--- gcs/predepends 2008-03-25 17:29:55 +0000
+++ gcs/predepends 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
-# Predependencias del paquete. Un paquete por lÃnea. Si se desea, se puede indicar la versión del paquete en una segunda columna
-# Ejemplos:
-#
-# gnome-terminal
-# nautilus >=2.6.10
=== removed directory 'gcs/remove_scripts'
=== removed file 'gcs/replaces'
--- gcs/replaces 2009-06-15 08:17:43 +0000
+++ gcs/replaces 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
-# Replaces del paquete. Un paquete por lÃnea. Si se desea, se puede indicar la versión del paquete en una segunda columna
-# Ejemplos:
-#
-# gnome-terminal
-# nautilus <=2.6.10
=== modified file 'gcs_build'
--- gcs_build 2008-03-25 17:29:55 +0000
+++ gcs_build 2010-04-25 14:24:21 +0000
@@ -7,8 +7,21 @@
sys.setdefaultencoding('utf8')
sys.path.insert(0, '/usr/share/gcs/')
+from optparse import OptionParser
from builder import Builder
if __name__ == "__main__":
+ parser = OptionParser()
+
+ parser.add_option('-S', '--sources',
+ dest="sources",
+ action="store_true",
+ help="debian source only, no binary files"
+ )
+ (options, args) = parser.parse_args()
+
builder = Builder(os.getcwd())
builder.make_package()
+
+ if not options.sources:
+ builder.build_package()
=== modified file 'generators/file.py'
--- generators/file.py 2009-06-17 09:08:22 +0000
+++ generators/file.py 2010-04-25 14:24:21 +0000
@@ -40,10 +40,11 @@
- def _write_file(self, path):
+ def _write_file(self, path, mode=0644):
real_file = open(config['source_path'] + '/' + path, 'w')
real_file.write(self.template_content)
real_file.close()
+ os.chmod(config['source_path'] + '/' + path, mode)
class ControlGenerator(FileGenerator):
@@ -65,6 +66,8 @@
self.__set_predepends()
self.__set_provides()
self.__set_depends()
+ self.__set_recommends()
+ self.__set_suggests()
self.__set_conflicts()
self.__set_replaces()
self.__set_section()
@@ -97,6 +100,18 @@
self.template_content = newcontent
+ def __set_recommends(self):
+ recommends = self.__parse_deps('/gcs/recommends')
+ newcontent = self.template_content.replace('<RECOMMENDS>', recommends)
+ self.template_content = newcontent
+
+
+ def __set_suggests(self):
+ suggests = self.__parse_deps('/gcs/suggests')
+ newcontent = self.template_content.replace('<SUGGESTS>', suggests)
+ self.template_content = newcontent
+
+
def __set_conflicts(self):
conflicts = self.__parse_deps('/gcs/conflicts')
newcontent = self.template_content.replace('<CONFLICTS>', conflicts)
@@ -219,6 +234,8 @@
if (not '/.svn' in orig_path) and\
os.path.isfile(orig_path):
dest_path = os.path.dirname(dest_path)
+ if skel_name == "conffiles_skel":
+ dest_path = os.path.join(config['diverts_basepath'], dest_path)
self.__add_dhinstall(orig_path, dest_path)
elif os.path.islink(orig_path):
dest_path = os.path.dirname(dest_path)
@@ -236,8 +253,7 @@
commands_content)
self.template_content = newcontent
- self._write_file('debian/rules')
- os.chmod(config['source_path'] + '/' + 'debian/rules', 0755)
+ self._write_file('debian/rules', 0755)
# write debian/dirs file
dirs_file = open(config['source_path'] + '/debian/dirs', 'w')
@@ -314,6 +330,8 @@
info['name'])
newcontent = newcontent.replace('<VERSION>',
str(info['version']))
+ newcontent = newcontent.replace('<DISTRIB>',
+ os.popen('lsb_release -cs').read()[:-1])
newcontent = newcontent.replace('<AUTHOR>',
info['author'])
newcontent = newcontent.replace('<DATE>',
@@ -378,7 +396,7 @@
self._set_install_scripts()
if initial_content != self.template_content:
- self._write_file(self.file_path)
+ self._write_file(self.file_path, 0755)
else:
try:
os.remove(config['source_path'] + '/' + self.file_path)
@@ -461,4 +479,15 @@
def activate(self):
self.set_template_content('copyright_template')
+
+ self.__set_author()
+
self._write_file('debian/copyright')
+
+
+ def __set_author(self):
+ from datetime import date
+ today = date.today()
+ author = "Copyright %s, %s" % (today.year, config['info']['author'])
+ newcontent = self.template_content.replace('<AUTHOR>', author)
+ self.template_content = newcontent
=== modified file 'generators/part.py'
--- generators/part.py 2008-03-25 17:29:55 +0000
+++ generators/part.py 2010-04-25 14:24:21 +0000
@@ -60,17 +60,6 @@
abs_path.endswith(extension):
divert_method(dest_path)
- desktop_extension = 'desktop' + extension
- if fname.endswith(desktop_extension):
- if divert_method == self.__add_divert:
- real_conf_path = dest_path[: -len(extension)]
- command = "rm %s\n" % real_conf_path
- command += "cp %s %s\n\n" % (dest_path, real_conf_path)
- self.diverts.append(command)
-
- elif divert_method == self.__rm_divert:
- pass
-
os.path.walk(config['source_path'] + '/gcs/conffiles_skel',
set_divert, None)
@@ -85,10 +74,11 @@
pkg_name = config['info']['name']
divert_command = '[ "%s" != "$(dpkg-divert --truename %s)" ] && rm -f %s && dpkg-divert --rename --remove %s\n' % (real_conf_path, real_conf_path, real_conf_path, real_conf_path)
- divert_command += "dpkg-divert --package %s --rename " % pkg_name
- divert_command += "--quiet --add %s\n" % real_conf_path
+ divert_command += "dpkg-divert --package %s " % pkg_name
+ divert_command += "--divert %s.distrib " % os.path.join(config['diverts_basepath'], real_conf_path[1:])
+ divert_command += "--rename --quiet --add %s\n\n" % real_conf_path
- divert_command += "ln -fs %s %s\n\n" % (dest_path, real_conf_path)
+ divert_command += "ln -fs %s %s\n\n" % (os.path.join(divert_directory, dest_path[1:]), real_conf_path)
self.diverts.append(divert_command)
=== modified file 'skel/gcs/info'
--- skel/gcs/info 2009-03-12 20:51:41 +0000
+++ skel/gcs/info 2010-04-25 14:24:21 +0000
@@ -11,7 +11,7 @@
priority: optional
# Section
-section: seccion de la aplicacion
+section: seccion_de_la_aplicacion
# Descripción corta
shortdesc: "descripción corta"
=== modified file 'templates/changelog.template'
--- templates/changelog.template 2009-03-12 20:28:14 +0000
+++ templates/changelog.template 2010-04-25 14:24:21 +0000
@@ -1,4 +1,4 @@
-<NAME> (<VERSION>) jaunty; urgency=low
+<NAME> (<VERSION>) <DISTRIB>; urgency=low
<CHANGES>
-- <AUTHOR> <DATE>
=== modified file 'templates/control.template'
--- templates/control.template 2009-06-17 09:08:22 +0000
+++ templates/control.template 2010-04-25 14:24:21 +0000
@@ -3,14 +3,16 @@
Priority: <PRIORITY>
Maintainer: <MANTAINER>
Build-Depends: debhelper (>= 7.0)
-Standards-Version: 3.8.0
+Standards-Version: 3.8.3
Package: <NAME>
Architecture: all
Provides: <PROVIDES>
Replaces: <REPLACES>
Pre-Depends: <PREDEPENDS>
-Depends: <DEPENDS>
+Depends: ${misc:Depends}, <DEPENDS>
+Recommends: <RECOMMENDS>
+Suggests: <SUGGESTS>
Conflicts: <CONFLICTS>
Description: <SHORTDESC>
<LONGDESC>
=== modified file 'templates/copyright.template'
--- templates/copyright.template 2009-03-12 20:48:27 +0000
+++ templates/copyright.template 2010-04-25 14:24:21 +0000
@@ -1,4 +1,4 @@
-Copyright 2009, Junta de AndalucÃa.
+<AUTHOR>.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
=== modified file 'templates/postinst.template' (properties changed: +x to -x)
--- templates/postinst.template 2008-03-25 17:29:55 +0000
+++ templates/postinst.template 2010-04-25 14:24:21 +0000
@@ -1,4 +1,5 @@
#!/bin/bash
+
#DEBHELPER#
<DIVERT_SLOT>
=== modified file 'templates/postrm.template' (properties changed: +x to -x)
--- templates/postrm.template 2008-03-25 17:29:55 +0000
+++ templates/postrm.template 2010-04-25 14:24:21 +0000
@@ -1,4 +1,5 @@
#!/bin/bash
+
#DEBHELPER#
<DIVERT_SLOT>
=== modified file 'templates/preinst.template' (properties changed: +x to -x)
--- templates/preinst.template 2008-03-25 17:29:55 +0000
+++ templates/preinst.template 2010-04-25 14:24:21 +0000
@@ -1,4 +1,5 @@
#!/bin/bash
+
#DEBHELPER#
<DIVERT_SLOT>
=== modified file 'templates/prerm.template' (properties changed: +x to -x)
--- templates/prerm.template 2008-03-25 17:29:55 +0000
+++ templates/prerm.template 2010-04-25 14:24:21 +0000
@@ -1,4 +1,5 @@
#!/bin/bash
+
#DEBHELPER#
<DIVERT_SLOT>
=== modified file 'templates/rules.template' (properties changed: +x to -x)
--- templates/rules.template 2009-05-11 15:42:41 +0000
+++ templates/rules.template 2010-04-25 14:24:21 +0000
@@ -10,14 +10,12 @@
install: build
dh_testdir
dh_testroot
- dh_clean -k
+ dh_prep
dh_installdirs -A
<DHINSTALL_SLOT>
-binary-indep: build install
-
-binary-arch: build install
+binary-indep: build install
dh_testdir
dh_testroot
dh_installdebconf
@@ -32,8 +30,11 @@
dh_installdeb
dh_shlibdeps
dh_gencontrol
+ dh_md5sums
dh_builddeb
+binary-arch: build install
+
binary: binary-indep binary-arch
.PHONY: build clean install binary binary-indep binary-arch
=== modified file 'test_pkg/debian.orig/gcs-test-pkg/DEBIAN/conffiles'
--- test_pkg/debian.orig/gcs-test-pkg/DEBIAN/conffiles 2008-03-25 17:29:55 +0000
+++ test_pkg/debian.orig/gcs-test-pkg/DEBIAN/conffiles 2010-04-25 14:24:21 +0000
@@ -1,2 +1,2 @@
/etc/test_pkg.conf
-/etc/lsb-release.gv4
+/etc/lsb-release.gcs
=== modified file 'test_pkg/debian.orig/gcs-test-pkg/DEBIAN/postinst'
--- test_pkg/debian.orig/gcs-test-pkg/DEBIAN/postinst 2008-03-25 17:29:55 +0000
+++ test_pkg/debian.orig/gcs-test-pkg/DEBIAN/postinst 2010-04-25 14:24:21 +0000
@@ -2,7 +2,7 @@
dpkg-divert --package gcs-test-pkg --rename --quiet --add /etc/lsb-release
-ln -s /etc/lsb-release.gv4 /etc/lsb-release
+ln -s /etc/lsb-release.gcs /etc/lsb-release
=== renamed file 'test_pkg/debian.orig/gcs-test-pkg/etc/lsb-release.gv4' => 'test_pkg/debian.orig/gcs-test-pkg/etc/lsb-release.gcs'
=== modified file 'test_pkg/debian.orig/postinst'
--- test_pkg/debian.orig/postinst 2008-03-25 17:29:55 +0000
+++ test_pkg/debian.orig/postinst 2010-04-25 14:24:21 +0000
@@ -2,7 +2,7 @@
#DEBHELPER#
dpkg-divert --package gcs-test-pkg --rename --quiet --add /etc/lsb-release
-ln -s /etc/lsb-release.gv4 /etc/lsb-release
+ln -s /etc/lsb-release.gcs /etc/lsb-release
=== modified file 'test_pkg/debian.orig/rules'
--- test_pkg/debian.orig/rules 2008-03-25 17:29:55 +0000
+++ test_pkg/debian.orig/rules 2010-04-25 14:24:21 +0000
@@ -14,7 +14,7 @@
dh_install test_pkg.conf /etc
dh_install gcs/newfiles_skel/usr/share/test_pkg/newfile_example.txt usr/share/test_pkg
- dh_install gcs/conffiles_skel/etc/lsb-release.gv4 etc
+ dh_install gcs/conffiles_skel/etc/lsb-release.gcs etc
binary-indep: build install
Follow ups