Ticket #19304: privoxity-configs.diff

File privoxity-configs.diff, 1.5 KB (added by cssdev, 15 years ago)

patch to allow installing when configs don't already exist

  • Portfile

     
    33PortSystem                      1.0
    44name                            privoxy
    55version                         3.0.10
     6revision                        1
    67categories                      www security net
    78maintainers                     nomaintainer
    89description                     Advanced filtering web proxy
     
    6465                        ${destroot}${prefix}/etc/rc.d/privoxy.sh
    6566        }
    6667        # Rename these so local modifications are not removed on uninstall
    67         foreach privoxyConf {config trust user.action} {
    68                 file rename ${destroot}${prefix}/etc/privoxy/${privoxyConf} \
    69                         ${destroot}${prefix}/etc/privoxy/${privoxyConf}-dist \
    70         }
     68        foreach privoxyConf {config trust user.action user.filter match-all.action} {
     69            if [file exists ${destroot}${prefix}/etc/privoxy/${privoxyConf}] {
     70                file rename ${destroot}${prefix}/etc/privoxy/${privoxyConf} \
     71                    ${destroot}${prefix}/etc/privoxy/${privoxyConf}-dist
     72            }
     73        }
    7174        # Remove the preinstalled log files as, otherwise, a rotation script
    7275        # will fail when trying to rename and compress due to gzip not liking
    7376        # multi-linked files (the one in ${prefix} and the one in
     
    8689                        -group ${privoxyGroup} -owner ${privoxyUser} \
    8790                        -permissions 0660
    8891        }
    89         foreach privoxyConf {config trust user.action} {
     92        foreach privoxyConf {config trust user.action user.filter match-all.action} {
    9093                if ![file exists ${prefix}/etc/privoxy/${privoxyConf}] {
    9194                        file copy ${prefix}/etc/privoxy/${privoxyConf}-dist \
    9295                                ${prefix}/etc/privoxy/${privoxyConf}