X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail.toastin.space (mail.toastin.space [207.246.93.162]) by lists.alpinelinux.org (Postfix) with ESMTP id 1DDC45C67CC for ; Sat, 8 Dec 2018 18:23:41 +0000 (GMT) Received: from mail.toastin.space (localhost [127.0.0.1]) by mail.toastin.space (OpenSMTPD) with ESMTP id 6154e649 for ; Sat, 8 Dec 2018 13:23:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=toastin.space; h=from:to :cc:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=ml; bh=KX/4LvjLXp9fL1+VezMa2EqO0pI =; b=U+//t3CMQj6S/emUEXcVWid5GCA5Z3ugNNEZSUP8kc6TKzTrM5t/96y5xj6 p4MXA/P7CrOuvwpltvfjKwUMfZI6xsx53neVii2b982w13WDu82K7TB6mnyR5g2z HPko4DGzWGVdI8FdzXV12UskxFyvEOjxo9e9eISEV/0SjFUHli/Q9oeo3VIXI8rw bn0OQctdZluWlQPVFjAjDrQzgDf/rOKMpEElwxFHZHlOS9d+dfmaRCGQ0EtQ0k7H CHZ/CgkGdb+zddfcHxTBEBFzNdwDHNqYKlX2O0e5941k/xX2M9NfnFf3fXPQXgls 0AvDRMe8diGmYs/mVwe68cMvwuw== DomainKey-Signature: a=rsa-sha1; c=nofws; d=toastin.space; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; q=dns; s=ml; b=mw+oaf63rx59Xo7ZsQUlZ WI0ufGoScKOiTsA5w3CZ1FEXO+JMUlGhJ1iD9P3VZJz7KS+Sjbdo5CLBvDPpb+Bk 8LzshuABDAOotRqdVoE54EogBrM3YTibhKZ34KHy1PzudHTJuUHI18OMRzFmxUyl CxH2du9cUhRc0OJ87QH1wPoYhRjam/PrzDt8KkL0CbgpIIR7Gz4bYVofaSmdPivA MBabF5iYbDeQkGMojQh+472VW3YsSEzHky+TH8WWWy6Ia/1u1wiyxyYaMlp2zRt9 oolWTz2Pmied2eD1flqx1xbSfOPvxyZRl+Ok6MCFdDryI4GsnOxjBYpxTxEF7kyJ w== Received: from LapToast.home.toastin.space (192-222-169-215.qc.cable.ebox.net [192.222.169.215]) by mail.toastin.space (OpenSMTPD) with ESMTPSA id a740dfbb (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sat, 8 Dec 2018 13:23:40 -0500 (EST) From: Chloe Kudryavtsev To: alpine-devel@lists.alpinelinux.org Cc: Chloe Kudryavtsev Subject: [alpine-devel] [PATCH 2/2] Add default_cleanup_srcdir Date: Sat, 8 Dec 2018 13:22:44 -0500 Message-Id: <20181208182254.4300-3-toast@toastin.space> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181208182254.4300-1-toast@toastin.space> References: <20181208182254.4300-1-toast@toastin.space> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 } --- abuild.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/abuild.in b/abuild.in index eceb9f2..bee3ec2 100644 --- a/abuild.in +++ b/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..." -- 2.19.2 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---