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

apt-setup bugs / patch review



apt-setup: netrc auth.conf for apt generated in apt-setup/localx/netrc feature
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747559

please allow pre-seeding for deb-src line
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=647405

I wrote two small patches, i'm unsure if they are up to standard or correct.
Please review and let me know. Criticism more than welcome.

Thanks
Anthony


From 03bde6a7b0f33511e6a8db86cc5ac97456620654 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..e2a73c6 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: Generate deb-src for selected mirror
+Set to false if you wish to comment out the deb-src line in
+/etc/apt/sources.list.
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

From d22016c53884695d7223fdf77c810b47fd40411c Mon Sep 17 00:00:00 2001
From: "Anthony F. McInerney" <afm404@gmail.com>
Date: Tue, 6 May 2014 18:50:32 +0100
Subject: [PATCH] Adding netrc to generate auth.conf

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

diff --git a/debian/apt-setup-udeb.templates b/debian/apt-setup-udeb.templates
index 7b7afcf..fdfb3d8 100644
--- a/debian/apt-setup-udeb.templates
+++ b/debian/apt-setup-udeb.templates
@@ -112,3 +112,10 @@ Description: for internal use; can be preseeded
  without using 'dpkg --force-architecture', in addition to the native
  architecture. If empty, only allow installing packages from the native
  architecture.
+
+Template: apt-setup/local/netrc
+Type: string
+Description: for http apt repositories that require authentication
+does not pull apt/localx/repostory as machine due to possible parse mangle
+format as man netrc suggests
+example: machine packages.server.org login myuser password mypass
diff --git a/generators/60local b/generators/60local
index fcd4f1c..ade16f2 100755
--- a/generators/60local
+++ b/generators/60local
@@ -51,6 +51,13 @@ while db_get "apt-setup/local$i/repository" && [ "$RET" ]; do
 			fi
 		done
 	fi
+	netrc=
+	if db_get "apt-setup/local$i/netrc"; then
+		netrc="$RET"
+	fi
+	if [ -n "$netrc" ]; then
+		echo "$netrc">> $ROOT/etc/apt/auth.conf
+	fi
 	i="$(($i + 1))"
 done
 
-- 
2.0.0.rc0


Reply to: