From 39a78ba8efe4b74507e9e0085077c5e8929859af Mon Sep 17 00:00:00 2001 From: ttp Date: Sat, 13 Jun 2009 19:35:23 +0900 Subject: [PATCH] =?utf8?q?na-get-lib,=E3=83=AC=E3=83=9D=E3=82=B8=E3=83=88?= =?utf8?q?=E3=83=AA=E3=82=BF=E3=82=A4=E3=83=97=E3=81=AE=E8=BF=BD=E5=8A=A0?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 今まで使っていたソフトリストのフォーマットタイプを"AppliStation Native XML Format 1.0"とした。 --- na-get-lib/NaGet.Packages/RepositoriesList.cs | 18 ++++++++++++++++++ na-get-lib/NaGet.SubCommands/NaGetUpdate.cs | 18 +++++++++++------- repos.list.xml | 2 +- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/na-get-lib/NaGet.Packages/RepositoriesList.cs b/na-get-lib/NaGet.Packages/RepositoriesList.cs index a2cd1a4..5b72218 100644 --- a/na-get-lib/NaGet.Packages/RepositoriesList.cs +++ b/na-get-lib/NaGet.Packages/RepositoriesList.cs @@ -60,6 +60,18 @@ namespace NaGet.Packages } /// + /// レポジトリで提供されるソフトリストのフォーマットを返す + /// + public enum RepositoryType : uint + { + /// + /// AppliStation Native XML Format Version 1.0 + /// + [XmlEnum(Name="ASNATIVEv1.0")] + APPLISTATION_NATIVE_XML_1_0 = 0, + } + + /// /// パッケージリストを提供するレポジトリの参照情報を格納するクラス /// public class RepositoryInfo @@ -72,6 +84,12 @@ namespace NaGet.Packages public string Name; /// + /// ソフトリストの形式 + /// + [XmlAttribute] + public RepositoryType Type; + + /// /// ソフトリストの取得先URL /// public LocationEntry Url; diff --git a/na-get-lib/NaGet.SubCommands/NaGetUpdate.cs b/na-get-lib/NaGet.SubCommands/NaGetUpdate.cs index de47715..43ca4a4 100644 --- a/na-get-lib/NaGet.SubCommands/NaGetUpdate.cs +++ b/na-get-lib/NaGet.SubCommands/NaGetUpdate.cs @@ -120,13 +120,17 @@ namespace NaGet.SubCommands try { Downloader.Download(repo.Url.Href, tmpfileName); - PackageList pkgList = NaGet.Utils.GetDeserializedObject>(tmpfileName); - pkgList.FixPackageListName(); // PackageListNameとの紐付けを行う - - // RepositoryReferenceの名前を読み込む // TODO RepositoryReferenceの名前を読み込む処理はここでいいのか? - repo.Name = (string.IsNullOrEmpty(pkgList.Name))? repo.Name : pkgList.Name; - - avaiablePackageList.AddPackages(pkgList.Packages); + if (repo.Type == RepositoryType.APPLISTATION_NATIVE_XML_1_0) { + PackageList pkgList = NaGet.Utils.GetDeserializedObject>(tmpfileName); + pkgList.FixPackageListName(); // PackageListNameとの紐付けを行う + + // RepositoryReferenceの名前を読み込む // TODO RepositoryReferenceの名前を読み込む処理はここでいいのか? + repo.Name = (string.IsNullOrEmpty(pkgList.Name))? repo.Name : pkgList.Name; + + avaiablePackageList.AddPackages(pkgList.Packages); + } else { + RaiseTaskSetEvent(NaGetTaskSetEventType.WARNING, string.Format("Repository {0} is illegal type.", repo.Name ?? repo.Url.Href)); + } } finally { if (File.Exists(tmpfileName)) { File.Delete(tmpfileName); diff --git a/repos.list.xml b/repos.list.xml index 236c29f..8cf59e5 100644 --- a/repos.list.xml +++ b/repos.list.xml @@ -1,7 +1,7 @@ - + -- 2.11.0