Skip to content

Commit 675f4a9

Browse files
committed
(chocolatey#798) Add PinPackage element to packages.config
This adds the PinPackages element to the deffinition of the packages.config format. This allows the pin-packages argument to be used via a config file.
1 parent faf1bb5 commit 675f4a9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs

+3
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,8 @@ public sealed class PackagesConfigFilePackageSetting
158158

159159
[XmlAttribute(AttributeName = "noProgress")]
160160
public bool NoProgress { get; set; }
161+
162+
[XmlAttribute(AttributeName = "pinPackage")]
163+
public bool PinPackage { get; set; })
161164
}
162165
}

src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs

+1
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ private IEnumerable<ChocolateyConfiguration> get_packages_from_config(string pac
778778
if (pkgSettings.FailOnStderr) packageConfig.Features.FailOnStandardError = true;
779779
if (pkgSettings.UseSystemPowershell) packageConfig.Features.UsePowerShellHost = false;
780780
if (pkgSettings.NoProgress) packageConfig.Features.ShowDownloadProgress = false;
781+
if (pkgSettings.PinPackage) packageConfig.PinPackage = true;
781782

782783
this.Log().Info(ChocolateyLoggers.Important, @"{0}".format_with(packageConfig.PackageNames));
783784
packageConfigs.Add(packageConfig);

0 commit comments

Comments
 (0)