public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [rebase - The rebase tool, core of the automatic rebase facility during postinstall] branch master, updated. e44e8319b9d21296062013e3bd6fa3fc887b3778
@ 2022-07-21 13:29 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2022-07-21 13:29 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/rebase.git;h=e44e8319b9d21296062013e3bd6fa3fc887b3778

commit e44e8319b9d21296062013e3bd6fa3fc887b3778
Author: Ken Brown <kbrown@cornell.edu>
Date:   Wed Jul 20 12:14:42 2022 -0400

    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.


Diff:
---
 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..372de2d 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(0xDF0000) != 0xE00000
 
-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://sourceware.org/cygwin-apps/
 
 
 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:anoncvs@cygwin.com:/cvs/cygwin-apps co rebase
+    git clone https://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], [cygwin@cygwin.com])
+AC_INIT([rebase], [4.6.1], [cygwin@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..c4d5f76 100644
--- a/rebaseall.in
+++ b/rebaseall.in
@@ -51,6 +51,32 @@ cleanup()
     exit ${ExitCode}
 }
 
+# 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
+
 # Set traps
 trap cleanup 1 2 15
 
@@ -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:00000000
-case $Platform in
-  cygwin )
-    [ `uname -m` = "x86_64" ] && DefaultBaseAddress=0x400000000
-    ;;
-  * )
-    ;;
-esac
-  
 # Parse command line arguments
 while getopts "${ProgramOptions}" Option "$@"
 do
@@ -132,9 +137,7 @@ done
 if [ "${check_for_dash_only}" != "no" ]
 then
   ProcessResult=0
-  case $Platform in
-    mingw|msys )
-      /bin/ps -s | /bin/gawk '\
+  /bin/ps -s | /bin/gawk '\
 	# Count number of running ash or dash. \
 	/\/bin\/(d)?ash(\.exe)?$/{ ash_cnt++; } \
 	# Count number of ps and gawk. \
@@ -153,13 +156,7 @@ then
 	  # All is well. \
 	  exit 1; \
 	}'
-      ProcessResult=$?
-      ;;
-    cygwin )
-      grep -E -q -i -v '/d?ash(.exe)?$' /proc/[0-9]*/exename
-      ProcessResult=$?
-      ;;
-  esac
+  ProcessResult=$?
   if [ $ProcessResult -eq 0 -a -z "${RebaseDebug}" ]
   then
       echo "${ProgramName}: only ash or dash processes are allowed during rebasing"
@@ -208,39 +205,14 @@ SortedFile="$TmpDir/rebase.lst"
 TmpFile="${SortedFile}.in"
 
 # Create rebase list
-case $Platform in
-  cygwin)
-    find /etc/setup -name '*.lst.gz' | xargs gzip -d -c |
-      grep -E "\.($Suffixes)\$" |
-      sed -e '/\/cygwin1\.dll$/d' -e '/\/cyglsa.*\.dll$/d' \
-          -e '/sys-root\/mingw/d' -e 's/^/\//' \
-          -e '/\/d\?ash\.exe$/d' -e '/\/rebase\.exe$/d' >"${TmpFile}"
-    # some interpreters include a method for installing addons outside of the
-    # package manager, such as CPAN and RubyGems.
-    for d in /usr/lib/perl5/site_perl /usr/lib/py*/site-packages \
-             /usr/lib/php /usr/lib/R/site-library /usr/lib/rub*/gems \
-             /usr/lib/octave/site
-    do
-      if [ -d $d ]
-      then
-        find $d -type f | grep -E "\.($Suffixes)\$" >>"${TmpFile}"
-      fi
-    done
-    # Unconditionally add the -n flag so rebased DLLs get the
-    # dynamicbase flag removed.
-    NoDyn='-n'
-    ;;
-  mingw|msys)
-    for f in /bin /lib
-    do
-      find $f -type f |
-        grep -E "\.($Suffixes)\$" |
-	sed -e '/\/msys-1\.0.*\.dll$/d' -e '/\/cygwin1\.dll$/d' \
-	    -e '/\/cyglsa.*\.dll$/d' -e '/\/d\?ash\.exe$/d' \
-	    -e '/\/rebase\.exe$/d' >>"$TmpFile"
-    done
-    ;;
-esac
+for f in /bin /lib
+do
+  find $f -type f |
+    grep -E "\.($Suffixes)\$" |
+    sed -e '/\/msys-1\.0.*\.dll$/d' -e '/\/cygwin1\.dll$/d' \
+	-e '/\/cyglsa.*\.dll$/d' -e '/\/d\?ash\.exe$/d' \
+	-e '/\/rebase\.exe$/d' >>"$TmpFile"
+done
 
 # Append user supplied file list, if any
 if [ -n "${FileList}" ]



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-21 13:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 13:29 [rebase - The rebase tool, core of the automatic rebase facility during postinstall] branch master, updated. e44e8319b9d21296062013e3bd6fa3fc887b3778 Ken Brown

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).