OK. so a few questions and a little bit of code. The templates to start are currently apt-setup/local/netrc/* . I'm wondering if they should be apt-setup/mirror/netrc and in the mirror template file instead and the code in 50mirror instead of 60local.
With that aside, the code should be something similar to the following,
#APT authentication with netrc auth.conf
db_input low "apt-setup/local/netrc"
db_go
if [ "$RET" = true ]; then
db_input low "apt-setup/local/netrc/machine"
db_get "apt-setup/local/netrc/machine"
netrcmachine="$RET"
db_input low "apt-setup/local/netrc/username"
db_get "apt-setup/local/netrc/username"
netrcusername="$RET"
db_input low "apt-setup/local/netrc/password"
db_get "apt-setup/local/netrc/password"
netrcpassword="$RET"
echo "machine $netrcmachine login $netrcusername password $netrcpassword" >> $ROOT/etc/apt/auth.conf
db_unregister "apt-setup/local/netrc/password"
chown 600 $ROOT/etc/apt/auth.conf
fi
Again, i'm sure by now that 'local' should be 'mirror' and that this code should be in 50mirror. (but please let me know either way and i'll update the full patch.) Unsure if i need 'go backs' here, and also if i need to build my own version of the installer with a patched apt-setup to test it.....
Also i was thinking for preseeding keeping something like: (in 50local, inside the while local$i loop.)
if db_get "apt-setup/local$i/netrc" && [ "$RET" = true ]; then
netrcmachine=
if db_get "apt-setup/local$i/netrc/machine"; then
netrcmachine="$RET"
fi
netrcusername=
if db_get "apt-setup/local$i/netrc/username"; then
netrcusername="$RET"
fi
netrcpassword=
if db_get "apt-setup/local$i/netrc/password"; then
netrcpassword="$RET"
fi
echo "machine $netrcmachine login $netrcusername password $netrcpassword" >> $ROOT/etc/apt/auth.conf
db_unregister "apt-setup/local$i/netrc/password"
chown 600 $ROOT/etc/apt/auth.conf
fi
And having a commented out example in the example preseed file, and updating the install manual...