[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-setup bugs / patch review



Unless i messed up something, this should be the correct commit. (starts to learn why people suggest having 1 patch for each file change). 
I actually don't know what the #:sl2: part is for.
And i had to look up interrogative form on wikipedia, but i get it now....i'll have a look at the other template i did too i guess :).


On 10 May 2014 17:33, Christian PERRIER <bubulle@debian.org> wrote:
Quoting bofh80 (afm404@gmail.com):

> +Template: mirror/http/source
> +Type: boolean
> +Default: true
> +# :sl2:
> +_Description: Generate deb-src for selected mirror
> +Set to false if you wish to comment out the deb-src line in
> +/etc/apt/sources.list.

That template need a style review. I'd propose something along the
lines of:

_Description: Add an entry for source packages downloads for the selected mirror?
 Choose this option if you want to create an entry in
 /etc/apt/sources.list for source packages downloads (deb-src entry).


(Debconf templates should not make reference to debconf widgets such
as "false" or "true" and boolean templates should have an
interrogative form in the synopsis)



From 72ea65083202b5be78a52049379bd7cf8fa82811 Mon Sep 17 00:00:00 2001
From: "Anthony F. McInerney" <afm404@gmail.com>
Date: Sat, 10 May 2014 04:23:03 +0100
Subject: [PATCH] adding mirror deb-src booleon

Signed-off-by: Anthony F. McInerney <afm404@gmail.com>
---
 debian/apt-mirror-setup.templates | 8 ++++++++
 generators/50mirror               | 7 ++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/debian/apt-mirror-setup.templates b/debian/apt-mirror-setup.templates
index 62d9bbb..861c830 100644
--- a/debian/apt-mirror-setup.templates
+++ b/debian/apt-mirror-setup.templates
@@ -60,3 +60,11 @@ _Description: Continue without a network mirror?
  .
  If you are installing from a netinst CD and choose not to use a mirror,
  you will end up with only a very minimal base system.
+
+Template: mirror/http/source
+Type: boolean
+Default: true
+# :sl2:
+_Description: Add an entry for source packages downloads for the selected mirror?
+ Choose this option if you want to create an entry in
+ /etc/apt/sources.list for source packages downloads (deb-src entry).
diff --git a/generators/50mirror b/generators/50mirror
index 4cb6bc4..006f43d 100755
--- a/generators/50mirror
+++ b/generators/50mirror
@@ -252,4 +252,9 @@ while [ ! "$done" ]; do
 	fi
 done
 
-echo "deb-src $protocol://$hostname$directory $codename $dists" >> $file
+db_get mirror/http/source
+if [ "$RET" = false ]; then
+	echo "#deb-src $protocol://$hostname$directory $codename $dists" >> $file
+else
+	echo "deb-src $protocol://$hostname$directory $codename $dists" >> $file
+fi
-- 
2.0.0.rc0


Reply to: