aboutsummaryrefslogtreecommitdiff
path: root/sum
blob: 9469302e85f1568dab86034c53ae8b13b1dd6646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# checksum -- create checksum for local patch

#
# Note that checksums are optional for local patches.
#

[ -z "$1" ] && { echo usage: $0 patch 1>&2; exit 1; }

localpath=`readlink -f "$1"`
globalpath=/usr/pkgsrc/${localpath#/home/john/patches/}

[ -e "$globalpath" ] && { echo error: "$globalpath" exists 1>&2; exit 1; }
doas cp "$localpath" "$globalpath"
cd "$(dirname "$globalpath")"
doas make makepatchsum
doas rm "$globalpath"