OSDN Git Service

na-get-lib,all-get,インストール除外リストの設定を追加。all-get.exeのcheckupgrade表示への反映
[applistation/AppliStation.git] / all-get / Main.cs
index 2989c34..92af7f3 100644 (file)
@@ -127,28 +127,32 @@ namespace AllGet
                public void CheckUpgrade()\r
                {\r
                        PackageList<Package> packageList = pkgListMan.AvailablePkgList;\r
+                       string[] exclude = NaGet.Env.ExcludeUpdatePackageNames;\r
                        \r
                        VersionComparetor verComp = new VersionComparetor();\r
                        \r
                        foreach (InstalledPackage pkg in pkgListMan.InstalledPkgList) {\r
-                               Package avaiablePkg = packageList.GetPackageForName(pkg.Name);\r
-                               \r
-                               if (avaiablePkg != null) {\r
-                                       if (verComp.Compare(pkg.Version, avaiablePkg.Version) < 0 &&\r
-                                           pkgListMan.InstalledPkgList.GetPackageForPackage(pkg.Name, avaiablePkg.Version) == null) {\r
-                                               \r
-                                               Console.WriteLine("{0} ({1}) => ({2})", pkg.Name, pkg.Version, avaiablePkg.Version);\r
+                               if (Array.IndexOf(exclude ?? new string[0], pkg.Name) < 0) {\r
+                                       Package avaiablePkg = packageList.GetPackageForName(pkg.Name);\r
+                                       if (avaiablePkg != null) {\r
+                                               if (verComp.Compare(pkg.Version, avaiablePkg.Version) < 0 &&\r
+                                                   pkgListMan.InstalledPkgList.GetPackageForPackage(pkg.Name, avaiablePkg.Version) == null) {\r
+                                                       \r
+                                                       Console.WriteLine("{0} ({1}) => ({2})", pkg.Name, pkg.Version, avaiablePkg.Version);\r
+                                               }\r
                                        }\r
                                }\r
                        }\r
                        foreach (InstalledPackage pkg in pkgListMan.SystemInstalledPkgList) {\r
-                               Package avaiablePkg = packageList.GetPackageForName(pkg.Name);\r
-                               \r
-                               if (avaiablePkg != null) {\r
-                                       if (verComp.Compare(pkg.Version, avaiablePkg.Version) < 0 &&\r
-                                           pkgListMan.SystemInstalledPkgList.GetPackageForPackage(pkg.Name, avaiablePkg.Version) == null) {\r
-                                               \r
-                                               Console.WriteLine("{0} ({1})@sys => ({2})", pkg.Name, pkg.Version, avaiablePkg.Version);\r
+                               if (Array.IndexOf(exclude ?? new string[0], pkg.Name) < 0) {\r
+                                       Package avaiablePkg = packageList.GetPackageForName(pkg.Name);\r
+                                       \r
+                                       if (avaiablePkg != null) {\r
+                                               if (verComp.Compare(pkg.Version, avaiablePkg.Version) < 0 &&\r
+                                                   pkgListMan.SystemInstalledPkgList.GetPackageForPackage(pkg.Name, avaiablePkg.Version) == null) {\r
+                                                       \r
+                                                       Console.WriteLine("{0} ({1})@sys => ({2})", pkg.Name, pkg.Version, avaiablePkg.Version);\r
+                                               }\r
                                        }\r
                                }\r
                        }\r