From 4690cc231169b826d946a80352658fb8e6160716 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sun, 22 Nov 2009 16:07:30 -0500 Subject: [PATCH] Change repository configuration to generate config from a mako template using gen-files instead of rolling our own. svn path=/trunk/packages/invirt-dev/; revision=2552 --- debian/changelog | 4 +++- debian/invirt-dev.init | 28 ++++++++++++++++++---------- repository-config/distributions.in | 19 ------------------- repository-config/distributions.mako | 17 +++++++++++++++++ 4 files changed, 38 insertions(+), 30 deletions(-) delete mode 100644 repository-config/distributions.in create mode 100644 repository-config/distributions.mako diff --git a/debian/changelog b/debian/changelog index fe943e5..14af9f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ invirt-dev (0.1.0) unstable; urgency=low * Switch to using git instead of svn. + * Generate the apt repository configuration using gen-files instead of + rolling our own. - -- Evan Broder Sun, 22 Nov 2009 13:32:45 -0500 + -- Evan Broder Sun, 22 Nov 2009 15:57:59 -0500 invirt-dev (0.0.14) unstable; urgency=low diff --git a/debian/invirt-dev.init b/debian/invirt-dev.init index 9600d74..60ceebd 100755 --- a/debian/invirt-dev.init +++ b/debian/invirt-dev.init @@ -1,25 +1,33 @@ #!/bin/bash +### BEGIN INIT INFO +# Provides: invirt-dev +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Invirt development configuration +# Description: +### END INIT INFO -PACKAGE=invirt-dev +# Author: Invirt project -. /lib/lsb/init-functions +# Do NOT "set -e" -gen_config () { - local keyid="$(invirt-getconf apt.keyid)" - for f in /srv/repository/conf/{distributions,invirt-uploaders}; do - perl -pe "s/\@apt\.keyid\@/$keyid/g" <"$f".in >"$f" - done -} +NAME=invirt-dev +GEN_FILES=/srv/repository/conf/distributions + +. /lib/init/gen-files.sh case "$1" in start|reload|force-reload|restart) log_begin_msg "Reloading config for $PACKAGE" - gen_config + gen_files + reprepro-env export log_end_msg $? ;; stop) ;; *) - log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}" + log_success_msg "Usage: /etc/init.d/$NAME {start|reload|force-reload|restart|stop}" ;; esac diff --git a/repository-config/distributions.in b/repository-config/distributions.in deleted file mode 100644 index e7facdb..0000000 --- a/repository-config/distributions.in +++ /dev/null @@ -1,19 +0,0 @@ -CodeName: unstable -Components: main invirt-system -UDebComponents: main invirt-system -Uploaders: unsigned -SignWith: @apt.keyid@ -Architectures: amd64 i386 source -Origin: Invirt -Notautomatic: yes -Description: Invirt unstable - -Codename: stable -Components: main invirt-system -UDebComponents: main invirt-system -Uploaders: unsigned -SignWith: @apt.keyid@ -Architectures: amd64 i386 source -Origin: Invirt -Description: Invirt stable -Contents: diff --git a/repository-config/distributions.mako b/repository-config/distributions.mako new file mode 100644 index 0000000..6b0d1fe --- /dev/null +++ b/repository-config/distributions.mako @@ -0,0 +1,17 @@ +<% +from invirt.config import structs as cfg +from invirt import builder as b +%>\ +% for pocket in cfg.git.pockets: +CodeName: ${b.pocketToApt(pocket)} +Components: main invirt-system +UDebComponents: main invirt-system +SignWith: ${cfg.apt.keyid} +Architectures: amd64 i386 source +Origin: Invirt +Description: Invirt ${pocket} pocket +Contents: . .gz +DebIndices: Packages Release . .gz .bz2 +DscIndices: Sources Release . .gz .bz2 + +% endfor -- 1.7.9.5