From e8689a88720e0c5b53510889fdeddd9810f32b05bacb18b2a0a36805bf82cc03 Mon Sep 17 00:00:00 2001 From: Martin Hauke Date: Thu, 22 May 2025 18:36:43 +0000 Subject: [PATCH 1/2] Accepting request 1278217 from home:mnhauke - 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 OBS-URL: https://build.opensuse.org/request/show/1278217 OBS-URL: https://build.opensuse.org/package/show/network:utilities/trurl?expand=0&rev=34 --- .gitattributes | 23 +++++ .gitignore | 1 + trurl-0.13.tar.gz | 3 + trurl-0.14.tar.gz | 3 + trurl-0.15.tar.gz | 3 + trurl-0.16.1.tar.gz | 3 + trurl-0.16.tar.gz | 3 + trurl.changes | 235 ++++++++++++++++++++++++++++++++++++++++++++ trurl.spec | 71 +++++++++++++ 9 files changed, 345 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 trurl-0.13.tar.gz create mode 100644 trurl-0.14.tar.gz create mode 100644 trurl-0.15.tar.gz create mode 100644 trurl-0.16.1.tar.gz create mode 100644 trurl-0.16.tar.gz create mode 100644 trurl.changes create mode 100644 trurl.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/trurl-0.13.tar.gz b/trurl-0.13.tar.gz new file mode 100644 index 0000000..d06ac3b --- /dev/null +++ b/trurl-0.13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ceeb09d0e08dc677897f26651aa625d9ad18021f881f9d5f31e5a95bb3cc047 +size 46408 diff --git a/trurl-0.14.tar.gz b/trurl-0.14.tar.gz new file mode 100644 index 0000000..2b28593 --- /dev/null +++ b/trurl-0.14.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5080ce71984fc620c1d12010c70c22e8020aeeba7009afcdfce7a9ea40caa4d2 +size 47830 diff --git a/trurl-0.15.tar.gz b/trurl-0.15.tar.gz new file mode 100644 index 0000000..20a3565 --- /dev/null +++ b/trurl-0.15.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e58d9a698c009b2b1381f5636b5334ce7704ad2cd5ae8d30da97d483518a7f25 +size 53909 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 new file mode 100644 index 0000000..7f18ef6 --- /dev/null +++ b/trurl-0.16.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c26e3016f591f06234838bbe1dd4b165dce2c871c82ca6a32222d19696588d6 +size 59327 diff --git a/trurl.changes b/trurl.changes new file mode 100644 index 0000000..197e16b --- /dev/null +++ b/trurl.changes @@ -0,0 +1,235 @@ +------------------------------------------------------------------- +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 + +- Update to version 0.16 + * tests.json: add tests extracing URL encoded components. + * trurl: normalize the fragment. + * trurl: make sure URL encoded %-hex is done lowercase. + * README: minor language polish. + * trurl: silence --replace-append when appending. + * trurl.md: document URL component details. + * trurl.md: extend the component sections with more examples. + * trurl: introduce --qtrim for trimming queries (only). + * trurl.c: clarify the --help text for --urlencode. + * tests.json: add more tests. + * trurl: fix a few returns codes for out of memory. + * tests: verify --get + --json rejects. + * trurl.md: provide examples to more option descriptions. + +------------------------------------------------------------------- +Sat Sep 14 07:48:58 UTC 2024 - Martin Hauke + +- Update to version 0.15.1 + * manpage: fix 0.15 mistakes. + * Makefile: check for trurl.1 before installing. + * trurl: fix misbehavior on empty query param. + * trurl: fix handling of query pair with blank left side by. + +------------------------------------------------------------------- +Wed Aug 28 11:48:48 UTC 2024 - Martin Hauke + +- Update to version 0.15 + - Makefile: fix LDFLAGS order; and don't force -Werror. + - singleurl: fix query_is_modified. + - trurl: "normalize" query pairs. + - trurl: accept "control codes" in get output. + - trurl: allow "control bytes" in JSON output + - trurl: canonicalize the path. + - trurl: fix silent error in json json function. + - trurl: make --replace URL encode the provided data argument. + - trurl: make must: prefix for gets return error for missing part. + - trurl: on strdup() failures, exit immediately. + - trurl: optimize the path append loop. + - trurl: rename --force-replace to --replace-append. + - trurl: use casecompare instead of a strncasecmp define. + +------------------------------------------------------------------- +Mon Jul 29 20:00:22 UTC 2024 - Martin Hauke + +- Update to version 0.14 + * remove a suprious trailing newline from a warning. + * trurl.1: document the exit codes. + * add "strict:" as prefix to a get component. + * casecompare: a strncasemp replacement. + * support conditionally set scheme. + +------------------------------------------------------------------- +Wed May 15 15:47:08 UTC 2024 - Martin Hauke + +- Update to version 0.13 + * Free allocated pointer on OOM error. + * short options need no space separation for the argument anymore + * trurl.1: use present tense. + * trurl: only append the first iterate loop. + * fix Coverity nits. + +------------------------------------------------------------------- +Thu Apr 18 21:44:49 UTC 2024 - Martin Hauke + +- Update to version 0.12 + * This is the same as 0.11 but with the version string set + correctly. + +------------------------------------------------------------------- +Thu Apr 18 15:32:54 UTC 2024 - Martin Hauke + +- Update to version 0.11 + * Added UTF-8 detection to test runner. + * use of free() instead of curl_free(). + * output the list of components correctly in the help output. + * if query is not updated, leave it untouched. + * expand the warning on "internal problem". + * error when using an unrecognized URL component. + +------------------------------------------------------------------- +Wed Feb 21 21:20:22 UTC 2024 - Martin Hauke + +- Update to version 0.10 + Changes: + * add --replace + Bugfixes: + * fixed buffer overflows on %00 use + * enable more C compiler warnings and fix them + +------------------------------------------------------------------- +Tue Oct 31 17:51:46 UTC 2023 - Martin Hauke + +- Update to version 0.9 + Changes: + * add --as-idn and punycode to IDN conversion + * add --curl to only count as valid URLs supported by libcurl + Bugfixes: + * accept * as a trim name to trim a literal asterisk name + * format null as \u0000 for --json + * run --trim query before --append query +- Drop patch + * trurl-disable-broken-tests.patch (fixed by upstream) + +------------------------------------------------------------------- +Fri Sep 22 06:43:33 UTC 2023 - Martin Hauke + +- Add patch: + * trurl-disable-broken-tests.patch + +------------------------------------------------------------------- +Sat Jun 17 12:01:48 UTC 2023 - Martin Hauke + +- Update to version 0.8 + Changes: + * add --urlencode + Bugfixes: + * --json/--get: .[].parts and {component} should be urldecoded + not encoded + * tests: use empty file instead of /dev/null + * typos in manpage + * Makefile: Allow CFLAGS to be appendable + * Makefile: be explicit in C standard to use + +------------------------------------------------------------------- +Tue Jun 13 13:17:57 UTC 2023 - Andrea Manzini + +- Update to version 0.7 + * Changes: + --default-port to ask for the default to be used if not present + --keep-port to ask for the port number to be there even if default + --no-guess-scheme option to disable scheme guessing + --punycode to ask for the punycode version in output + + * Bugfixes: + --help returns 0 instead of 1 + --json: print empty arrays + --redirect: don't silently ignore failed redirections. + refuse setting same component in --set as --iterate + restructure the JSON output object + send -h output to stdout, not stderr + +------------------------------------------------------------------- +Wed Apr 26 18:24:50 UTC 2023 - Martin Hauke + +- Update to version 0.6 + * offer {puny:host} and {puny:url} for --get + * provide built-with libcurl version info for --version + * support for skipping tests + * test.py replaced test.pl + * test.py supports --with-valgrind + * tests.json: extended and updated + * URL-QUIRKS: specify if they are build-time or run-time + requirements + +------------------------------------------------------------------- +Mon Apr 17 18:08:18 UTC 2023 - Martin Hauke + +- Update to version 0.5 + Changes since previous release + * --get supports variables in [brackets] as well + * --get {query-all:key} outputs all values for 'key' in the + query + * switched to test.py for tests + * --iterate is a new option. + Bugfixes since previous release + * handle %00 sequences in {query:key} output + * support reading URL from a file without a newline + * fixed a json memory-leak + +------------------------------------------------------------------- +Mon Apr 10 14:13:12 UTC 2023 - Martin Hauke + +- Update to version 0.4 + Changes + * --get supports showing {query:key} + * --json outputs query pairs under "params" + * -a is an --append shortcut + * add --query-separator + * add --sort-query + Bugfixes + * components names are lower case and case sensitive + * fixed the json output of UTF-8 sequences + * flush stdout after handling every URL + * mixing --json with --get is an error + * more test cases + * show error messsage when component setting fails + * support "--" end-of-options argument + * support for building with older libcurl versions + +------------------------------------------------------------------- +Thu Apr 6 13:41:01 UTC 2023 - Martin Hauke + +- Update to version 0.3 + Changes + * the set port is the same as the scheme-default, don't show + * many more tests + * https://curl.se/trurl is now the project's website + * added --accept-space + * added --trim + Bugfixes + * setting port to a blank now clears it + * improved the man page + * fix --append query when no previous query exists + * output JSON as an array + * provide the -h list in pure alphabetical order + * use 0644 for the man page install + * use Test::More inside of test.pl + * nicer JSON tests and test output +- Drop patch: + * trurl-manpage-fix-spurious-executable-perm-manpage.patch +- Run testsuite + +------------------------------------------------------------------- +Mon Apr 3 20:36:08 UTC 2023 - Martin Hauke + +- Add patch + * trurl-manpage-fix-spurious-executable-perm-manpage.patch + +------------------------------------------------------------------- +Mon Apr 3 20:29:56 UTC 2023 - Martin Hauke + +- Initial package, version 0.2 diff --git a/trurl.spec b/trurl.spec new file mode 100644 index 0000000..c0bdfa8 --- /dev/null +++ b/trurl.spec @@ -0,0 +1,71 @@ +# +# spec file for package trurl +# +# 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: trurl +Version: 0.16.1 +Release: 0 +Summary: Command line tool for URL parsing and manipulation +License: MIT +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 +BuildRequires: pkgconfig +BuildRequires: python3 +BuildRequires: pkgconfig(libcurl) >= 7.62.0 + +%description +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 +%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 + +%files +%license COPYING +%doc README.md RELEASE-NOTES +%{_bindir}/trurl +%{_mandir}/man1/trurl.1%{?ext_man} + +%files zsh-completion +%dir %{_datadir}/zsh +%{_datadir}/zsh/* + +%changelog -- 2.51.1 From dcfefa4ddf040e6095e1070559b4717b87a475e9599059e2f1e4a2ffb47bf4c8 Mon Sep 17 00:00:00 2001 From: Ana Guerrero Date: Fri, 5 Sep 2025 08:21:40 +0000 Subject: [PATCH 2/2] Fix Factory build - Add trurl-395-exculdes-uppercase.patch to fix failing test, upstream from https://github.com/curl/trurl/pull/395 OBS-URL: https://build.opensuse.org/package/show/network:utilities/trurl?expand=0&rev=36 --- .gitattributes | 23 +++ .gitignore | 1 + trurl-0.16.1.tar.gz | 3 + trurl-395-exculdes-uppercase.patch | 218 ++++++++++++++++++++++++++ trurl.changes | 241 +++++++++++++++++++++++++++++ trurl.spec | 73 +++++++++ 6 files changed, 559 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 trurl-0.16.1.tar.gz create mode 100644 trurl-395-exculdes-uppercase.patch create mode 100644 trurl.changes create mode 100644 trurl.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc 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-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 new file mode 100644 index 0000000..7460908 --- /dev/null +++ b/trurl.changes @@ -0,0 +1,241 @@ +------------------------------------------------------------------- +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 + +- Update to version 0.16 + * tests.json: add tests extracing URL encoded components. + * trurl: normalize the fragment. + * trurl: make sure URL encoded %-hex is done lowercase. + * README: minor language polish. + * trurl: silence --replace-append when appending. + * trurl.md: document URL component details. + * trurl.md: extend the component sections with more examples. + * trurl: introduce --qtrim for trimming queries (only). + * trurl.c: clarify the --help text for --urlencode. + * tests.json: add more tests. + * trurl: fix a few returns codes for out of memory. + * tests: verify --get + --json rejects. + * trurl.md: provide examples to more option descriptions. + +------------------------------------------------------------------- +Sat Sep 14 07:48:58 UTC 2024 - Martin Hauke + +- Update to version 0.15.1 + * manpage: fix 0.15 mistakes. + * Makefile: check for trurl.1 before installing. + * trurl: fix misbehavior on empty query param. + * trurl: fix handling of query pair with blank left side by. + +------------------------------------------------------------------- +Wed Aug 28 11:48:48 UTC 2024 - Martin Hauke + +- Update to version 0.15 + - Makefile: fix LDFLAGS order; and don't force -Werror. + - singleurl: fix query_is_modified. + - trurl: "normalize" query pairs. + - trurl: accept "control codes" in get output. + - trurl: allow "control bytes" in JSON output + - trurl: canonicalize the path. + - trurl: fix silent error in json json function. + - trurl: make --replace URL encode the provided data argument. + - trurl: make must: prefix for gets return error for missing part. + - trurl: on strdup() failures, exit immediately. + - trurl: optimize the path append loop. + - trurl: rename --force-replace to --replace-append. + - trurl: use casecompare instead of a strncasecmp define. + +------------------------------------------------------------------- +Mon Jul 29 20:00:22 UTC 2024 - Martin Hauke + +- Update to version 0.14 + * remove a suprious trailing newline from a warning. + * trurl.1: document the exit codes. + * add "strict:" as prefix to a get component. + * casecompare: a strncasemp replacement. + * support conditionally set scheme. + +------------------------------------------------------------------- +Wed May 15 15:47:08 UTC 2024 - Martin Hauke + +- Update to version 0.13 + * Free allocated pointer on OOM error. + * short options need no space separation for the argument anymore + * trurl.1: use present tense. + * trurl: only append the first iterate loop. + * fix Coverity nits. + +------------------------------------------------------------------- +Thu Apr 18 21:44:49 UTC 2024 - Martin Hauke + +- Update to version 0.12 + * This is the same as 0.11 but with the version string set + correctly. + +------------------------------------------------------------------- +Thu Apr 18 15:32:54 UTC 2024 - Martin Hauke + +- Update to version 0.11 + * Added UTF-8 detection to test runner. + * use of free() instead of curl_free(). + * output the list of components correctly in the help output. + * if query is not updated, leave it untouched. + * expand the warning on "internal problem". + * error when using an unrecognized URL component. + +------------------------------------------------------------------- +Wed Feb 21 21:20:22 UTC 2024 - Martin Hauke + +- Update to version 0.10 + Changes: + * add --replace + Bugfixes: + * fixed buffer overflows on %00 use + * enable more C compiler warnings and fix them + +------------------------------------------------------------------- +Tue Oct 31 17:51:46 UTC 2023 - Martin Hauke + +- Update to version 0.9 + Changes: + * add --as-idn and punycode to IDN conversion + * add --curl to only count as valid URLs supported by libcurl + Bugfixes: + * accept * as a trim name to trim a literal asterisk name + * format null as \u0000 for --json + * run --trim query before --append query +- Drop patch + * trurl-disable-broken-tests.patch (fixed by upstream) + +------------------------------------------------------------------- +Fri Sep 22 06:43:33 UTC 2023 - Martin Hauke + +- Add patch: + * trurl-disable-broken-tests.patch + +------------------------------------------------------------------- +Sat Jun 17 12:01:48 UTC 2023 - Martin Hauke + +- Update to version 0.8 + Changes: + * add --urlencode + Bugfixes: + * --json/--get: .[].parts and {component} should be urldecoded + not encoded + * tests: use empty file instead of /dev/null + * typos in manpage + * Makefile: Allow CFLAGS to be appendable + * Makefile: be explicit in C standard to use + +------------------------------------------------------------------- +Tue Jun 13 13:17:57 UTC 2023 - Andrea Manzini + +- Update to version 0.7 + * Changes: + --default-port to ask for the default to be used if not present + --keep-port to ask for the port number to be there even if default + --no-guess-scheme option to disable scheme guessing + --punycode to ask for the punycode version in output + + * Bugfixes: + --help returns 0 instead of 1 + --json: print empty arrays + --redirect: don't silently ignore failed redirections. + refuse setting same component in --set as --iterate + restructure the JSON output object + send -h output to stdout, not stderr + +------------------------------------------------------------------- +Wed Apr 26 18:24:50 UTC 2023 - Martin Hauke + +- Update to version 0.6 + * offer {puny:host} and {puny:url} for --get + * provide built-with libcurl version info for --version + * support for skipping tests + * test.py replaced test.pl + * test.py supports --with-valgrind + * tests.json: extended and updated + * URL-QUIRKS: specify if they are build-time or run-time + requirements + +------------------------------------------------------------------- +Mon Apr 17 18:08:18 UTC 2023 - Martin Hauke + +- Update to version 0.5 + Changes since previous release + * --get supports variables in [brackets] as well + * --get {query-all:key} outputs all values for 'key' in the + query + * switched to test.py for tests + * --iterate is a new option. + Bugfixes since previous release + * handle %00 sequences in {query:key} output + * support reading URL from a file without a newline + * fixed a json memory-leak + +------------------------------------------------------------------- +Mon Apr 10 14:13:12 UTC 2023 - Martin Hauke + +- Update to version 0.4 + Changes + * --get supports showing {query:key} + * --json outputs query pairs under "params" + * -a is an --append shortcut + * add --query-separator + * add --sort-query + Bugfixes + * components names are lower case and case sensitive + * fixed the json output of UTF-8 sequences + * flush stdout after handling every URL + * mixing --json with --get is an error + * more test cases + * show error messsage when component setting fails + * support "--" end-of-options argument + * support for building with older libcurl versions + +------------------------------------------------------------------- +Thu Apr 6 13:41:01 UTC 2023 - Martin Hauke + +- Update to version 0.3 + Changes + * the set port is the same as the scheme-default, don't show + * many more tests + * https://curl.se/trurl is now the project's website + * added --accept-space + * added --trim + Bugfixes + * setting port to a blank now clears it + * improved the man page + * fix --append query when no previous query exists + * output JSON as an array + * provide the -h list in pure alphabetical order + * use 0644 for the man page install + * use Test::More inside of test.pl + * nicer JSON tests and test output +- Drop patch: + * trurl-manpage-fix-spurious-executable-perm-manpage.patch +- Run testsuite + +------------------------------------------------------------------- +Mon Apr 3 20:36:08 UTC 2023 - Martin Hauke + +- Add patch + * trurl-manpage-fix-spurious-executable-perm-manpage.patch + +------------------------------------------------------------------- +Mon Apr 3 20:29:56 UTC 2023 - Martin Hauke + +- Initial package, version 0.2 diff --git a/trurl.spec b/trurl.spec new file mode 100644 index 0000000..a3ade6e --- /dev/null +++ b/trurl.spec @@ -0,0 +1,73 @@ +# +# spec file for package trurl +# +# 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: trurl +Version: 0.16.1 +Release: 0 +Summary: Command line tool for URL parsing and manipulation +License: MIT +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 + +%description +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 +%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 + +%files +%license COPYING +%doc README.md RELEASE-NOTES +%{_bindir}/trurl +%{_mandir}/man1/trurl.1%{?ext_man} + +%files zsh-completion +%dir %{_datadir}/zsh +%{_datadir}/zsh/* + +%changelog -- 2.51.1