This function allows you to change the values within a bundle definition. Using this function will change the file itself.
Function Name: SetBundleDef() Inputs: bundledef => Location of bundle definition file key => Value within bundle definition to modify value => New value for bundle definition Valid values for 'key' are: IncludedPkgs - Change the list of packages explicitly included in the bundle definition. See not below for format of value. ExcludedPkgs - Change the list of packages explicitly excluded in the bundle definition. See not below for format of value. Flags - Set the flags given in the bundle definition. Value must be an array of scalars of valid bundle flags. Name - Set the name of the bundle definition. Note that this is not the name of the file the definition is stored in. value must be a scalar. VersionLabel - Set the version label of the bundle definition. value must be a scalar. * In the case of 'key' equals 'IncludedPkgs' or 'ExcludedPkgs', value must be an array of hashes with the following fields: pkgName => Name of package pkgVer => Package version pkgFlav => Package flavor pkgType => Package type
Examples:
# Set the verion of all packages to 2.0 my @inclpkgs = (); for my $pkg (GPTAPI::QueryBundleDef(bundledef => "client.gpt-bundle.xml", key => "IncludedPkgs")) { my ($name, $flavor, $type) = $pkg =~ m!(.+)-([^_]+)_(.+)!; push @inclpkgs, { pkgName => $name, pkgVer => "2.0", pkgFlav => $flavor, pkgType => $type}; } GPTAPI::SetBundleDef(bundledef => "client.gpt-bundle.xml", key => "IncludedPkgs", value => \@inclpkgs);