[Bug 196146] Review Request: mod_nss

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

 



Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug report.

Summary: Review Request: mod_nss


https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=196146





------- Additional Comments From jwilson@xxxxxxxxxx  2006-07-14 16:21 EST -------
(In reply to comment #5)
> 2. Ok, you've convinved me. I made a few minor changes though. When determining
> if we need to generate a database we only need to check one of the files. They
> do not stand alone but work together in concert, so if one is temporary it is
> safe to assume they all are. I switched to checking key3.db since that is the
> most important file.
> 
> I also modified the deletion install test. I'm using if [ "$1" -eq 0 ] which
> from the RPM docs means "Remove last version of package". I tested it and it
> seems to work ok for me.

Heh, actually, no it doesn't. :)

$1 being 0 isn't possible in the %post context, only %postun and %preun, see
"Running scriptlets only in certain situations" at
http://fedoraproject.org/wiki/Packaging/Guidelines. RPM itself does the work
that you're seeing, renaming them with .rpmsave. I added that extra little bit
for the edge case where the user has no mod_nss rpm installed, but does have the
.db files there, then installs the rpm, so they wouldn't be overwritten by
%post. It probably makes more sense to do nothing at all in %post on install if
we find .db files that don't have that temp string in them -- then we just end
up with .rpmnew files and the existing .db files. Now that I ponder it, I think
this makes the most sense for that section:

umask 077
if [ "$1" -eq 1 ] ; then
    if [ `grep -c "temporary file" %{_sysconfdir}/httpd/alias/key3.db` -eq 1 ]; then
        rm -f %{_sysconfdir}/httpd/alias/{secmod,cert8,key3}.db
        %{_sbindir}/gencert %{_sysconfdir}/httpd/alias >
%{_sysconfdir}/httpd/alias/install.log 2>&1
        echo ""
        echo "%{name} certificate database generated."
        echo ""
    fi
fi

Results on install with this tweak:

rpm -ivh /build/RPMS/x86_64/mod_nss-1.0.3-1.fc5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:mod_nss                warning: /etc/httpd/alias/cert8.db created as
/etc/httpd/alias/cert8.db.rpmnew
warning: /etc/httpd/alias/key3.db created as /etc/httpd/alias/key3.db.rpmnew
warning: /etc/httpd/alias/secmod.db created as /etc/httpd/alias/secmod.db.rpmnew
########################################### [100%]


-- 
Configure bugmail: https://bugzilla.redhat.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

_______________________________________________
Fedora-package-review mailing list
Fedora-package-review@xxxxxxxxxx
http://www.redhat.com/mailman/listinfo/fedora-package-review

[Index of Archives]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]