Patch attached.From bcbc7f9768854a6e6aaf1a450cdaabc61241ea9d Mon Sep 17 00:00:00 2001
From: Ken Brown
Date: Wed, 20 Jul 2022 12:14:42 -0400
Subject: [PATCH] Make rebaseall a wrapper around the autorebase postinstall
script
Do this on Cygwin only; the behavior on MinGW and MSYS is unchanged.
Bump version to 4.6.1.
---
NEWS | 5 +++
README | 30
configure.ac | 2 +-
rebaseall.in | 100 +++
4 files changed, 56 insertions(+), 81 deletions(-)
diff --git a/NEWS b/NEWS
index f982c32..c824d5b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
$Id$
+4.6.1
+==
+* Make rebaseall a wrapper around /etc/postinstall/0p_000_autorebase.dash
+ (Cygwin only).
+
4.3.0
==
* Add --oblivious/-O option: do not touch files already in the
diff --git a/README b/README
index 6383fcf..9456b5e 100644
--- a/README
+++ b/README
@@ -53,9 +53,13 @@ the following will be displayed when the problem is
triggered:
C:\cygwin\bin\python.exe: *** unable to remap C:\cygwin\bin\cygssl.dll to
same address as parent(0xDF) != 0xE0
-Note that rebaseall is only a stop-gap measure. Eventually the rebase
-functionality will be added to Cygwin's setup.exe, so that rebasing will
-happen automatically.
+On Cygwin, rebaseall has been replaced by the postinstall script
+/etc/postinstall/0p_000_autorebase.dash, provided by the _autorebase
+package. This script runs every time Cygwin's setup program is run.
+See /usr/share/doc/Cygwin/_autorebase.README.
+
+For the convenience of users who may wish to rebase between runs of
+setup, rebaseall is now a wrapper around that postinstall script.
On Vista and newer, it is possible to employ the Address Space Layout
Randomization facility to help solve the image load address clashing
@@ -163,7 +167,7 @@ the next section.
Command line syntax
-rebaseall
+rebaseall (MinGW and MSYS only)
The following is the rebaseall command line syntax:
@@ -358,31 +362,25 @@ Issues:
The following are the known Cygwin rebase issues:
-1. rebase should be integrated with Cygwin's setup.exe.
-
-2. rebase does not handle in-use DLLs.
+1. rebase does not handle in-use DLLs.
-3. rebase skips read-only DLLs.
+2. rebase skips read-only DLLs.
-Issues #1, #2, and #3 also apply to the peflags utility.
+These issues also apply to the peflags utility.
Homepage:
The primary rebase web site is:
-http://www.tishler.net/jason/software/rebase/
+https://cygwin.com/git/?p=cygwin-apps/rebase.git
Download:
-The primary rebase download site is:
-
-http://www.tishler.net/jason/software/rebase/
-
-Access to the CVS development sources is available:
+Access to the git development sources is available:
-cvs -d:pserver:anon...@cygwin.com:/cvs/cygwin-apps co rebase
+git clone git://cygwin.com/git/cygwin-apps/rebase.git
Mailing Lists:
diff --git a/configure.ac b/configure.ac
index 91415d5..f66c2a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# configure.ac for rebase
AC_PREREQ([2.64])
-AC_INIT([rebase], [4.6.0], [cyg...@cygwin.com])
+AC_INIT([rebase], [4.6.1], [cyg...@cygwin.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([peflags.c])
AC_PREFIX_DEFAULT([/usr])
diff --git a/rebaseall.in b/rebaseall.in
index af4fe3f..b624939 100644
--- a/rebaseall.in
+++ b/rebaseall.in
@@ -38,6 +38,32 @@ DefaultVerbose=
DefaultFileList=
DefaultSuffixes='dll|so|oct'
+# Determine platform
+Platform=`uname -s`
+case $Platform in
+ *MINGW* | *mingw* ) Platform=mingw ;;
+ *CYGWIN* | *cygwin* ) Platform=cygwin ;;
+ *MSYS* | *msys* ) Platform=msys ;;
+ * )
+echo "Unsupported platform: $Platform" 1>&2
+exit 1
+;;
+esac
+
+# On Cygwin, just call the _autorebase postinstall script
+case $Platform in
+ cygwin)
+if [ "$#" -gt 0 ]
+then
+ echo "usage: ${ProgramName}"
+ exit 1
+fi
+exec /etc/postinstall/0p_000_autorebase.dash
+;;
+ *)
+;;
+esac
+
# Define functions
usage()
{
@@ -76,27 +102,6 @@ case `uname -m` in
;;
esac
-# Determine platform
-Platform=`uname -s`
-case $Platform in
- *MINGW* | *mingw* ) Platform=mingw ;;
- *CYGWIN* | *cygwin* ) Platform=cygwin ;;
- *MSYS* | *msys* ) Platform=msys ;;
- * )
-echo "Unsupported platform: $Platform" 1>&2
-exit 1
-;;
-esac
-
-# On x86_64 Cygwin, set DefaultAddressBase to 0x4:
-case $Platform