Rebase Status

2002-01-24 Thread Jason Tishler

Since I'm around half way done, I decided to post a status report to let
people know that I'm still working on this...

I have implemented the following:

main ()
{
  for dll in dlls
rebase (dll)
}
  
rebase (dll)
{
  sz = image_size (dll)
  find slot of size sz in free_list and remove slot from free_list
  add slot to used_list
  rebase_image (dll)
}

The free and used lists are persisted in a file called rebase.conf which will
be ultimately stored in /etc/setup.  Attached is a sample.

I will be implementing the un-rebase and re-rebase functionality next:

unrebase (dll)
{
  find dll in used_list and remove from used_list
  add slot to free_list
}

rerebase (dll)
{
  find dll in used_list
  if (old image size == new image size)
rebase_image (dll)
  else
unrebase (dll)
rebase (dll)
}

Note that I have skipped executables (even though suggested by Rob),
because AFAICT that are *not* rebase-able.  I have also skipped DLL
dependency checking too.  You have to crawl, before you can walk, before
you can run...

I have decided to develop using a stand-alone Mingw (i.e., -mno-cygwin) app
instead of integrating directly into setup.exe for the following reasons:

o speed development
o prevent whacking my Cygwin installation
? possibly this stand-alone rebase could be used as a one-shot to
  rebase existing Cygwin installations
? possibly this stand-alone rebase should be the "real" rebase tool that
  is part of the standard Cygwin distribution (as opposed to my previous
  versions)
? possibly setup.exe should call rebase.exe to minimize impact on size
  (although the current stripped size is ~31K)

Any comments on the items above marked by "?" would be appreciated.

BTW, the attached (untried) "patch" demonstrates how one could integrate
this new rebase functionality into setup.exe.

I can post the source if anyone is interested in checking it out.
Otherwise, I will post it when full functionality is achieved.

Thanks,
Jason


[Free List]
0x7800  0x7fee
0x5f00  0x7000
0x0040  0x5000

[Used List]
C:\home\jtishler\src\setup-rebase\cygcrypto.dll 0x7ff5  0x000b
C:\home\jtishler\src\setup-rebase\cygssl.dll0x7ff1  0x0004
C:\home\jtishler\src\setup-rebase\cygz.dll  0x7fee  0x0003



Index: install.cc
===
RCS file: /cvs/src/src/winsup/cinstall/install.cc,v
retrieving revision 2.37
diff -u -p -r2.37 install.cc
--- install.cc  2002/01/22 11:35:10 2.37
+++ install.cc  2002/01/24 17:32:12
@@ -291,6 +291,7 @@ install_one_source (packagemeta & pkgm, 
}
}
}
+ rebaser::get_instance ()->rebase (concat (prefixPath, fn));
 
  progress (tmp->tell ());
  num_installs++;
Index: package_meta.cc
===
RCS file: /cvs/src/src/winsup/cinstall/package_meta.cc,v
retrieving revision 2.15
diff -u -p -r2.15 package_meta.cc
--- package_meta.cc 2002/01/22 09:03:55 2.15
+++ package_meta.cc 2002/01/24 17:32:12
@@ -168,6 +168,7 @@ packagemeta::uninstall ()
  SetFileAttributes (d, dw & ~FILE_ATTRIBUTE_READONLY);
  DeleteFile (d);
}
+ rebaser::get_instance ()->unrebase (d);
  /* Check for Windows shortcut of same name. */
  d = concat (d, ".lnk", NULL);
  dw = GetFileAttributes (d);



Re: Setup - Idea...

2002-01-24 Thread Corinna Vinschen

> (like cygwin conflicts with regex - which it doesnt I am
> hoping/guessing/havent seen any eveidence yet - but in a similar
> circumstance prehaps it would)

It does.  regex.h is obviously in both packages currently.

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



Re: Setup - Idea...

2002-01-24 Thread Earnie Boyd

Robert Collins wrote:
> 
> On Thu, 2002-01-24 at 22:35, Gareth Pearce wrote:
> > Hi ... I am going out on a limb here and assume that this feature hasnt been
> > suggested before. (ummm yeah I know I should of checked the message lists -
> > I am prepared to shoot myself if I am wrong :P)
> 
> I'm not sure if it's been suggested, but I don't think its a good thing
> - IMO when a package is removed, setup should leave it installed, until
> the user requests that it be removed.
> 

Ditto.

> I'm not religious on this one, so if anyone disagrees, just chime in.
> 

Ok, I'll be the religious one.  If a package is removed from setup.ini
then setup should leave previously installed versions alone.  If a
package needs to be removed due to serious conflicts with Cygwin then a
null package can be created to remove the conflicting files.  Then at a
later date the null package can be deleted.

Note: A null package is one with just an obligatory
/usr/doc/cygwin/-README that explains the removal decision.

Earnie.

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




Re: Setup - Idea...

2002-01-24 Thread Gareth Pearce

> On Thu, 2002-01-24 at 22:35, Gareth Pearce wrote:
> > Hi ... I am going out on a limb here and assume that this feature hasnt
been
> > suggested before. (ummm yeah I know I should of checked the message
lists -
> > I am prepared to shoot myself if I am wrong :P)
>
> I'm not sure if it's been suggested, but I don't think its a good thing
> - IMO when a package is removed, setup should leave it installed, until
> the user requests that it be removed.
I agree - 'except' - where not removing it is almost certain to cause pain
and suffering.

I think I can see this being possible - but ummm maybe its really more an
extension of 'conflicts with' - and so when conflicts get added it can be
done then...
(like cygwin conflicts with regex - which it doesnt I am
hoping/guessing/havent seen any eveidence yet - but in a similar
circumstance prehaps it would)

Gareth



Re: Setup - Idea...

2002-01-24 Thread Robert Collins

On Thu, 2002-01-24 at 22:35, Gareth Pearce wrote:
> Hi ... I am going out on a limb here and assume that this feature hasnt been
> suggested before. (ummm yeah I know I should of checked the message lists -
> I am prepared to shoot myself if I am wrong :P)

I'm not sure if it's been suggested, but I don't think its a good thing
- IMO when a package is removed, setup should leave it installed, until
the user requests that it be removed.

I'm not religious on this one, so if anyone disagrees, just chime in.

Rob




Setup - Idea...

2002-01-24 Thread Gareth Pearce

Hi ... I am going out on a limb here and assume that this feature hasnt been
suggested before. (ummm yeah I know I should of checked the message lists -
I am prepared to shoot myself if I am wrong :P)

Having just read Corinna's announcement that regex was going to be removed.
I was thinking that prehaps there should be the ability to create an entry
in setup.ini - which will cause setup to default to uninstall for a given
package.  Not sure if in this case it would be the best idea - but prehaps
there are other circumstances where it would it might come in useful in the
future.

If theres interest - I can probably steal enough time to write a patch (umm
I - *hope*)

Gareth - is sorely tempted to try and give BIND ago for maintainership -
since its requested so much :P ... wonder if people complaining about it not
working would mind 'I aint got a clue - I just maintaining this for lack of
a maintainer' on a regular basis ;)

hmm still need to decide between nano 1.0.8 and 1.1.5 as well.