public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin-apps@cygwin.com
Subject: [PATCH cygport] Add repro-finish command
Date: Mon, 11 Mar 2024 12:41:27 +0100	[thread overview]
Message-ID: <3cd62848-4d04-260a-7732-d1e143f35e31@t-online.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

Thanks for accepting the repro-check patch. A minor enhancement is attached.

The function is in pkg_pkg.cygpart instead of pkg_cleanup.cygpart 
because then it is easier to keep it in sync with the other __repro_* 
functions.

PS: I have a local script which checks SPDX Identifiers and expressions. 
Any interest to add this to cygport and then check LICENSE settings?

-- 
Regards,
Christian


[-- Attachment #2: 0001-Add-repro-finish-command.patch --]
[-- Type: text/plain, Size: 3043 bytes --]

From b08796262308cf1b3a2c063349d024a5ccfd2455 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Mon, 11 Mar 2024 12:12:32 +0100
Subject: [PATCH] Add repro-finish command

This command removes the temporary directory used by repro-check.
---
 README              |  7 ++++---
 bin/cygport.in      |  4 ++++
 lib/help.cygpart    |  1 +
 lib/pkg_pkg.cygpart | 24 +++++++++++++++++++++++-
 4 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/README b/README
index 3c9e4d4a..a0897a4f 100644
--- a/README
+++ b/README
@@ -163,9 +163,10 @@ Other COMMANDs are meant primarily for maintainers:
     diff     - write a patch file capturing changes to source in the working directory
     stage    - as upload, but don't request processing of uploaded packages
     announce - compose and send a package announcement
-    repro-build - rebuild from created source package to temp directory
-    repro-diff  - check whether packages from original and rebuild differ
-    repro-check - run repro-build and repro-diff
+    repro-build  - rebuild from created source package to temp directory
+    repro-diff   - check whether packages from original and rebuild differ
+    repro-check  - run repro-build and repro-diff
+    repro-finish - delete the temp directory used for rebuild
 
 The standard arguments --help or --version may also be passed to cygport.
 
diff --git a/bin/cygport.in b/bin/cygport.in
index df38a8b5..15bd559e 100755
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -801,6 +801,10 @@ do
 			__pkg_repro_diff
 			_status=$?
 			;;
+		repro-finish)
+			__pkg_repro_finish
+			_status=$?
+			;;
 		help)
 			__show_help;
 			exit 0;
diff --git a/lib/help.cygpart b/lib/help.cygpart
index d28fd7bb..ff03fb5f 100644
--- a/lib/help.cygpart
+++ b/lib/help.cygpart
@@ -59,6 +59,7 @@ __show_help() {
 		  repro-build   rebuild from created source package to temp directory
 		  repro-diff    check whether packages from original and rebuild differ
 		  repro-check   run repro-build and repro-diff
+		  repro-finish  delete the temp directory used for rebuild
 
 		See the included README file for further documentation.
 
diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 25b80906..07313c66 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -1048,6 +1048,28 @@ __pkg_repro_diff() {
 	inform "Rebuild produced identical packages"
 }
 
+__pkg_repro_finish() {
+	local t_spkgdir=${T}/${spkgdir##*/}
+
+	cd ${top}
+
+	__step "Removing rebuild directory in 2 seconds..."
+	inform "Rebuild dir: ${t_spkgdir}"
+	if ! [ -d ${t_spkgdir} ]
+	then
+		inform "Rebuild directory does not exist"
+		return 0
+	fi
+
+	sleep 2 || exit $?
+
+	__step "Removing rebuild directory NOW."
+	rm -rf ${t_spkgdir}
+
+	__step "Finished."
+}
+
 # protect functions
 readonly -f __pkg_binpkg __pkg_diff __gpg_sign __pkg_srcpkg __pkg_dist \
-	 __pkg_repro_build __pkg_repro_diff __squeeze_whitespace __tar
+	 __pkg_repro_build __pkg_repro_diff __pkg_repro_finish \
+	 __squeeze_whitespace __tar
-- 
2.43.0


             reply	other threads:[~2024-03-11 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 11:41 Christian Franke [this message]
2024-04-29 19:34 ` Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3cd62848-4d04-260a-7732-d1e143f35e31@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).