Compare commits
3 Commits
bb2839e03a
...
v1.1.0
Author | SHA1 | Date | |
---|---|---|---|
e5ded67a81 | |||
241b943997 | |||
af5378c912 |
26
AUR/PKGBUILD
Normal file
26
AUR/PKGBUILD
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
pkgname=dirsha256sum
|
||||||
|
source=("${pkgname}::git+https://git.shimatta.de/mhu/dirsha256sum.git")
|
||||||
|
sha1sums=('SKIP')
|
||||||
|
pkgrel=1
|
||||||
|
arch=('i686' 'x86_64' 'arm')
|
||||||
|
pkgdesc="Script to calculate a sha256sum over an entire directory"
|
||||||
|
depends=('coreutils')
|
||||||
|
provides=('dirsha256sum')
|
||||||
|
pkgver=1.0.0.r0.g241b943
|
||||||
|
pkgver () {
|
||||||
|
cd "$pkgname"
|
||||||
|
git describe --long --always --tags | sed 's/^v//' | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare () {
|
||||||
|
:;
|
||||||
|
}
|
||||||
|
|
||||||
|
build () {
|
||||||
|
:;
|
||||||
|
}
|
||||||
|
|
||||||
|
package () {
|
||||||
|
cd "$srcdir/$pkgname"
|
||||||
|
install -D -m775 "$srcdir/$pkgname/$pkgname" "$pkgdir/usr/bin/$pkgname"
|
||||||
|
}
|
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
# This script calculates a sha256sum over all files in a dirextory including its subdirectories
|
# This script calculates a sha256sum over all files in a dirextory including its subdirectories
|
||||||
|
|
||||||
|
# Length of the sha256 hash. Adapt when changing hash algorithm
|
||||||
|
hashlen=64
|
||||||
|
|
||||||
if [[ -z $1 ]]; then
|
if [[ -z $1 ]]; then
|
||||||
echo "Usage: $0 <path to folder>"
|
echo "Usage: $0 <path to folder>"
|
||||||
exit -1
|
exit -1
|
||||||
@@ -23,7 +26,8 @@ echo "Found ${#filelist[@]} files"
|
|||||||
|
|
||||||
# Calculate shasums over all files
|
# Calculate shasums over all files
|
||||||
shasum=`for file in "${filelist[@]}"; do
|
shasum=`for file in "${filelist[@]}"; do
|
||||||
sha256sum "$file"
|
sha256sum "$file" | head -c $hashlen
|
||||||
|
echo ""
|
||||||
done | sha256sum | sed 's/\s-//'`
|
done | sha256sum | sed 's/\s-//'`
|
||||||
|
|
||||||
echo "$shasum"
|
echo "$shasum"
|
||||||
|
Reference in New Issue
Block a user