From 4eb348214ee3663e618915fd8ced293d5d6ac86d Mon Sep 17 00:00:00 2001 From: Jan Wielemaker Date: Tue, 24 Sep 2024 10:25:41 +0200 Subject: [PATCH] FIXED: Package manager, ``swipl pack publish .`` Broken detection of git directory and failure do deal with requires(prolog:flag(_Value)). to test for _existence_ of a Prolog flag. --- library/prolog_pack.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/library/prolog_pack.pl b/library/prolog_pack.pl index 4f976b979d..c66a7d3212 100644 --- a/library/prolog_pack.pl +++ b/library/prolog_pack.pl @@ -1688,7 +1688,9 @@ % system. is_prolog_token(Token), cmp(Token, prolog, _Cmp, _Version) => true. -is_prolog_token(prolog:_Feature) => true. +is_prolog_token(prolog:Feature), atom(Feature) => true. +is_prolog_token(prolog:Feature), flag_value_feature(Feature, _Flag, _Value) => + true. is_prolog_token(_) => fail. %! prolog_satisfies(+Token) is semidet. @@ -1716,7 +1718,8 @@ flag_value_feature(Feature, Flag, Value) :- compound(Feature), - compound_name_arguments(Feature, Flag, [Value]). + compound_name_arguments(Feature, Flag, [Value]), + atom(Flag). /******************************* @@ -1810,7 +1813,6 @@ dir_metadata(GitDir, Info) :- directory_file_path(GitDir, 'pack.pl', InfoFile), read_file_to_terms(InfoFile, Info, [encoding(utf8)]), - must_be(ground, Info), maplist(valid_term(pack_info_term), Info). %! download_file_sanity_check(+Archive, +Pack, +Info) is semidet. @@ -2156,7 +2158,8 @@ url_scheme(URL, Scheme) :- atom(URL), uri_components(URL, Components), - uri_data(scheme, Components, Scheme). + uri_data(scheme, Components, Scheme), + atom(Scheme). download_scheme(http). download_scheme(https).