diff options
author | 2023-12-30 12:47:03 +0100 | |
---|---|---|
committer | 2023-12-30 12:47:08 +0100 | |
commit | 36bef437c3c22334aac5eeb6074a5aee48d00e0b (patch) | |
tree | 37387b550457d618f2e8300618f466607fa85560 | |
parent | diff-tex: add generic function to diff the ebuilds of a package (diff) | |
download | tex-36bef437c3c22334aac5eeb6074a5aee48d00e0b.tar.gz tex-36bef437c3c22334aac5eeb6074a5aee48d00e0b.tar.bz2 tex-36bef437c3c22334aac5eeb6074a5aee48d00e0b.zip |
diff-tex: use "pquery --one-attr path"
Thanks to Arthur Zamarin for pointing this out.
Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rwxr-xr-x | diff-tex | 33 |
1 files changed, 15 insertions, 18 deletions
@@ -1,27 +1,29 @@ #!/usr/bin/env bash set -eu -GENTOO_REPO_DIR=$(portageq get_repo_path / gentoo) -TEX_REPO_DIR=$(portageq get_repo_path / tex-overlay) - diff_package() { local pkg="${1}" - local cat="${pkg%%/*}" - - local max_gentoo_repo_version=$(pquery --max -r gentoo ${pkg}) - max_gentoo_repo_version="${max_gentoo_repo_version##${cat}}" - local max_tex_repo_version=$(pquery --max -r tex-overlay ${pkg}) - max_tex_repo_version="${max_tex_repo_version##${cat}}" - - local max_gentoo_repo_ebuild="${GENTOO_REPO_DIR}/${pkg}/${max_gentoo_repo_version}.ebuild" - local max_tex_repo_ebuild="${TEX_REPO_DIR}/${pkg}/${max_tex_repo_version}.ebuild" + local max_gentoo_repo_ebuild=$(pquery --max --one-attr path -r gentoo ${pkg}) + local max_tex_repo_ebuild=$(pquery --max --one-attr path -r tex-overlay ${pkg}) diff -u \ "${max_gentoo_repo_ebuild}" \ "${max_tex_repo_ebuild}" } +diff_eclass() { + local gentoo_repo_dir=$(portageq get_repo_path / gentoo) + local tex_repo_dir=$(portageq get_repo_path / tex-overlay) + + diff -u \ + "${gentoo_repo_dir}/eclass/texlive-common.eclass" \ + "${tex_repo_dir}/eclass/texlive-common.eclass" + diff -u \ + "${gentoo_repo_dir}/eclass/texlive-module.eclass" \ + "${tex_repo_dir}/eclass/texlive-module.eclass" +} + case "${1}" in biblatex) diff_package dev-tex/biblatex @@ -30,11 +32,6 @@ case "${1}" in diff_package app-text/texlive-core ;; eclass) - diff -u \ - "${GENTOO_REPO_DIR}/eclass/texlive-common.eclass" \ - "${TEX_REPO_DIR}/eclass/texlive-common.eclass" - diff -u \ - "${GENTOO_REPO_DIR}/eclass/texlive-module.eclass" \ - "${TEX_REPO_DIR}/eclass/texlive-module.eclass" + diff_eclass ;; esac |