%global _empty_manifest_terminate_build 0
Name:		python-dulwich
Version:	1.2.21
Release:	1
Summary:	Python Git Library
License:	Apachev2 or GPLv2+ or GPLv2
URL:		https://www.dulwich.io/
Source0:	%{pypi_source dulwich}

%description
This is the Dulwich project.
It aims to provide an interface to git repos (both local and remote) that
doesn't call out to git directly but instead uses pure Python.

%package -n python3-dulwich
Summary:	Python Git Library
Provides:	python-dulwich = %{version}-%{release}
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:  python3-setuptools-rust
BuildRequires:	python3-cffi
BuildRequires:	gcc
%description -n python3-dulwich
This is the Dulwich project.
It aims to provide an interface to git repos (both local and remote) that
doesn't call out to git directly but instead uses pure Python.

%package help
Summary:	Development documents and examples for dulwich
Provides:	python3-dulwich-doc
%description help
This is the Dulwich project.
It aims to provide an interface to git repos (both local and remote) that
doesn't call out to git directly but instead uses pure Python.

%prep
%autosetup -n dulwich-%{version}

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-dulwich -f filelist.lst
%dir %{python3_sitearch}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue Nov 17 2026 dongjiao <dongjiao@kylinos.cn> - 1.2.21-1
- update to 1.2.21
- Fix multiple security issues and hardening updates.

* Mon Oct 26 2026 zhangjian <zhang_jian7@hoperun.com> - 1.2.19-1
- update to 1.2.19
- Make ancestor collection during upload-pack negotiation and pack generation linear rather than quadratic.
- Don't follow a symlinked leading directory in update_working_tree, which could remove a file outside the work tree.

* Thu Oct 15 2026 Hao Nan <dev01210@linx-info.com> - 1.2.17-1
- update to 1.2.17
- refresh source archive

* Tue Sep 15 2026 zhangxiaolu <zhangxiaolu@kylinos.cn> - 1.2.15-1
- update version to 1.2.15
- Detect delta cycles in Pack.resolve_object: a crafted pack with REF_DELTA objects that name each other sent get_raw into an unbounded loop. Such chains now raise DeltaCycle.
- Fix porcelain.clean when the target directory and the repository path are spelled differently, such as via a relative path or a symlink.
- Memoize tag peeling on the object store, so refs sharing an annotated tag chain no longer re-walk it once per ref. show_ref --dereference and the ref advertisement were quadratic. 

