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

Fwd: apt-setup bugs / patch review



//sorry for the direct mail, i deleted the wrong address from the send to box :!
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...


On 12 May 2014 06:08, Christian PERRIER <bubulle@debian.org> wrote:
Quoting bofh80 (afm404@gmail.com):
> Something like this then? Now the idea i had in my head, was that this
> would just be preseeded with apt-setup/local0/netrc  etc. So that for the
> next repository, apt-setup/local1/netrc .

I the point is only to preseed information and not prompt users, then
templates shouldn't be marked as translatable.....but as we did most
of the work to make them translatable (and therefore envetually shown
to users, in expert mode), it'd be a shame to stop now.


> Template: apt-setup/local/netrc
> Type: boolean
> Default: false
> # :sl3:
> #flag:translate!:4
> _Description: Use authentication information for the APT server?:
>  You chose to use a mirror FTP server that doesn't allow anonymous
>  logins but allows authentication with local logins.
>  .
>  The needed credentials in the syntax described by netrc(5) need to be
> supplied.
>  In the following example, "<packages.example.org>" is the
>  mirror server host name, "<myuser>" is the login to use on this server
>  and "<mypass>" is the password for that login:
>  .
>   machine <packages.example.org> login <myuser> password <mypass>
>  .
>  This information will be stored in "/etc/apt/auth.conf" on the
>  installed machine.

Well, if users are prompted for individual components fot eh netrc
entry later on, we probably don't need to give the example.

Also, drop the colon after the quesiton mark in the template's synopsis.

Please find below the style rewrite of the templates to make them fit
the writing style usually used in most packages' debconf templates
(and D-I templates).

Please also note that I haven't reviewed the rest of the code which
needs to be wrapped around all this, particularly for the db_input handling.

Template: apt-setup/local/netrc
Type: boolean
Default: false
# :sl3:
#flag:translate!:4
_Description: Use authentication information for the APT server?
 You chose to use a mirror FTP server that doesn't allow anonymous
 logins but allows authentication with local logins.
 .
 The needed credentials, in the syntax described by netrc(5),
 need to be supplied. If you choose this option, you will be prompted
 for the server hostname and the needed credentials. This informaiton
 will be stored in /etc/apt/auth.conf as follow:
 .
  machine <packages.example.orglogin <myuserpassword <mypass>



Template: apt-setup/local/netrc/machine
Type: string
_Description: Host name of the mirror server:
 Please provide the host name for the APT mirror server that needs
 netrc-based authentication to be accessed.
 .
 Please see netrc(5) for details. This information will be stored in
 the /etc/apt/auth.conf file (only readable by root).

Template: apt-setup/local/netrc/username
Type: string
# :sl3:
_Description: Username to access the mirror server:
 Please provide the needed login name for the APT mirror server that needs
 netrc-based authentication to be accessed.
 .
 Please see netrc(5) for details. This information will be stored in
 the /etc/apt/auth.conf file (only readable by root).

Template: apt-setup/local/netrc/password
Type: password
# :sl3:
_Description: Password to access the mirror server:
 Please provide the needed password for the APT mirror server that needs
 netrc-based authentication to be accessed.
 .
 Please see netrc(5) for details. This information will be stored in
 the /etc/apt/auth.conf file (only readable by root).





Reply to: