diff --git a/pmb/aportgen/core.py b/pmb/aportgen/core.py index 46bc94c9..3c69fd69 100644 --- a/pmb/aportgen/core.py +++ b/pmb/aportgen/core.py @@ -56,16 +56,16 @@ def rewrite(args, pkgname, path_original="", fields={}, replace_pkgname=None, :param path_original: The original path of the automatically generated aport. - :param fields: key-value pairs of fields, that shall be changed in the + :param fields: key-value pairs of fields that shall be changed in the APKBUILD. For example: {"pkgdesc": "my new package", "subpkgs": ""} :param replace_pkgname: When set, $pkgname gets replaced with that string in every line. :param replace_functions: Function names and new bodies, for example: {"build": "return 0"} The body can also be None (deletes the function) - :param replace_simple: Lines, that fnmatch the pattern, get + :param replace_simple: Lines that fnmatch the pattern, get replaced/deleted. Example: {"*test*": "# test", "*mv test.bin*": None} - :param below_header: String, that gets directly placed below the header. + :param below_header: String that gets directly placed below the header. :param remove_indent: Number of spaces to remove from function body provided to replace_functions. diff --git a/pmb/build/envkernel.py b/pmb/build/envkernel.py index 4740fbd7..44b2409a 100644 --- a/pmb/build/envkernel.py +++ b/pmb/build/envkernel.py @@ -19,7 +19,7 @@ def match_kbuild_out(args, word): "//include/config/kernel.release" :param word: space separated string cut out from a line from an APKBUILD - function body, that might be the kbuild output path + function body that might be the kbuild output path :returns: kernel build output directory. empty string when a separate build output directory isn't used. None, when no output directory is found. diff --git a/pmb/build/init.py b/pmb/build/init.py index 3d6abe4c..8fc17bc1 100644 --- a/pmb/build/init.py +++ b/pmb/build/init.py @@ -40,12 +40,12 @@ def init(args, suffix="native"): key = key[len(chroot):] pmb.chroot.root(args, ["cp", key, "/etc/apk/keys/"], suffix) - # Add gzip wrapper, that converts '-9' to '-1' + # Add gzip wrapper that converts '-9' to '-1' if not os.path.exists(chroot + "/usr/local/bin/gzip"): with open(chroot + "/tmp/gzip_wrapper.sh", "w") as handle: content = """ #!/bin/sh - # Simple wrapper, that converts -9 flag for gzip to -1 for + # Simple wrapper that converts -9 flag for gzip to -1 for # speed improvement with abuild. FIXME: upstream to abuild # with a flag! args="" diff --git a/pmb/chroot/apk.py b/pmb/chroot/apk.py index 3e8e15e0..757044c1 100644 --- a/pmb/chroot/apk.py +++ b/pmb/chroot/apk.py @@ -110,7 +110,7 @@ def install_is_necessary(args, build, arch, package, packages_installed): if package not in packages_installed: return True - # Make sure, that we really have a binary package + # Make sure that we really have a binary package data_repo = pmb.parse.apkindex.package(args, package, arch, False) if not data_repo: if build_disabled: @@ -157,7 +157,7 @@ def replace_aports_packages_with_path(args, packages, suffix, arch): """ apk will only re-install packages with the same pkgname, pkgver and pkgrel, when you give it the absolute path to the package. - This function replaces all packages, that were built locally, + This function replaces all packages that were built locally, with the absolute path to the package. """ ret = [] @@ -185,7 +185,7 @@ def install(args, packages, suffix="native", build=True): """ :param build: automatically build the package, when it does not exist yet or needs to be updated, and it is inside the pm-aports - folder. Checking this is expensive - if you know, that all + folder. Checking this is expensive - if you know that all packages are provides by upstream repos, set this to False! """ # Initialize chroot diff --git a/pmb/chroot/apk_static.py b/pmb/chroot/apk_static.py index 2a39e8aa..a2d21bf7 100644 --- a/pmb/chroot/apk_static.py +++ b/pmb/chroot/apk_static.py @@ -18,7 +18,7 @@ import pmb.parse.version def read_signature_info(tar): """ - Find various information about the signature, that was used to sign + Find various information about the signature that was used to sign /sbin/apk.static inside the archive (not to be confused with the normal apk archive signature!) @@ -33,7 +33,7 @@ def read_signature_info(tar): break if not sigfilename: raise RuntimeError("Could not find signature filename in apk." - " This means, that your apk file is damaged." + " This means that your apk file is damaged." " Delete it and try again." " If the problem persists, fill out a bug report.") sigkey = sigfilename[len(prefix):] @@ -114,7 +114,7 @@ def extract(args, version, apk_path): os.unlink(files["sig"]["temp_path"]) temp_path = files["apk"]["temp_path"] - # Verify the version, that the extracted binary reports + # Verify the version that the extracted binary reports logging.debug("Verify the version reported by the apk.static binary" f" (must match the package version {version})") os.chmod(temp_path, os.stat(temp_path).st_mode | stat.S_IEXEC) diff --git a/pmb/chroot/initfs_hooks.py b/pmb/chroot/initfs_hooks.py index 559698f0..25b39987 100644 --- a/pmb/chroot/initfs_hooks.py +++ b/pmb/chroot/initfs_hooks.py @@ -55,6 +55,6 @@ def delete(args, hook, suffix): def update(args, suffix): """ - Rebuild and update all hooks, that are out of date + Rebuild and update all hooks that are out of date """ pmb.chroot.apk.install(args, list_chroot(args, suffix, False), suffix) diff --git a/pmb/chroot/other.py b/pmb/chroot/other.py index 377519ba..bcf0817e 100644 --- a/pmb/chroot/other.py +++ b/pmb/chroot/other.py @@ -33,7 +33,7 @@ def kernel_flavor_installed(args, suffix, autoinstall=True): def tempfolder(args, path, suffix="native"): """ - Create a temporary folder inside the chroot, that belongs to "user". + Create a temporary folder inside the chroot that belongs to "user". The folder gets deleted, if it already exists. :param path: of the temporary folder inside the chroot diff --git a/pmb/chroot/root.py b/pmb/chroot/root.py index dae392f1..b8181280 100644 --- a/pmb/chroot/root.py +++ b/pmb/chroot/root.py @@ -19,7 +19,7 @@ def executables_absolute_path(): path = shutil.which(binary, path=pmb.config.chroot_host_path) if not path: raise RuntimeError(f"Could not find the '{binary}'" - " executable. Make sure, that it is in" + " executable. Make sure that it is in" " your current user's PATH.") ret[binary] = path return ret diff --git a/pmb/chroot/zap.py b/pmb/chroot/zap.py index a86b3413..63ddf3f5 100644 --- a/pmb/chroot/zap.py +++ b/pmb/chroot/zap.py @@ -23,7 +23,7 @@ def zap(args, confirm=True, dry=False, pkgs_local=False, http=False, :param dry: Only show what would be deleted, do not delete for real :param pkgs_local: Remove *all* self-compiled packages (!) :param http: Clear the http cache (used e.g. for the initial apk download) - :param pkgs_local_mismatch: Remove the packages, that have + :param pkgs_local_mismatch: Remove the packages that have a different version compared to what is in the aports folder. :param pkgs_online_mismatch: Clean out outdated binary packages downloaded from mirrors (e.g. from Alpine) diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 62b8c03b..9e5e8c70 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -191,7 +191,7 @@ chroot_path = ":".join([ # for the chroot executable may not be in the PATH (Debian). chroot_host_path = os.environ["PATH"] + ":/usr/sbin/" -# Folders, that get mounted inside the chroot +# Folders that get mounted inside the chroot # $WORK gets replaced with args.work # $ARCH gets replaced with the chroot architecture (eg. x86_64, armhf) # $CHANNEL gets replaced with the release channel (e.g. edge, v21.03) @@ -251,7 +251,7 @@ chroot_outdated = 3600 * 24 * 2 # packages (use "pmbootstrap aportgen musl-armhf" etc.). build_device_architectures = ["armhf", "armv7", "aarch64", "x86_64", "x86"] -# Packages, that will be installed in a chroot before it builds packages +# Packages that will be installed in a chroot before it builds packages # for the first time build_packages = ["abuild", "build-base", "ccache", "git"] @@ -504,7 +504,7 @@ apkbuild_package_attributes = { "_pmb_groups": {"array": True}, } -# Variables in APKBUILD files, that get parsed +# Variables in APKBUILD files that get parsed apkbuild_attributes = { **apkbuild_package_attributes, @@ -645,7 +645,7 @@ default_ip = "172.16.42.1" # INSTALL # -# Packages, that will be installed inside the native chroot to perform +# Packages that will be installed inside the native chroot to perform # the installation to the device. # util-linux: losetup, fallocate install_native_packages = ["cryptsetup", "util-linux", "parted"] diff --git a/pmb/helpers/args.py b/pmb/helpers/args.py index dee10fc3..5bbd7346 100644 --- a/pmb/helpers/args.py +++ b/pmb/helpers/args.py @@ -20,7 +20,7 @@ import pmb.helpers.git ... 2. Argparse merged with others - Variables from the user's config file (~/.config/pmbootstrap.cfg), that + Variables from the user's config file (~/.config/pmbootstrap.cfg) that can be overridden from the command line (pmb/parse/arguments.py) and fall back to the defaults defined in pmb/config/__init__.py (see "defaults = {..."). The user's config file gets generated interactively diff --git a/pmb/helpers/git.py b/pmb/helpers/git.py index 93e9571f..8559b432 100644 --- a/pmb/helpers/git.py +++ b/pmb/helpers/git.py @@ -234,7 +234,7 @@ def is_outdated(args, path): # Usually it does not (before first git fetch/pull), but there is no good # fallback. For exampe, getting the _creation_ date of .git/HEAD is non- # trivial with python on linux (https://stackoverflow.com/a/39501288). - # Note that we have to assume here, that the user had fetched the "origin" + # Note that we have to assume here that the user had fetched the "origin" # repository. If the user fetched another repository, FETCH_HEAD would also # get updated, even though "origin" may be outdated. For pmbootstrap status # it is good enough, because it should help the users that are not doing diff --git a/pmb/helpers/mount.py b/pmb/helpers/mount.py index 7feb03b4..eac23413 100644 --- a/pmb/helpers/mount.py +++ b/pmb/helpers/mount.py @@ -6,7 +6,7 @@ import pmb.helpers.run def ismount(folder): """ - Ismount() implementation, that works for mount --bind. + Ismount() implementation that works for mount --bind. Workaround for: https://bugs.python.org/issue29707 """ folder = os.path.realpath(os.path.realpath(folder)) @@ -45,7 +45,7 @@ def bind(args, source, destination, create_folders=True, umount=False): # Actually mount the folder pmb.helpers.run.root(args, ["mount", "--bind", source, destination]) - # Verify, that it has worked + # Verify that it has worked if not ismount(destination): raise RuntimeError("Mount failed: " + source + " -> " + destination) @@ -77,7 +77,7 @@ def umount_all_list(prefix, source="/proc/mounts"): """ Parses `/proc/mounts` for all folders beginning with a prefix. :source: can be changed for testcases - :returns: a list of folders, that need to be umounted + :returns: a list of folders that need to be umounted """ ret = [] prefix = os.path.realpath(prefix) @@ -100,7 +100,7 @@ def umount_all_list(prefix, source="/proc/mounts"): def umount_all(args, folder): """ - Umount all folders, that are mounted inside a given folder. + Umount all folders that are mounted inside a given folder. """ for mountpoint in umount_all_list(folder): pmb.helpers.run.root(args, ["umount", mountpoint]) diff --git a/pmb/helpers/pmaports.py b/pmb/helpers/pmaports.py index b468b255..362c203d 100644 --- a/pmb/helpers/pmaports.py +++ b/pmb/helpers/pmaports.py @@ -13,7 +13,7 @@ import pmb.parse def _find_apkbuilds(args): - # Try to get a cached result first (we assume, that the aports don't change + # Try to get a cached result first (we assume that the aports don't change # in one pmbootstrap call) apkbuilds = args.cache.get("pmb.helpers.pmaports.apkbuilds") if apkbuilds is not None: @@ -102,13 +102,13 @@ def guess_main(args, subpkgname): def find(args, package, must_exist=True): """ - Find the aport path, that provides a certain subpackage. + Find the aport path that provides a certain subpackage. If you want the parsed APKBUILD instead, use pmb.helpers.pmaports.get(). :param must_exist: Raise an exception, when not found :returns: the full path to the aport folder """ - # Try to get a cached result first (we assume, that the aports don't change + # Try to get a cached result first (we assume that the aports don't change # in one pmbootstrap call) ret = None if package in args.cache["find_aport"]: diff --git a/pmb/helpers/repo.py b/pmb/helpers/repo.py index 59afc24c..81b37aa6 100644 --- a/pmb/helpers/repo.py +++ b/pmb/helpers/repo.py @@ -15,7 +15,7 @@ import pmb.helpers.run def hash(url, length=8): """ - Generate the hash, that APK adds to the APKINDEX and apk packages + Generate the hash that APK adds to the APKINDEX and apk packages in its apk cache folder. It is the "12345678" part in this example: "APKINDEX.12345678.tar.gz". diff --git a/pmb/install/losetup.py b/pmb/install/losetup.py index 728477c0..5611a308 100644 --- a/pmb/install/losetup.py +++ b/pmb/install/losetup.py @@ -53,7 +53,7 @@ def mount(args, img_path): def device_by_back_file(args, back_file, auto_init=True): """ - Get the /dev/loopX device, that points to a specific image file. + Get the /dev/loopX device that points to a specific image file. """ # Get list from losetup diff --git a/pmb/parse/_apkbuild.py b/pmb/parse/_apkbuild.py index 2bf29c89..bb9a3f5a 100644 --- a/pmb/parse/_apkbuild.py +++ b/pmb/parse/_apkbuild.py @@ -291,7 +291,7 @@ def apkbuild(args, path, check_pkgver=True, check_pkgname=True): :returns: relevant variables from the APKBUILD. Arrays get returned as arrays. """ - # Try to get a cached result first (we assume, that the aports don't change + # Try to get a cached result first (we assume that the aports don't change # in one pmbootstrap call) if path in args.cache["apkbuild"]: return args.cache["apkbuild"][path] @@ -310,7 +310,7 @@ def apkbuild(args, path, check_pkgver=True, check_pkgname=True): logging.info(f"Folder: '{os.path.dirname(path)}'") logging.info(f"Pkgname: '{ret['pkgname']}'") raise RuntimeError("The pkgname must be equal to the name of" - " the folder, that contains the APKBUILD!") + " the folder that contains the APKBUILD!") # Sanity check: pkgver if check_pkgver: diff --git a/pmb/parse/apkindex.py b/pmb/parse/apkindex.py index f15d462e..da328048 100644 --- a/pmb/parse/apkindex.py +++ b/pmb/parse/apkindex.py @@ -104,7 +104,7 @@ def parse_add_block(ret, block, alias=None, multiple_providers=True): """ Add one block to the return dictionary of parse(). - :param ret: dictionary of all packages in the APKINDEX, that is + :param ret: dictionary of all packages in the APKINDEX that is getting built right now. This function will extend it. :param block: return value from parse_next_block(). :param alias: defaults to the pkgname, could be an alias from the diff --git a/pmb/parse/version.py b/pmb/parse/version.py index 053f5be0..538162f0 100644 --- a/pmb/parse/version.py +++ b/pmb/parse/version.py @@ -41,7 +41,7 @@ def next_token(previous, rest): currently looking at. We do *not* get the value of the token, or advance the rest string - beyond the whole token, that is what the get_token() function does + beyond the whole token that is what the get_token() function does (see below). :param previous: the token before @@ -95,7 +95,7 @@ def parse_suffix(rest): suffix), and return a value integer (so it can be compared later, "beta" > "alpha" etc). - :param rest: what is left of the version string, that we are + :param rest: what is left of the version string that we are currently parsing, starts with a "suffix" value (see below for valid suffixes). :returns: (rest, value, invalid_suffix) diff --git a/test/pmb_test/git.py b/test/pmb_test/git.py index 4c454f8b..64fd702e 100644 --- a/test/pmb_test/git.py +++ b/test/pmb_test/git.py @@ -12,9 +12,9 @@ def prepare_tmpdir(args, monkeypatch, tmpdir): Git repositories: * local: like local clone of pmaports.git - * remote: emulate a remote repository, that we can add to "local", so + * remote: emulate a remote repository that we can add to "local", so we can pass the tracking-remote tests in pmb.helpers.git.pull - * remote2: unexpected remote, that pmbootstrap can complain about + * remote2: unexpected remote that pmbootstrap can complain about Function overrides: * pmb.helpers.git.get_path: always return path to "local" repo diff --git a/test/test_build_is_necessary.py b/test/test_build_is_necessary.py index 4988a89c..2ed5ac92 100644 --- a/test/test_build_is_necessary.py +++ b/test/test_build_is_necessary.py @@ -68,7 +68,7 @@ def test_build_is_necessary(args): def test_build_is_necessary_no_binary_available(args): """ - APKINDEX cache is set up to fake an empty APKINDEX, which means, that the + APKINDEX cache is set up to fake an empty APKINDEX, which means that the hello-world package has not been built yet. """ indexes = list(args.cache["apkindex"].keys()) diff --git a/test/test_build_package.py b/test/test_build_package.py index f7f3a9f4..c75abc24 100644 --- a/test/test_build_package.py +++ b/test/test_build_package.py @@ -377,7 +377,7 @@ def test_build_local_source_high_level(args, tmpdir): Test building a package with overriding the source code: pmbootstrap build --src=/some/path hello-world - We use a copy of the hello-world APKBUILD here, that doesn't have the + We use a copy of the hello-world APKBUILD here that doesn't have the source files it needs to build included. And we use the original aport folder as local source folder, so pmbootstrap should take the source files from there and the build should succeed. diff --git a/test/test_parse_depends.py b/test/test_parse_depends.py index 9fd7e9fe..56104153 100644 --- a/test/test_parse_depends.py +++ b/test/test_parse_depends.py @@ -62,13 +62,13 @@ def test_package_provider(args, monkeypatch): providers = {"test-two": package_two, "test": package} assert func(args, pkgname, pkgnames_install) == package - # 3. Pick a package, that will be installed anyway + # 3. Pick a package that will be installed anyway providers = {"test_": package, "test-two": package_two} installed = {"test_": package} pkgnames_install = ["test-two"] assert func(args, pkgname, pkgnames_install) == package_two - # 4. Pick a package, that is already installed + # 4. Pick a package that is already installed pkgnames_install = [] assert func(args, pkgname, pkgnames_install) == package