diff --git a/downloader/filter.go b/downloader/filter.go index 2ddd37d..9c05721 100644 --- a/downloader/filter.go +++ b/downloader/filter.go @@ -12,6 +12,7 @@ import ( const ( Platform83Project = "Platform83" EDTProject = "DevelopmentTools10" + PostgreSQLProject = "AddCompPostgre" ) const ( x64re = "(?smU)(?:64-bit|64 бит).*" @@ -44,7 +45,7 @@ var ( "edt": EDTProject, "ring": "EnterpriseLicenseTools", "executor": "Executor", - "pg": "AddCompPostgres", + "pg": PostgreSQLProject, } shortFilters = map[string]string{ @@ -96,6 +97,8 @@ func NewFileFilter(project string, filter string) (FileFilter, error) { switch project { case Platform83Project: return newPlatformMatchFilter(filter) + case PostgreSQLProject: + return newPlatformMatchFilter(filter) case EDTProject: return newEdtFilter(filter) default: diff --git a/downloader/oneDownloader_test.go b/downloader/oneDownloader_test.go index a28a011..a401b30 100644 --- a/downloader/oneDownloader_test.go +++ b/downloader/oneDownloader_test.go @@ -111,6 +111,32 @@ func Test_filterReleaseFiles(t *testing.T) { }, }, 1, + }, { + "PosqtreSQL with 14.1-2.1C", + args{ + list: []ReleaseFileInfo{ + { + "Дистрибутив СУБД PostgreSQL для Windows (64-bit) одним архивом", + "/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_x64.zip", + }, { + "Дистрибутив СУБД PostgreSQL для Linux x86 (64-bit) одним архивом (RPM)", + "/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_x86_64_rpm.tar.bz2", + }, { + "Дистрибутив СУБД PostgreSQL для Linux x86 (64-bit) (дополнительные модули) одним архивом (RPM)", + "/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_x86_64_addon_rpm.tar.bz2", + }, { + "Дистрибутив СУБД PostgreSQL для Linux x86 (64-bit) одним архивом (DEB)", + "/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_amd64_deb.tar.bz2", + }, { + "Дистрибутив СУБД PostgreSQL для Linux x86 (64-bit) (дополнительные модули) одним архивом (DEB)", + "/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_amd64_addon_deb.tar.bz2", + }, + }, + filters: []FileFilter{ + NewFileFilterMust(PostgreSQLProject, "deb.x64@14.1-2.1C"), + }, + }, + 2, }, } for _, tt := range tests {