Bug 574699 - Directory needed for gconf2 scriptlets not prepared
Summary: Directory needed for gconf2 scriptlets not prepared
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: GConf2
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ray Strode [halfline]
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-18 09:43 UTC by Mamoru TASAKA
Modified: 2010-04-10 10:32 UTC (History)
3 users (show)

Fixed In Version: GConf2-2.26.2-1.fc11.2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-25 22:40:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mamoru TASAKA 2010-03-18 09:43:12 UTC
Description of problem:
[root@localhost ~]# env LANG=C repoquery --disablerepo=\* --enablerepo=koji-13 --whatprovides '/var/lib/rpm-state'
[root@localhost ~]# env LANG=C repoquery --disablerepo=\* --enablerepo=koji-13 --whatprovides '/var/lib/rpm-state/*'
GConf2-0:2.28.0-9.fc13.i686

i.e. GConf2 owns /var/lib/rpm-state/gconf, however /var/lib/rpm-state
     is not owned by any packages.

With at least F-13 rpm, this time of directories with missing owners
are always created with 0755 so not a big issue, however
on F-11 (rpm-4.7.2-1.fc11) this may cause permission error.

Comment 1 Mamoru TASAKA 2010-03-18 09:48:20 UTC
CC-ing to spot, as this is related to scriptlets packaging guidelines.

By the way, with gconf2 macros introduced in GConf2, trying to
use these macros will cause unpleasant result without "BR: GConf2".
see:
http://koji.fedoraproject.org/koji/taskinfo?taskID=2060393
http://koji.fedoraproject.org/scratch/mtasaka/task_2060393/

I think "BuildRequires: GConf2" must be added to gconf2 scriptlets
guideline.

Comment 2 Mamoru TASAKA 2010-03-18 10:26:10 UTC
(In reply to comment #0)
> With at least F-13 rpm, this time of directories with 

Actually "this type of directories"

Comment 3 Tom "spot" Callaway 2010-03-18 11:59:32 UTC
Looking through those logs, I do not see the problem. Those macros should only need to be evaluated in scriptlets (%pre/%post/%preun), so the Requires(pre): GConf2 , Requires(post): GConf2, and Requires(preun): GConf2 should be all that is needed.

I'm not sure what unpleasant results arise from not having GConf2 in the BuildRoot during build, could you be more specific?

Comment 4 Mamoru TASAKA 2010-03-18 12:17:37 UTC
If you download
http://koji.fedoraproject.org/scratch/mtasaka/task_2060393/comix-4.0.4-2.3.fc13.noarch.rpm

This returns:
$ rpm -qp --scripts comix-4.0.4-2.3.fc13.noarch.rpm 
preinstall scriptlet (using /bin/sh):
%gconf_schema_prepare comix
exit 0
postinstall scriptlet (using /bin/sh):
%gconf_schema_upgrade comix

touch --no-create /usr/share/icons/hicolor

update-desktop-database &> /dev/null
update-mime-database /usr/share/mime &> /dev/null

exit 0
preuninstall scriptlet (using /bin/sh):
%gconf_schema_remove comix
exit 0
postuninstall scriptlet (using /bin/sh):
update-desktop-database &> /dev/null
update-mime-database /usr/share/mime &> /dev/null

[ $1 -eq 0 ] || exit 0
touch --no-create /usr/share/icons/hicolor
/usr/bin/gtk-update-icon-cache --quiet /usr/share/icons/hicolor

exit 0
posttrans scriptlet (using /bin/sh):
/usr/bin/gtk-update-icon-cache --quiet /usr/share/icons/hicolor
exit 0

Note that %gconf_... macros are left unexpanded.

Comment 5 Tom "spot" Callaway 2010-03-18 12:30:41 UTC
You would only have that problem where GConf2 doesn't include the macros (a non-updated system).

On my system with the latest GConf2 (and thus, macros.gconf2):

[spot@pterodactyl ~]$ rpm -qp --scripts /home/spot/rpmbuild/RPMS/noarch/comix-4.0.4-2.3.fc14.noarch.rpm
preinstall scriptlet (using /bin/sh):

if [ "$1" -gt 1 ] ; then 
    rm -rf /var/lib/rpm-state/gconf/* 
    for schema in comix ; do 
        if test -f /etc/gconf/schemas/"$schema".schemas ; then 
            cp -p /etc/gconf/schemas/"$schema".schemas /var/lib/rpm-state/gconf/ || : 
        fi 
    done 
fi 
exit 0
postinstall scriptlet (using /bin/sh):

for schema in comix ; do 
    if test -f /var/lib/rpm-state/gconf/"$schema".schemas ; then 
        cmp --quiet /etc/gconf/schemas/"$schema".schemas /var/lib/rpm-state/gconf/"$schema".schemas 
        if test $? != 0; then
            
        if test -f /etc/gconf/schemas/"$schema".schemas ; then 
            export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` 
            gconftool-2 --makefile-uninstall-rule /etc/gconf/schemas/"$schema".schemas > /dev/null || : 
        fi 
            export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` 
            gconftool-2 --makefile-install-rule /etc/gconf/schemas/"$schema".schemas > /dev/null || : 
        fi 
        rm -f /var/lib/rpm-state/gconf/"$schema".schemas 
    else 
        export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` 
        gconftool-2 --makefile-install-rule /etc/gconf/schemas/"$schema".schemas > /dev/null || : 
    fi 
done 

touch --no-create /usr/share/icons/hicolor

update-desktop-database &> /dev/null
update-mime-database /usr/share/mime &> /dev/null

exit 0
preuninstall scriptlet (using /bin/sh):

if [ "$1" -eq 0 ] ; then 
    for schema in comix ; do 
        
        if test -f /etc/gconf/schemas/"$schema".schemas ; then 
            export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` 
            gconftool-2 --makefile-uninstall-rule /etc/gconf/schemas/"$schema".schemas > /dev/null || : 
        fi 
    done 
fi 
exit 0
postuninstall scriptlet (using /bin/sh):
update-desktop-database &> /dev/null
update-mime-database /usr/share/mime &> /dev/null

[ $1 -eq 0 ] || exit 0
touch --no-create /usr/share/icons/hicolor
/usr/bin/gtk-update-icon-cache --quiet /usr/share/icons/hicolor

exit 0
posttrans scriptlet (using /bin/sh):
/usr/bin/gtk-update-icon-cache --quiet /usr/share/icons/hicolor
exit 0

*****

So, the logical fix would be to use a versioned Requires here, but that's going to be a pain, since the version of GConf2 isn't consistent across branches. It means that we'd have this:

Fedora 11: Requires(post): GConf2 >= 2.26.2-1.1
Fedora 12: Requires(post): GConf2 >= 2.28.0-4.1
Fedora 13: Requires(post): GConf2 >= 2.28.0-9

That's ugly, and I wouldn't like having to do that, even with conditionals.

Instead, I propose to add:

Provides: GConf2(macros)

Then, we can amend the guidelines to use:

Requires(post): GConf2(macros)

What do you think (both Mamoru and proper GConf2 owners)?

Comment 6 Mamoru TASAKA 2010-03-18 12:44:31 UTC
(In reply to comment #5)
> You would only have that problem where GConf2 doesn't include the macros (a
> non-updated system).
> 
> On my system with the latest GConf2 (and thus, macros.gconf2):
> 
> [spot@pterodactyl ~]$ rpm -qp --scripts
> /home/spot/rpmbuild/RPMS/noarch/comix-4.0.4-2.3.fc14.noarch.rpm

I guess you are not using the one I specified (note that
the URL of the rpm I posted ends with _.fc13_)
Note that with explicitly adding "BR: GConfw", gconf2 macros
are correctly expanded, see:
http://koji.fedoraproject.org/koji/taskinfo?taskID=2060398

I guess you rebuilt my srpm by yourself using normal rpmbuild
with GConf2 already _installed_.
If you rebuild my srpm with mock or so, you'll see the macros
are still unexpanded.

Comment 7 Tom "spot" Callaway 2010-03-18 12:54:04 UTC
Okay, thats officially weird. These macros should be expanded when they're called, not during build. I'm going to have to ask Panu about this.

Comment 8 Ray Strode [halfline] 2010-03-18 14:10:07 UTC
Adding the BuildRequires: GConf2 doesn't seem that bad, most gconf using apps will have it anyway.  Just python ones I guess won't.

More generally on this topic, I'm not a big fan of us doing this in already released distros...  But I guess since the old way will always work, the more conservative packagers can ignore this change, and the people who do updates to all three releases in one go can keep their spec files in sync.

Comment 9 Tom "spot" Callaway 2010-03-18 14:12:53 UTC
Panu confirms that right now, macros are only expanded at build time, even in %post scriptlets. The simplest way to handle this is to BuildRequires: GConf2, so thats what I'll do.

Comment 10 Mamoru TASAKA 2010-03-18 14:36:07 UTC
(In reply to comment #8)
> More generally on this topic, I'm not a big fan of us doing this in already
> released distros...  But I guess since the old way will always work, the more
> conservative packagers can ignore this change, and the people who do updates to
> all three releases in one go can keep their spec files in sync.    

No objection from me.

(In reply to comment #9)
> Panu confirms that right now, macros are only expanded at build time, even in
> %post scriptlets. The simplest way to handle this is to BuildRequires: GConf2,
> so thats what I'll do.    

I also think that adding "BR: GConf2" is simplest.

Comment 11 Fedora Update System 2010-03-23 17:17:16 UTC
GConf2-2.28.0-4.fc12.2 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/GConf2-2.28.0-4.fc12.2

Comment 12 Fedora Update System 2010-03-23 17:17:21 UTC
GConf2-2.28.0-10.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/GConf2-2.28.0-10.fc13

Comment 13 Fedora Update System 2010-03-23 17:17:26 UTC
GConf2-2.26.2-1.fc11.2 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/GConf2-2.26.2-1.fc11.2

Comment 14 Fedora Update System 2010-03-24 00:45:58 UTC
GConf2-2.28.0-10.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update GConf2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/GConf2-2.28.0-10.fc13

Comment 15 Fedora Update System 2010-03-24 23:28:36 UTC
GConf2-2.26.2-1.fc11.2 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update GConf2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/GConf2-2.26.2-1.fc11.2

Comment 16 Fedora Update System 2010-03-24 23:33:13 UTC
GConf2-2.28.0-4.fc12.2 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update GConf2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/GConf2-2.28.0-4.fc12.2

Comment 17 Fedora Update System 2010-03-25 22:40:16 UTC
GConf2-2.28.0-10.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2010-04-09 01:34:17 UTC
GConf2-2.28.0-4.fc12.2 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2010-04-10 10:32:29 UTC
GConf2-2.26.2-1.fc11.2 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.