forked from MCApollo/repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rehash.sh
executable file
·37 lines (27 loc) · 885 Bytes
/
rehash.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -e
shopt -s extglob nullglob
if (( ! $# )); then
echo "usage: ${0##*/} <package>"
exit
fi
export PKG_MAKE=$0
export PKG_NAME=${1%_}
export PKG_BASE=$(realpath "$(dirname "$0")")
source "${PKG_BASE}/lib/helper.sh"
./make.sh "${PKG_NAME}"
pkg: mkdir -p /DEBIAN
./control.sh "${PKG_NAME}" control >"$(pkg_ /DEBIAN/control)"
if [[ -e "${PKG_DATA}"/_metadata/preinst ]]; then
cp -a "${PKG_DATA}"/_metadata/preinst "$(pkg_ /DEBIAN)"
fi
if [[ -e "${PKG_DATA}"/_metadata/postinst ]]; then
cp -a "${PKG_DATA}"/_metadata/postinst "$(pkg_ /DEBIAN)"
fi
if [[ -e "${PKG_DATA}"/_metadata/prerm ]]; then
cp -a "${PKG_DATA}"/_metadata/prerm "$(pkg_ /DEBIAN)"
fi
export PKG_HASH=$(util/catdir.sh "${PKG_DEST}" | md5sum | cut -d ' ' -f 1)
echo "hashed dest ${PKG_NAME} to: ${PKG_HASH}"
echo "${PKG_HASH}" >"${PKG_STAT}/dest-md5"
pkg: rm -rf /DEBIAN