Merge lp://staging/~compiz-team/compiz-libcompizconfig/compiz-libcompizconfig.settings_upgrades into lp://staging/compiz-libcompizconfig

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 413
Proposed branch: lp://staging/~compiz-team/compiz-libcompizconfig/compiz-libcompizconfig.settings_upgrades
Merge into: lp://staging/compiz-libcompizconfig
Diff against target: 3661 lines (+1516/-832)
9 files modified
backend/src/ini.c (+17/-13)
include/ccs.h (+110/-18)
plugin/ccp/src/ccp.cpp (+19/-10)
plugin/ccp/src/ccp.cpp~ (+0/-536)
src/ccs-private.h (+16/-0)
src/compiz.cpp (+34/-2)
src/ini.c (+134/-65)
src/lists.c (+28/-7)
src/main.c (+1158/-181)
To merge this branch: bzr merge lp://staging/~compiz-team/compiz-libcompizconfig/compiz-libcompizconfig.settings_upgrades
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+68991@code.staging.launchpad.net

Commit message

    Added settings upgrade framework.

    Store settings upgrades in SYSCONFDIR/compizconfig/upgrades with the name
    format

    org.freedesktop.domain.num.profile.upgrade

    Where org.freedesktop.domain is a freedesktop.org reverse domain name:
    eg org.freedesktop.compiz, num is a base 10 number indicating the upgrade
    series (listed in incremental order) and profile is the name of the profile
    which should be active when changing settings.

    Upgrades will be processed in alphabetical order and then written to a file
    in XDG_CONFIG_DIR/compiz-1/compizconfig/done_upgrades so that they will be
    skipped in the future.

    The upgrade file format follows something along the lines of a diff file
    inlined into the ini file, for example

    [plugin]
    +s0_option_name = foo;
    -s0_other_option_name = bar;

    The following is the syntax of the upgrade file:
    + with a value will replace the existing value with the specified one
    - with a value will clear the existing value to the default value if
      the value specified in the value section of the key matches the actual
      value that the user has set
    both + and - for a particular option key name will replace the value
    if the value that the user has set matches the value section specified
    in the - value field

    For lists, + and - will not overwrite or clear to default, but rather append
    and subtract from list themselves.
    + with a value will append all non-duplicate entries to the existing list
    - with a value will subtract all matched entries from the existing list
    both + and - for a particular list will replace the list only if the entire
    list matches what was specified in the - field

Description of the change

    Added settings upgrade framework.

    Store settings upgrades in SYSCONFDIR/compizconfig/upgrades with the name
    format

    org.freedesktop.domain.num.profile.upgrade

    Where org.freedesktop.domain is a freedesktop.org reverse domain name:
    eg org.freedesktop.compiz, num is a base 10 number indicating the upgrade
    series (listed in incremental order) and profile is the name of the profile
    which should be active when changing settings.

    Upgrades will be processed in alphabetical order and then written to a file
    in XDG_CONFIG_DIR/compiz-1/compizconfig/done_upgrades so that they will be
    skipped in the future.

    The upgrade file format follows something along the lines of a diff file
    inlined into the ini file, for example

    [plugin]
    +s0_option_name = foo;
    -s0_other_option_name = bar;

    The following is the syntax of the upgrade file:
    + with a value will replace the existing value with the specified one
    - with a value will clear the existing value to the default value if
      the value specified in the value section of the key matches the actual
      value that the user has set
    both + and - for a particular option key name will replace the value
    if the value that the user has set matches the value section specified
    in the - value field

    For lists, + and - will not overwrite or clear to default, but rather append
    and subtract from list themselves.
    + with a value will append all non-duplicate entries to the existing list
    - with a value will subtract all matched entries from the existing list
    both + and - for a particular list will replace the list only if the entire
    list matches what was specified in the - field

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

You can test this with the following:

bzr branch lp:~smspillaz/+junk/compizconfig-test

That is a simple test prog which will init and deinit compizconfig. Maybe it can test the whole API in the future.

Two settings upgrades files can be found here:

http://smspillaz.ucc.asn.au/compiz/tests/compizconfig-settings-upgrades/upgrades/

cp them into /etc/compizconfig/upgrades and they will be processed the next time you start a compizconfig utility

Revision history for this message
Jason Smith (jassmith) wrote :

+1

tests pass, I wish I could offer a more comprehensive testing of this work however the raw number of combinations are amazingly huge...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: