Skip to content

ChoicesXMLGenerator should specify undesired choices, not just desired choices #81

Open
@homebysix

Description

@homebysix

I'd like to be able to use ChoicesXMLGenerator to designate which choices I don't want to install. For example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
<plist version="1.0">
<array>
     <dict>
        <key>choiceIdentifier</key>
        <string>com.corel.pkg.painter2020.zh_TW</string>
        <key>choiceAttribute</key>
        <string>selected</string>
        <key>attributeSetting</key>
        <integer>0</integer>
    </dict>
     <dict>
        <key>choiceIdentifier</key>
        <string>com.corel.pkg.painter2020.Japanese</string>
        <key>choiceAttribute</key>
        <string>selected</string>
        <key>attributeSetting</key>
        <integer>0</integer>
    </dict>
     <dict>
        <key>choiceIdentifier</key>
        <string>com.corel.pkg.painter2020.German</string>
        <key>choiceAttribute</key>
        <string>selected</string>
        <key>attributeSetting</key>
        <integer>0</integer>
    </dict>
     <dict>
        <key>choiceIdentifier</key>
        <string>com.corel.pkg.painter2020.French</string>
        <key>choiceAttribute</key>
        <string>selected</string>
        <key>attributeSetting</key>
        <integer>0</integer>
    </dict>
</array>
</plist>

This will install the default choices, with the exception of the above four components, whose attributeSetting are all set to zero.

To reproduce these choices with ChoicesXMLGenerator, I would need to specify the other components as desired, which to me seems less resilient and more prone to failure if new components are added to subsequent software versions.

  - Processor: com.github.grahampugh.recipes.commonprocessors/ChoicesXMLGenerator
    Arguments:
      choices_pkg_path: "%pkg_path%"
      choices_xml_dest: "%RECIPE_CACHE_DIR%/Scripts/choices.xml"
      desired_choices:
        - com.corel.pkg.painter2020
        - com.corel.pkg.stubhelper.painter2020
        - com.corel.Messages
        - com.corel.CUH
        - com.corel.PCU2
        - com.corel.CUH.update
        - com.corel.LaunchAgents

Ideally, the choices argument would allow eithersetting the attributeSetting to either true (1) or false (0), and would leave at the default if unspecified. A dictionary would work for this, since the choice identifiers should be unique anyway. Like so:

  - Processor: com.github.grahampugh.recipes.commonprocessors/ChoicesXMLGenerator
    Arguments:
      choices_pkg_path: "%pkg_path%"
      choices_xml_dest: "%RECIPE_CACHE_DIR%/Scripts/choices.xml"
      choice_changes:
        com.corel.pkg.painter2020.zh_TW: false
        com.corel.pkg.painter2020.Japanese: false
        com.corel.pkg.painter2020.German: false
        com.corel.pkg.painter2020.French: false

Thanks for considering!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions