Re: apt-setup bugs / patch review
Ok, here's the other patch too updated with a slightly better template thing. Now i noticed the _Description part is different, so i changed it, then noticed the other string entries don't have _Description parts.
From 6285c76d66e07af8dcd66489c25601cf62af2fbb 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..9690a34 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: Have a http apt repository that requires authentication?
+ Example: machine packages.server.org login myuser password mypass
+ Does not pull apt/localx/repostory as machine due to possible parse mangle
+ Formats as man netrc suggests
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: