cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit d966e9be991f9547c49ba2810b7abe1ba46e677f
parent 128275c5e533a5cd6419ea3ba5dd8401a5ede997
Author: Cem Keylan <cem@ckyln.com>
Date:   Sun, 19 Apr 2020 13:56:41 +0300

kiss: fix checksum mistake when checksums file doesn't exist.

If the checksums file doesn't exist on the package directory, kiss
used as_root regardless of permissions. This checks whether the directory
is writable instead of the checksums file, which should provide proper
permissions.

This patch ignores if the directory has weird permissions. If the
directory is writable but the checksums file isn't, kiss will exit
with error. This ignorance is intentional as ideally a package dir
should have identical permissions.

Diffstat:
Mkiss | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kiss b/kiss @@ -1299,14 +1299,14 @@ args() { for pkg do pkg_sources "$pkg" c; done for pkg do pkg_checksums "$pkg" | { - repo_dir=$(pkg_find "$pkg")/checksums + repo_dir=$(pkg_find "$pkg") if [ -w "$repo_dir" ]; then - tee "$repo_dir" + tee "$repo_dir/checksums" else log "$pkg" "Need permissions to generate checksums" - user=$(stat -c %U "$repo_dir") as_root tee "$repo_dir" + user=$(stat -c %U "$repo_dir") as_root tee "$repo_dir/checksums" fi }