diff --git a/trurl-0.16.1.tar.gz b/trurl-0.16.1.tar.gz new file mode 100644 index 0000000..4913215 --- /dev/null +++ b/trurl-0.16.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aac947d4fb421a58abc19a3771e87942cd4721b8f855c433478c94c11a8203ba +size 64088 diff --git a/trurl-0.16.tar.gz b/trurl-0.16.tar.gz deleted file mode 100644 index 7f18ef6..0000000 --- a/trurl-0.16.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2c26e3016f591f06234838bbe1dd4b165dce2c871c82ca6a32222d19696588d6 -size 59327 diff --git a/trurl-395-exculdes-uppercase.patch b/trurl-395-exculdes-uppercase.patch new file mode 100644 index 0000000..5baa10e --- /dev/null +++ b/trurl-395-exculdes-uppercase.patch @@ -0,0 +1,218 @@ +From cf31169316dad2357c1314f444b9eeffa99431eb Mon Sep 17 00:00:00 2001 +From: Jacob Mealey +Date: Sat, 5 Jul 2025 14:52:10 -0400 +Subject: [PATCH] introduce 'excludes' option for tests, address hexadecimal + changes from libcurl + +Thanks @charles2910 for reporting this bug +fixes: #394 +--- + test.py | 7 ++- + tests.json | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + trurl.c | 2 + + 3 files changed, 132 insertions(+), 1 deletion(-) + +diff --git a/test.py b/test.py +index f1c489c5..a7855656 100644 +--- a/test.py ++++ b/test.py +@@ -250,11 +250,16 @@ def main(argc, argv): + print(f"Missing feature, skipping test {testIndex + 1}.") + numTestsSkipped += 1 + continue ++ excludes = allTests[testIndex].get("excludes", None) ++ if excludes and set(excludes).issubset(set(features)): ++ print(f"Test not compatible, skipping test {testIndex + 1}") ++ numTestsSkipped += 1 ++ continue + encoding = allTests[testIndex].get("encoding", None) + if encoding and encoding != getcharmap(): + print(f"Invalid locale, skipping test {testIndex + 1}.") + numTestsSkipped += 1 +- continue; ++ continue + + test = TestCase(testIndex + 1, runnerCmd, baseCmd, **allTests[testIndex]) + +diff --git a/tests.json b/tests.json +index 891271ca..10b995ae 100644 +--- a/tests.json ++++ b/tests.json +@@ -702,6 +702,7 @@ + "user=:hej:" + ] + }, ++ "excludes": ["uppercase-hex"], + "expected": { + "stdout": "https://%3ahej%3a@curl.se/hello\n", + "stderr": "", +@@ -2030,6 +2031,7 @@ + "localhost" + ] + }, ++ "excludes": ["uppercase-hex"], + "expected": { + "stdout": "/\\\\\n/%5c%5c\n", + "returncode": 0, +@@ -2045,6 +2047,7 @@ + "localhost" + ] + }, ++ "excludes": ["uppercase-hex"], + "expected": { + "stdout": [ + { +@@ -2071,6 +2074,7 @@ + "localhost" + ] + }, ++ "excludes": ["uppercase-hex"], + "expected": { + "stdout": "/%5c%5c\n/%5c%5c\n", + "returncode": 0, +@@ -2089,6 +2093,7 @@ + "localhost" + ] + }, ++ "excludes": ["uppercase-hex"], + "expected": { + "stdout": [ + { +@@ -3318,5 +3323,124 @@ + "stdout": "http://e/?e&a\n", + "returncode": 0 + } ++ }, ++ { ++ "input": { ++ "arguments": [ ++ "-s", ++ "path=\\\\", ++ "--json", ++ "localhost" ++ ] ++ }, ++ "required": ["uppercase-hex"], ++ "expected": { ++ "stdout": [ ++ { ++ "url": "http://localhost/%5C%5C", ++ "parts": { ++ "scheme": "http", ++ "host": "localhost", ++ "path": "/\\\\" ++ } ++ } ++ ], ++ "returncode": 0, ++ "stderr": "" ++ } ++ }, ++ { ++ "input": { ++ "arguments": [ ++ "-s", ++ "path=\\\\", ++ "-g", ++ "{path}\\n{:path}", ++ "--urlencode", ++ "localhost" ++ ] ++ }, ++ "required": ["uppercase-hex"], ++ "expected": { ++ "stdout": "/%5C%5C\n/%5C%5C\n", ++ "returncode": 0, ++ "stderr": "" ++ } ++ }, ++ { ++ "input": { ++ "arguments": [ ++ "-s", ++ "path=abc\\\\", ++ "-s", ++ "query:=a&b&a%26b", ++ "--urlencode", ++ "--json", ++ "localhost" ++ ] ++ }, ++ "required": ["uppercase-hex"], ++ "expected": { ++ "stdout": [ ++ { ++ "url": "http://localhost/abc%5C%5C?a&b&a%26b", ++ "parts": { ++ "scheme": "http", ++ "host": "localhost", ++ "path": "/abc%5C%5C", ++ "query": "a&b&a%26b" ++ }, ++ "params": [ ++ { ++ "key": "a", ++ "value": "" ++ }, ++ { ++ "key": "b", ++ "value": "" ++ }, ++ { ++ "key": "a&b", ++ "value": "" ++ } ++ ] ++ } ++ ], ++ "returncode": 0, ++ "stderr": "" ++ } ++ }, ++ { ++ "input": { ++ "arguments": [ ++ "--url", ++ "https://curl.se/hello", ++ "--set", ++ "user=:hej:" ++ ] ++ }, ++ "required": ["uppercase-hex"], ++ "expected": { ++ "stdout": "https://%3Ahej%3A@curl.se/hello\n", ++ "stderr": "", ++ "returncode": 0 ++ } ++ }, ++ { ++ "input": { ++ "arguments": [ ++ "-s", ++ "path=\\\\", ++ "-g", ++ "{path}\\n{:path}", ++ "localhost" ++ ] ++ }, ++ "required": ["uppercase-hex"], ++ "expected": { ++ "stdout": "/\\\\\n/%5C%5C\n", ++ "returncode": 0, ++ "stderr": "" ++ } + } + ] +diff --git a/trurl.c b/trurl.c +index f79b1791..5a3311d9 100644 +--- a/trurl.c ++++ b/trurl.c +@@ -316,6 +316,8 @@ static void show_version(void) + #ifdef SUPPORTS_ZONEID + fprintf(stdout, " zone-id"); + #endif ++ if(data->version_num >= 0x080f00) ++ fprintf(stdout, " uppercase-hex"); + + fprintf(stdout, "\n"); + exit(0); diff --git a/trurl.changes b/trurl.changes index 7f209c6..7460908 100644 --- a/trurl.changes +++ b/trurl.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Tue Aug 19 14:27:03 UTC 2025 - Christoph G + +- Add trurl-395-exculdes-uppercase.patch to fix failing test, + upstream from https://github.com/curl/trurl/pull/395 + +------------------------------------------------------------------- +Sun May 18 08:13:12 UTC 2025 - Martin Hauke + +- Update to version 0.16.1 + * Generate ZSH completions base on trurl.md. + * Makefile: only create MANDIR when manpage is installed. + * trurl: handle zero length query pairs. +- Create subpackage for zsh-completion + ------------------------------------------------------------------- Thu Sep 19 14:56:57 UTC 2024 - Martin Hauke diff --git a/trurl.spec b/trurl.spec index 6a1694e..a3ade6e 100644 --- a/trurl.spec +++ b/trurl.spec @@ -1,8 +1,8 @@ # # spec file for package trurl # -# Copyright (c) 2024 SUSE LLC -# Copyright (c) 2023-2024, Martin Hauke +# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2023-2025, Martin Hauke # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: trurl -Version: 0.16 +Version: 0.16.1 Release: 0 Summary: Command line tool for URL parsing and manipulation License: MIT @@ -26,6 +26,8 @@ Group: Productivity/Networking/Web/Utilities #Git-Clone: https://github.com/curl/trurl.git URL: https://curl.se/trurl Source: https://github.com/curl/trurl/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM exclude tests with uppercase +Patch0: trurl-395-exculdes-uppercase.patch BuildRequires: pkgconfig BuildRequires: python3 BuildRequires: pkgconfig(libcurl) >= 7.62.0 @@ -34,14 +36,26 @@ BuildRequires: pkgconfig(libcurl) >= 7.62.0 A CLI tool that parses and manipulates URLs, designed to help shell script authors everywhere. +%package zsh-completion +Summary: Zsh Completion for %{name} +Group: System/Shells +Supplements: (%{name} and zsh) +Requires: zsh +BuildArch: noarch + +%description zsh-completion +Zsh command-line completion support for %{name}. + %prep -%setup -q +%autosetup %build %make_build PREFIX=%{_prefix} +make completions %install make PREFIX=%{_prefix} DESTDIR=%{buildroot} install +install -Dm 0644 completions/_trurl.zsh %{buildroot}%{_datadir}/zsh/site-functions/_%{name} %check make test @@ -52,4 +66,8 @@ make test %{_bindir}/trurl %{_mandir}/man1/trurl.1%{?ext_man} +%files zsh-completion +%dir %{_datadir}/zsh +%{_datadir}/zsh/* + %changelog