Skip to content

Commit

Permalink
Add repro-finish command
Browse files Browse the repository at this point in the history
This command removes the temporary directory used by repro-check.
  • Loading branch information
chrfranke authored and jon-turney committed Apr 29, 2024
1 parent 7eb4cfc commit 8728a79
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions bin/cygport.in
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,10 @@ do
__pkg_repro_diff
_status=$?
;;
repro-finish)
__pkg_repro_finish
_status=$?
;;
help)
__show_help;
exit 0;
Expand Down
1 change: 1 addition & 0 deletions lib/help.cygpart
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
24 changes: 23 additions & 1 deletion lib/pkg_pkg.cygpart
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8728a79

Please sign in to comment.