mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-13 10:33:35 +00:00
Add default_cleanup_srcdir
In some cases, a simple rm -rf is not sufficent to clean srcdir. One such case is the new go module system, that marks everything as read-only - thus only letting root rm -rf it without a chmod. There is a command intended to clean them - `go clean -modcache`. However, for that to work, GOPATH must be defined and existent. Running chmod for all srcdir cleanups makes no sense, nor does enforcing root, or putting global overrides just for go. This patch allows overriding what happens on `cleanup srcdir`, by overriding cleanup_srcdir, and allows the use of default_cleanup_srcdir. In our go example, it might be used as such: cleanup_srcdir() { go clean -modcache default_cleanup_srcdir }
This commit is contained in:
parent
30d296ddb3
commit
6a6310f030
10
abuild.in
10
abuild.in
@ -76,6 +76,14 @@ want_check() {
|
||||
return 0
|
||||
}
|
||||
|
||||
default_cleanup_srcdir() {
|
||||
rm -rf "$srcdir"
|
||||
}
|
||||
|
||||
cleanup_srcdir() {
|
||||
default_cleanup_srcdir
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
local i=
|
||||
[ -z "$subpkgdir" ] && set_xterm_title ""
|
||||
@ -90,7 +98,7 @@ cleanup() {
|
||||
abuild-rmtemp "$BUILD_ROOT"
|
||||
fi;;
|
||||
pkgdir) msg "Cleaning up pkgdir"; rm -rf "$pkgbasedir";;
|
||||
srcdir) msg "Cleaning up srcdir"; rm -rf "$srcdir";;
|
||||
srcdir) msg "Cleaning up srcdir"; cleanup_srcdir;;
|
||||
deps)
|
||||
if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then
|
||||
msg "Uninstalling dependencies..."
|
||||
|
Loading…
Reference in New Issue
Block a user