aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-04-19 10:56:41 +0000
committermerakor <cem@ckyln.com>2020-04-19 10:56:41 +0000
commit7af77a3d8fd17b5f602120a05b158f4678f81930 (patch)
treed9ff03f100c4367312b4c92c0c5008567db48037
parenta9381e53a133f2608fb9b7d6399ce2f21e5f3af0 (diff)
downloadcpt-7af77a3d8fd17b5f602120a05b158f4678f81930.tar.gz
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. FossilOrigin-Name: cebd065d1324d997841770fc85db1229cea256f25549f63caa91dc4348811b48
-rwxr-xr-xkiss6
1 files changed, 3 insertions, 3 deletions
diff --git a/kiss b/kiss
index cf56c1a..f4e3ec1 100755
--- 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
}