From a075519bd0e6d59663228e8e839aa22443dbe317 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Fri, 14 Mar 2025 13:38:08 -0600 Subject: [PATCH 1/7] Fix release script The release script had a few bashisms, as well as a non-portable usage of the fold command. Additional, do not have the script make the tag or force changes to be on the main branch, since we would prefer to draft a GitHub release to make releases instead of force pushing tags --- make_a_release.sh | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/make_a_release.sh b/make_a_release.sh index 1a81d8f..b1240a0 100755 --- a/make_a_release.sh +++ b/make_a_release.sh @@ -43,10 +43,10 @@ ask_question() { while true; do printf "%s\n" "$question (yes/no)?" IFS= read answer - if [ "$answer" == "yes" ]; then + if [ "$answer" = "yes" ]; then printf "%s\n" "Very good!" return - elif [ "$answer" == "no" ]; then + elif [ "$answer" = "no" ]; then printf "%s\n" "Please, do that!" exit 1 else @@ -63,7 +63,7 @@ format_changelog() { local width="$((80-$pfx_len))" while IFS= read -r line; do - printf "%s\n" "$line" | fold -c -s -w "$width" | \ + printf "%s\n" "$line" | fold -s -w "$width" | \ sed -e "1 s/^/$pfx1/" | sed -e "1! s/^/$pfx2/" | \ sed -e "s/[\t ]\+$//" done < "$logfile" @@ -78,12 +78,6 @@ new_ver="$1"; shift printf "%s" "$new_ver" | egrep -q -x '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' || fatal "please, provide new version in X.Y.Z format" -# Make sure that the current branch is 'main' -current_branch="$(git branch | sed -n -e '/^*/ s/^* //p')" -if [ "$current_branch" != "main" ]; then - fatal "current branch is '$current_branch' but must be 'main'" -fi - # Make sure the git index is up-to-date [ -z "$(git status --porcelain)" ] || fatal "git index is not up-to-date" @@ -92,7 +86,7 @@ ask_question "Did you update the man page" ask_question "Did you update tests: test-data and oldcodebase" # Change the version in the 'bmaptool/CLI.py' file -sed -i -e "s/^VERSION = \"[0-9]\+\.[0-9]\+\.[0-9]\+\"$/VERSION = \"$new_ver\"/" bmaptool/CLI.py +sed -i -e "s/^VERSION = \"[0-9]\+\.[0-9]\+\.[0-9]\+\"$/VERSION = \"$new_ver\"/" src/bmaptool/CLI.py # Sed the version in the RPM spec file sed -i -e "s/^Version: [0-9]\+\.[0-9]\+\.[0-9]\+$/Version: $new_ver/" packaging/bmaptool.spec # Remove the "rc_num" macro from the RPM spec file to make sure we do not have @@ -145,27 +139,11 @@ outdir="." tag_name="v$new_ver" release_name="bmaptool-$new_ver" -# Create new tag -printf "%s\n" "Creating tag $tag_name" -git tag -m "$release_name" "$tag_name" - # Get the name of the release branch corresponding to this version release_branch="release-$(printf "%s" "$new_ver" | sed -e 's/\(.*\)\..*/\1.0/')" cat < Date: Fri, 14 Mar 2025 13:46:05 -0600 Subject: [PATCH 2/7] Release version 3.9.0 Signed-off-by: Joshua Watt --- debian/changelog | 9 +++++++++ docs/man1/bmaptool.1 | 2 +- packaging/bmaptool.changes | 6 ++++++ packaging/bmaptool.spec | 2 +- src/bmaptool/CLI.py | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index b2286ec..0e9029e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +bmaptool (3.9.0) unstable; urgency=low + + * copy: add `--removable-device`, `--keyring` and `--fingerprint` options + * Respect query part of the url when operating on the path + * support FTP authentication + * rework GPG tests + + -- Trevor Woerner Fri, 14 Mar 2025 13:46:05 -0600 + bmaptool (3.8.0) unstable; urgency=low * use 'df -P' for POSIX portable output diff --git a/docs/man1/bmaptool.1 b/docs/man1/bmaptool.1 index 05faf6c..ffa41b1 100644 --- a/docs/man1/bmaptool.1 +++ b/docs/man1/bmaptool.1 @@ -1,4 +1,4 @@ -.TH BMAPTOOL "1" "March 2024" "bmaptool 3.8.0" "User Commands" +.TH BMAPTOOL "1" "March 2025" "bmaptool 3.9.0" "User Commands" .SH NAME diff --git a/packaging/bmaptool.changes b/packaging/bmaptool.changes index 19e34e7..1c4e1b9 100644 --- a/packaging/bmaptool.changes +++ b/packaging/bmaptool.changes @@ -1,3 +1,9 @@ +Fri Mar 14 07:46:05 PM UTC 2025 - Trevor Woerner 3.9.0-1 +- copy: add `--removable-device`, `--keyring` and `--fingerprint` options +- Respect query part of the url when operating on the path +- support FTP authentication +- rework GPG tests + Tue Mar 19 03:44:10 UTC 2024 - Trevor Woerner 3.8.0-1 - use 'df -P' for POSIX portable output - bmaptool has new maintainers diff --git a/packaging/bmaptool.spec b/packaging/bmaptool.spec index 75d817b..110726b 100644 --- a/packaging/bmaptool.spec +++ b/packaging/bmaptool.spec @@ -4,7 +4,7 @@ Name: bmaptool Summary: Tools to generate block map (AKA bmap) and flash images using bmap -Version: 3.8.0 +Version: 3.9.0 %if 0%{?opensuse_bs} Release: %{rc_str}.. %else diff --git a/src/bmaptool/CLI.py b/src/bmaptool/CLI.py index ae53b77..40acf31 100644 --- a/src/bmaptool/CLI.py +++ b/src/bmaptool/CLI.py @@ -45,7 +45,7 @@ from typing import NamedTuple from . import BmapCreate, BmapCopy, BmapHelpers, TransRead -VERSION = "3.8.0" +VERSION = "3.9.0" log = logging.getLogger() # pylint: disable=C0103 From bf610e8d61a66076089e2602ec5af2f8827b44f6 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Wed, 19 Feb 2025 00:13:27 +0100 Subject: [PATCH 3/7] CHANGELOG.md: changes for 3.8.0 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e04986..e39dfba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed +## [3.8.0] + +- Move project to yoctoproject +- Maintainers change from Artem Bityutskiy (Thank you!) to Trevor Woerner, Joshua Watt, Tim Orling +- Consolidate name as 'bmaptool' + ## [3.7.0] ### Added - Use GitHub Actions for CI (#109) From d6cf9915cc5b38024f84ef7f9cf5ac66f42922a2 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Fri, 14 Mar 2025 19:37:23 +0100 Subject: [PATCH 4/7] modernize Debian packaging - replace docs/RELEASE_NOTES by CHANGELOG.md and README.md - install docs/man1/bmaptool.1 - use debhelper-compat B-D instead of debian/compat - bump dh compat to 13 - add new build dependencies - bump Standards-Version to 4.7.0 - add Homepage field to d/control - use dependencies from packaging in Debian - use https URI in d/copyright - replace --with=python3 with --buildsystem=pybuild - use pybuild-plugin-pyproject - select 3.0 (native) source format --- debian/bmaptool.docs | 3 ++- debian/bmaptool.manpages | 1 + debian/compat | 1 - debian/control | 44 +++++++++++++++++++++++----------------- debian/copyright | 2 +- debian/rules | 2 +- debian/source/format | 1 + 7 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 debian/bmaptool.manpages delete mode 100644 debian/compat create mode 100644 debian/source/format diff --git a/debian/bmaptool.docs b/debian/bmaptool.docs index d608dd0..192ea8b 100644 --- a/debian/bmaptool.docs +++ b/debian/bmaptool.docs @@ -1 +1,2 @@ -docs/RELEASE_NOTES +CHANGELOG.md +README.md diff --git a/debian/bmaptool.manpages b/debian/bmaptool.manpages new file mode 100644 index 0000000..8a9b6db --- /dev/null +++ b/debian/bmaptool.manpages @@ -0,0 +1 @@ +docs/man1/bmaptool.1 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control index 4ab5fcd..d89c51b 100644 --- a/debian/control +++ b/debian/control @@ -2,28 +2,34 @@ Source: bmaptool Maintainer: Trevor Woerner Section: utils Priority: optional -Build-Depends: debhelper (>= 9), - python3 (>= 3.8), - python3-setuptools, -Standards-Version: 3.8.4 -XS-Python-Version: >= 3.8 +Build-Depends: + debhelper-compat (= 13), + dh-sequence-python3, + pybuild-plugin-pyproject, + python3 (>= 3.8), + python3-gpg, + python3-hatchling, + python3-pytest, +Standards-Version: 4.7.0 +Homepage: https://github.com/yoctoproject/bmaptool Package: bmaptool Architecture: all -Depends: python (>=3.8), - python-gpgme, - ${misc:Depends}, - ${python:Depends}, - bzip2, - pbzip2, - gzip, - pigz, - lzop, - liblz4-tool, - xz-utils, - tar, - unzip, - zstd +Depends: + python3, + python3-six, + ${misc:Depends}, + ${python3:Depends}, +Recommends: + bzip2, + lzop, + xz-utils, +Suggests: + lz4, + pbzip2, + pigz, + python3-gpg, + unzip, Description: Tools to generate block map (AKA bmap) and flash images using bmap. bmaptool is a generic tool for creating the block map (bmap) for a file, and copying files using the block map. The idea is that large file containing diff --git a/debian/copyright b/debian/copyright index 8d0fe60..de39cb1 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-name: bmaptool Upstream-Contact: Trevor Woerner Source: https://github.com/yoctoproject/bmaptool diff --git a/debian/rules b/debian/rules index 016f8b3..11cd9df 100755 --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,4 @@ #!/usr/bin/make -f %: - dh $@ --with=python3 + dh $@ --buildsystem=pybuild diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) From 86135f38a6d6d9ea7dab6b45a7edf2f63b4c4cdd Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Fri, 14 Mar 2025 12:48:20 -0600 Subject: [PATCH 5/7] Reformat with black Reformats with the latest version of black that changes a few things Signed-off-by: Joshua Watt --- tests/oldcodebase/BmapCopy1_0.py | 4 ++-- tests/oldcodebase/BmapCopy2_0.py | 4 ++-- tests/oldcodebase/BmapCopy2_1.py | 4 ++-- tests/oldcodebase/BmapCopy2_2.py | 4 ++-- tests/oldcodebase/BmapCopy2_3.py | 4 ++-- tests/oldcodebase/BmapCopy2_4.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/oldcodebase/BmapCopy1_0.py b/tests/oldcodebase/BmapCopy1_0.py index 0697011..d381128 100644 --- a/tests/oldcodebase/BmapCopy1_0.py +++ b/tests/oldcodebase/BmapCopy1_0.py @@ -1,6 +1,6 @@ # pylint: disable-all -""" This module implements copying of images with bmap and provides the +"""This module implements copying of images with bmap and provides the following API. 1. BmapCopy class - implements copying to any kind of file, be that a block device or a regular file. @@ -30,7 +30,7 @@ stick (namely, you copy only mapped blocks). This is a lot faster than copying all 4GiB of data. We say that it is a bit more than 100MiB because things like file-system meta-data (inode tables, superblocks, etc), partition table, etc -also contribute to the mapped blocks and are also copied. """ +also contribute to the mapped blocks and are also copied.""" # Disable the following pylint recommendations: # * Too many instance attributes (R0902) diff --git a/tests/oldcodebase/BmapCopy2_0.py b/tests/oldcodebase/BmapCopy2_0.py index b25300d..bfd085e 100644 --- a/tests/oldcodebase/BmapCopy2_0.py +++ b/tests/oldcodebase/BmapCopy2_0.py @@ -1,6 +1,6 @@ # pylint: disable-all -""" This module implements copying of images with bmap and provides the +"""This module implements copying of images with bmap and provides the following API. 1. BmapCopy class - implements copying to any kind of file, be that a block device or a regular file. @@ -30,7 +30,7 @@ stick (namely, you copy only mapped blocks). This is a lot faster than copying all 4GiB of data. We say that it is a bit more than 100MiB because things like file-system meta-data (inode tables, superblocks, etc), partition table, etc -also contribute to the mapped blocks and are also copied. """ +also contribute to the mapped blocks and are also copied.""" # Disable the following pylint recommendations: # * Too many instance attributes (R0902) diff --git a/tests/oldcodebase/BmapCopy2_1.py b/tests/oldcodebase/BmapCopy2_1.py index 98f00b0..77c6a2e 100644 --- a/tests/oldcodebase/BmapCopy2_1.py +++ b/tests/oldcodebase/BmapCopy2_1.py @@ -1,6 +1,6 @@ # pylint: disable-all -""" This module implements copying of images with bmap and provides the +"""This module implements copying of images with bmap and provides the following API. 1. BmapCopy class - implements copying to any kind of file, be that a block device or a regular file. @@ -30,7 +30,7 @@ stick (namely, you copy only mapped blocks). This is a lot faster than copying all 4GiB of data. We say that it is a bit more than 100MiB because things like file-system meta-data (inode tables, superblocks, etc), partition table, etc -also contribute to the mapped blocks and are also copied. """ +also contribute to the mapped blocks and are also copied.""" # Disable the following pylint recommendations: # * Too many instance attributes (R0902) diff --git a/tests/oldcodebase/BmapCopy2_2.py b/tests/oldcodebase/BmapCopy2_2.py index f206033..89235f2 100644 --- a/tests/oldcodebase/BmapCopy2_2.py +++ b/tests/oldcodebase/BmapCopy2_2.py @@ -1,6 +1,6 @@ # pylint: disable-all -""" This module implements copying of images with bmap and provides the +"""This module implements copying of images with bmap and provides the following API. 1. BmapCopy class - implements copying to any kind of file, be that a block device or a regular file. @@ -30,7 +30,7 @@ stick (namely, you copy only mapped blocks). This is a lot faster than copying all 4GiB of data. We say that it is a bit more than 100MiB because things like file-system meta-data (inode tables, superblocks, etc), partition table, etc -also contribute to the mapped blocks and are also copied. """ +also contribute to the mapped blocks and are also copied.""" # Disable the following pylint recommendations: # * Too many instance attributes (R0902) diff --git a/tests/oldcodebase/BmapCopy2_3.py b/tests/oldcodebase/BmapCopy2_3.py index f435ea1..21097e2 100644 --- a/tests/oldcodebase/BmapCopy2_3.py +++ b/tests/oldcodebase/BmapCopy2_3.py @@ -1,6 +1,6 @@ # pylint: disable-all -""" This module implements copying of images with bmap and provides the +"""This module implements copying of images with bmap and provides the following API. 1. BmapCopy class - implements copying to any kind of file, be that a block device or a regular file. @@ -30,7 +30,7 @@ stick (namely, you copy only mapped blocks). This is a lot faster than copying all 4GiB of data. We say that it is a bit more than 100MiB because things like file-system meta-data (inode tables, superblocks, etc), partition table, etc -also contribute to the mapped blocks and are also copied. """ +also contribute to the mapped blocks and are also copied.""" # Disable the following pylint recommendations: # * Too many instance attributes (R0902) diff --git a/tests/oldcodebase/BmapCopy2_4.py b/tests/oldcodebase/BmapCopy2_4.py index f435ea1..21097e2 100644 --- a/tests/oldcodebase/BmapCopy2_4.py +++ b/tests/oldcodebase/BmapCopy2_4.py @@ -1,6 +1,6 @@ # pylint: disable-all -""" This module implements copying of images with bmap and provides the +"""This module implements copying of images with bmap and provides the following API. 1. BmapCopy class - implements copying to any kind of file, be that a block device or a regular file. @@ -30,7 +30,7 @@ stick (namely, you copy only mapped blocks). This is a lot faster than copying all 4GiB of data. We say that it is a bit more than 100MiB because things like file-system meta-data (inode tables, superblocks, etc), partition table, etc -also contribute to the mapped blocks and are also copied. """ +also contribute to the mapped blocks and are also copied.""" # Disable the following pylint recommendations: # * Too many instance attributes (R0902) From 6d81c180d31763295501eaa0f40d126b755134ff Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Fri, 14 Mar 2025 20:43:56 +0100 Subject: [PATCH 6/7] make_a_release.sh: fix usage message (there is no second argument) --- make_a_release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make_a_release.sh b/make_a_release.sh index b1240a0..965c9c1 100755 --- a/make_a_release.sh +++ b/make_a_release.sh @@ -30,7 +30,7 @@ fatal() { usage() { cat < +Usage: ${0##*/} - new bmaptool version to make in X.Y.Z format EOF From d0749aceb019e4e3c1976ab625be4db6f5d7ffba Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Wed, 19 Feb 2025 00:22:32 +0100 Subject: [PATCH 7/7] CHANGELOG.md: add entry for 3.9.0 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e39dfba..2271991 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed +## [3.9.0] + +- copy: add `--removable-device`, `--keyring` and `--fingerprint` options +- Respect query part of the url when operating on the path +- support FTP authentication +- rework GPG tests + ## [3.8.0] - Move project to yoctoproject