* Tue Sep 01 2026 wanggang <wanggang1@kylinos.cn> - 1.2.14-1
- Update package to version 1.2.14
- Collapse consecutive ** segments in wildmatch translation, matching git's behavior and avoiding catastrophic regex backtracking on patterns like a/**/**/**/z from untrusted repositories. (netliomax25-code)
- Make concurrent Pack.get_raw calls thread-safe by synchronizing
PackData's resolved-object offset cache.
- Speed up cached PackData.get_object_at lookups by acquiring the
offset-cache lock directly instead of through a with statement.
- Bound fetch negotiation the way C Git's MAX_IN_VAIN does: give up
after 256 unacknowledged "have" lines instead of draining the whole
graph walker into stateless (HTTP) requests. (Bojan Zivanovic, #2343)
- Add repo.sanitize_user_identity, which builds an identity from a
name and an email sanitized the way git's fmt_ident does, for
callers who cannot reject invalid input via check_user_identity.
- Make concurrent PackData reads thread-safe by mmap-ing pack contents
and indexing the mapping at explicit offsets instead of sharing the file
position. New unpack_object_at, read_pack_header_at,
read_zlib_chunks_at, take_msb_bytes_at and compute_buffer_sha
read from a buffer; the existing read-callable variants remain for streams.

* Mon Jul 20 2026 jinshuaiyu <jinshuaiyu@kylinos.cn> - 1.2.12-1
- update version to 1.2.12
- SECURITY: Refuse to write a checkout entry whose leading path resolves
through a symlink. `build_index_from_tree` (used by `reset_index` and
thus by `clone`/`checkout`) materialized a tree in sorted order without
checking leading components, so a tree pairing a symlink `link` with a
descendant `link/foo` wrote `foo` through the link to an arbitrary
absolute path. The same `verify_leading_dirs` guard already used by
porcelain and stash is now applied here.
- Fix `Bundle.store_objects()` silently dropping every OFS_DELTA/REF_DELTA
object in the bundle's pack instead of resolving it, leaving the target
object store missing most objects with no error raised. Delta resolution
now goes through `PackInflater`, matching how packs are ingested
elsewhere in the object store code.

* Tue Jul 07 2026 wanggang <wanggang1@kylinos.cn> - 1.2.10-1
- update version to 1.2.10
- Reject checkout paths whose leading component is a DOS drive-letter prefix on Windows (e.g. C:), which os.path.join would otherwise treat as absolute and let a crafted tree write outside the work tree. (reported by Luke Baton)
- Bound zlib decompression of pack entries and loose objects against decompression-bomb DoS. read_zlib_chunks now caps the inflated size at the declared decomp_len, and loose-object parsing accepts max_size defaulting to git's core.bigFileThreshold (512 MiB). (reported by Luke Bento)
- Reject OFS_DELTA pack entries whose delta_base_offset is zero. Such an entry references itself, so Pack.resolve_object would loop forever growing its delta stack until OOM. (reported by Luke Banto)
- Bound Transfer-Encoding: chunked request bodies in dulwich.web: strip chunk extensions, reject negative sizes, enforce per-chunk and per-request size limits, and cap requests that omit Content-Length.
- Bound the running length when decoding EWAH bitmaps so a corrupt or malformed .bitmap index raises ValueError instead of hanging in an unbounded loop that exhausts memory.
- Enumerate the objects to push before the HTTP git-receive-pack request body starts streaming. `generate_pack_data` previously ran lazily inside the body generator, after the header pkt-lines were already on the wire, so on large repositories the request stalled mid-body while objects were counted and servers such as GitHub aborted the push with a timeout / broken pipe.
- Replace a symlink left at the target path with a fresh regular file in build_file_from_blob instead of writing through it, matching git on checkout.
- Raise GitProtocolError carrying the server's message when the fetch/send-pack tail loop sees a fatal side-band channel (\x03), instead of crashing with `AssertionError: Invalid sideband channel 3` and swallowing the server's error text.
- Use ThreadingHTTPServer and advertise HTTP/1.1 in lfs_server so urllib3's keep-alive pool doesn't race a torn-down connection into RemoteDisconnected.

* Thu Jul 02 2026 lilu_ll <lilu@kylinos.cn> - 1.2.7-1
- Update package to version 1.2.7
- Don't expand config `include` directives when parsing `.gitmodules`, so a crafted `.gitmodules` in a cloned repository can no longer make `clone --recurse-submodules` read arbitrary files.
- Add `porcelain.request_pull` and a `dulwich request-pull` command, like `git request-pull`.
- Check out files whose names contain a colon or backslash on NTFS, instead of silently dropping them on clone, and abort the checkout on a genuinely invalid path.

* Fri Jun 12 2026 YangengLiu <dev01202@linx-info.com> - 1.2.5-1
- update version to 1.2.5
  Fix CVE-2026-47712
  Fix CVE-2026-42305
  Fix CVE-2026-42563
  Fix CVE-2026-52726
  Fix CVE-2026-47734

* Wed Apr 22 2026 YangengLiu <dev01202@linx-info.com> - 1.2.0-1
- update version to 1.2.0
  * Fix GPG signature verification to raise BadSignature for all GPG errors, not just BadSignatures; also detect when GPG returns no signatures.
  * Fix client incorrectly sending unborn argument in Git protocol v2 ls-refs requests to servers that don't advertise ls-refs=unborn, preventing clones from older servers like Gerrit 3.12.2.
  * Improve error message in read_info_refs() to show the actual line content when parsing fails.
  * Preserve quoted trailing whitespace in config values.
  * Fix .gitignore parent re-include handling so a later !dir/ re-include allows a subsequent file-level negation to take effect.
  * Fix host key verification in contrib/paramiko_vendor.py by loading known hosts and rejecting unknown SSH host keys by default.
  * Add support for push options (-o/--push-option) in push, enabling AGit flow and other server-side push option workflows.
  * Add missing push options: --all, --tags, --delete, --dry-run, --prune, --set-upstream, --follow-tags, and --mirror.
  * Add support for atomic push operations (--atomic): either all ref updates succeed or none are applied.

* Mon Mar 02 2026 zhang_jian <zhang_jian7@hoperun.com> - 1.1.0-1
- update to 1.1.0
- Add reference to c-git-compatibility doc in README.md 
- Add test-minimal to CI; run tests without installing any optional dependencies 
- Allow passing commit and author timestamps into porcelain.commit

* Fri Jan 16 2026 yyli <dev01209@linx-info.com> - 0.25.2-1
- update to 0.25.2
- Fix test failure when GPG raises `InvalidSigners` instead of `GPGMEError` on systems without usable secret keys.
- Object store `close()` methods can now be called multiple times safely.Object stores now raise `ResourceWarning` when destroyed with unclosedresources.

* Tue Dec 23 2025 chukaiping <chukaiping@baidu.com> - 0.25.0-1
- update package to  0.25.0
- Add tests to verify client args are passed
- Add column formatting support 
- Implement restore and switch commands

* Mon Nov 17 2025 zhangchaorui <zhangchaorui@kylinos.cn> - 0.24.10-1
- update package to  0.24.10

* Mon Nov 3 2025 Hann <hannannan@kylinos.cn> - 0.24.8-1
- update package to  0.24.8
  Fix config file leakage in compat tests
  Fix TypeError when passing refspec to clone()
  Add rust implementation of create_delta

* Thu Oct 09 2025 lifeifei <lifeifei@kylinos.cn> -  0.24.2-1
- update package to  0.24.2
   Fix merge functionality to gracefully handle missing optional merge3 dependency
   Fix worktree CLI tests to properly change to repository directory.
   Add filter server support. 
   
* Thu Aug 14 2025 zhang_wenyu <zhang_wenyu@hoperun.com> - 0.24.1-1
- Update package to version 0.24.1
- Require ``typing_extensions`` on Python 3.10.

* Wed Jun 11 2025 huangwenjie <huangwj@teligen.net> - 0.22.8-1
- Update package to version 0.22.8

* Tue Nov 05 2024 zhangyulong <zhangyulong@kylinos.cn> - 0.22.4-1
- Update package to version 0.22.4
  -Fix confusing "Possible areas for improvement"in docs
  -GitClient.get_refs() doesnot return peeled refs anymore(git protocol v2)
  -Publish Python 3.13 wheels

* Thu Oct 24 2024 dongqi <dongqi1@kylinos.cn> - 0.22.3-1
- Update versionto 0.22.3
- Fix typing error from mypy
- Attempt to build wheels in parallel 

* Thu Aug 15 2024 Ge Wang <wang__ge@126.com> - 0.22.1-1
- Update package to version 0.22.1

* Sun Apr 07 2024 GuoCe <guoce@kylinso.cn> - 0.21.7-1
- Update package to version 0.21.7
- Support credentials in proxy URL and fix some issues.

* Thu Oct 26 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.21.6-1
- Update package to version 0.21.6

* Sun Jun 25 2023 chendexi <chendexi@kylinos.cn> - 0.21.5-1
- Update package to version 0.21.5

* Fri Feb 24 2023 wubijie <wubijie@kylinos.cn> - 0.21.3-1
- Update package to version 0.21.3

* Thu Nov 24 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 0.20.50-1
- Update package to version 0.20.50

* Sat Sep 24 2022 guozhengxin <guozhengxin@kylinos.cn> - 0.20.46-1
- Upgrade package to version 0.20.46

* Sun Jul 24 2022 liksh <liks11@chinaunicom.com.cn> - 0.20.32-1
- Upgrade to 0.20.32 for openstack yoga

* Wed Aug 04 2021 chenyanpanHW <chenyanpan@huawei.com> - 0.20.20-2
- DESC: delete BuildRequires gdb

* Fri Jul 09 2021 openstack-sig <openstack@openeuler.org>
- Update to 0.20.20

* Fri Nov 20 2020 Python_Bot <Python_Bot@openeuler.org>
- Package Spec generated