2010/12/7 Julien Cristau <jcris...@debian.org>:
> On Tue, Dec  7, 2010 at 12:12:29 +0100, Agustin Martin wrote:
>>
>> I have been playing about parsing config file and seed values in
>> config. It is a whitespace separated file with an unquoted string. I
>> want some validation, but my tests still do not deal with the unquoted
>> string, needs to refresh my awk here.
>>
> How about something like the following (untested)?

Hi, Julien,

Thanks again.  I was playing in parallel with something like

--- 8< -------------------------------------------------------
...
db_get libpam-rsa/no_configuration
if [ "$RET" = "false" ]
then
    # If present, parse config file and feed debconf database with its values
    pam_rsa_conf="/etc/security/pam_rsa.conf"
    pam_rsa_keys="pubkey_dir privkey_dir privkey_name_hash pam_prompt
log_auth_result"
    if [ -f $pam_rsa_conf ]; then
        for keyname in $pam_rsa_keys; do
            keyvalue=$(grep -e "^$keyname " $pam_rsa_conf | sed 's/^'$keyname' 
*//')
            if [ -n "$keyvalue" ]; then
                db_set "libpam-rsa/$keyname $keyvalue"
            fi
        done    
    fi
...
--- 8< -------------------------------------------------------

for the config file.

Need to look more carefully at the postinst code, could not do that
yet. I like the idea of using an intermediate file, that may even
allow to preserve sysadmin comments

This is requiring more time than initially expected, but I hope to
have a new NMU candidate this week.

Cheers,

-- 
Agustin



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to