pf-tools commit: r620 [ccaillet-guest] - in /trunk: debian/changelog sbin/mk_sourceslist templates/sources.list.tpl
parmelan-guest at users.alioth.debian.org
parmelan-guest at users.alioth.debian.org
Fri Aug 1 13:38:23 UTC 2008
Author: ccaillet-guest
Date: Fri Aug 1 13:38:23 2008
New Revision: 620
URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=620
Log:
* Add: mk_sourceslist tool needed for adding custom repositories
* Add: sources.list.tpl
Modified:
trunk/debian/changelog
trunk/sbin/mk_sourceslist
trunk/templates/sources.list.tpl
Modified: trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pf-tools/trunk/debian/changelog?rev=620&op=diff
==============================================================================
--- trunk/debian/changelog (original)
+++ trunk/debian/changelog Fri Aug 1 13:38:23 2008
@@ -1,8 +1,9 @@
pf-tools (0.33-0+RC3) unstable; urgency=low
- * Adding mk_sourceslist tool needed for adding custom repositories
-
- -- Christophe Caillet <quadchris at free.fr> Fri, 01 Aug 2008 14:37:48 +0200
+ * Add: mk_sourceslist tool needed for adding custom repositories
+ * Add: sources.list.tpl
+
+ -- Christophe Caillet <tof at sitadelle.com> Fri, 01 Aug 2008 15:37:51 +0200
pf-tools (0.33-0+RC2) unstable; urgency=low
Modified: trunk/sbin/mk_sourceslist
URL: http://svn.debian.org/wsvn/pf-tools/trunk/sbin/mk_sourceslist?rev=620&op=diff
==============================================================================
--- trunk/sbin/mk_sourceslist (original)
+++ trunk/sbin/mk_sourceslist Fri Aug 1 13:38:23 2008
@@ -37,6 +37,11 @@
my $TPL = "/usr/share/pf-tools/templates/sources.list.tpl" ;
my $SECTIONS = "common" ;
my $HOST = `/bin/hostname -s 2>>/dev/null` ;
+
+my $DEF_SECTIONS = {} ;
+$DEF_SECTIONS->{'debian'} = "main contrib non-free" ;
+$DEF_SECTIONS->{'ubuntu'} = "main universe restricted" ;
+
chomp ( $HOST ) ;
my $program = $0;
@@ -92,17 +97,19 @@
}
my $sources_content = join '', <SOURCESTPL> ;
close ( SOURCESTPL ) ;
-
+
$sources_content =~ s/%DISTRIB%/$ref_srv->{'distrib'}/gs ;
my $dist_src = $ref_srv->{'deploymode'} ;
$dist_src =~ s/^(debian|ubuntu)-installer/$1/ ;
-
+
my $security ;
( $dist_src eq 'debian' ) ? $security = $ref_srv->{'distrib'}."/updates" : $security = $ref_srv->{'distrib'}."-security" ;
-
+
$sources_content =~ s/%DISTSRC%/$dist_src/gs ;
$sources_content =~ s/%SECURITY%/$security/gs ;
-
+ $sources_content =~ s/%DEFAULT_SECTIONS%/$DEF_SECTIONS->{$dist_src}/gs ;
+ $sources_content =~ s/%CUSTOM_SECTIONS%/$sections/gs ;
+
if ( ! open ( DST, ">".$dst ) ) {
warn "Unable to open destination's sources.list ".$dst."\n" ;
return 1 ;
@@ -131,10 +138,10 @@
exit 1 ;
}
-if ( @ARGV ) { $SECTIONS .= " ".join ( " ", "common", @ARGV ) ; }
+if ( @ARGV ) { $SECTIONS .= " ".join ( " ", @ARGV ) ; }
my $PF_NET = Init_lib_net ( Get_source ( $SRC ) ) ;
-$HOST =~ /^(([^\-]{4})-)?([^\d\-]+)-([\d]+)$/ ;
+$HOST =~ /^(([^\-]{4})-)?([^\d\-]+)(-([\d]+))?$/ ;
my $SRV = $PF_NET->{'SERVERS'}->{'BY_NAME'}->{$3}->{'SRVLIST'}->{$HOST} ;
Mk_sourceslist ( $SRV, $DST, $TPL, $SECTIONS ) ;
Modified: trunk/templates/sources.list.tpl
URL: http://svn.debian.org/wsvn/pf-tools/trunk/templates/sources.list.tpl?rev=620&op=diff
==============================================================================
--- trunk/templates/sources.list.tpl (original)
+++ trunk/templates/sources.list.tpl Fri Aug 1 13:38:23 2008
@@ -1,6 +1,6 @@
-deb http://mirrors.private/%DISTSRC% %DISTRIB% main non-free contrib
+deb http://mirrors.private/%DISTSRC% %DISTRIB% %DEFAULT_SECTIONS%
-deb http://mirrors.private/%DISTSRC%-custom %DISTRIB% common
+deb http://mirrors.private/%DISTSRC%-custom %DISTRIB% %CUSTOM_SECTIONS%
-deb http://mirrors.private/%DISTSRC%-security %SECURITY% main contrib non-free
+deb http://mirrors.private/%DISTSRC%-security %SECURITY% %DEFAULT_SECTIONS%
More information about the pf-tools-commits
mailing list