public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [patch] a new setup.exe parameter to specify packages
@ 2008-08-02 20:24 Kohsuke Kawaguchi
  2008-08-04 15:35 ` Thrall, Bryan
  0 siblings, 1 reply; 8+ messages in thread
From: Kohsuke Kawaguchi @ 2008-08-02 20:24 UTC (permalink / raw)
  To: cygwin-apps

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

Hi,

I wrote a patch for setup.exe so that it can take a list of packages
to be installed via the -P option, like this:

  setup.exe -P openssh,cvs,subversion

This would bring in the 3 modules and all their dependencies (of the
curr version.) The main use case for this is to perform unattended
installation from CLI.

I tried to make the coding style match with that of choose.cc, even
though the coding style of setup.exe as a whole seems to be different
from choose.cc. This is the first time I write a patch for Cygwin, so
my apologies if I'm missing some requirements.

-- 
Kohsuke Kawaguchi 
http://weblogs.java.net/blog/kohsuke/

[-- Attachment #2: P-option.diff --]
[-- Type: text/x-diff, Size: 1846 bytes --]

Index: choose.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/choose.cc,v
retrieving revision 2.144
diff -u -r2.144 choose.cc
--- choose.cc	8 Apr 2008 23:50:54 -0000	2.144
+++ choose.cc	2 Aug 2008 07:21:56 -0000
@@ -58,11 +58,15 @@
 #include "Generic.h"
 #include "ControlAdjuster.h"
 #include "prereq.h"
+#include "getopt++/StringOption.h"
 
 using namespace std;
 
 extern ThreeBarProgressPage Progress;
 
+StringOption PackageOption("", 'P', "package", "Packages to install", false);
+
+
 /*
   Sizing information.
  */
@@ -84,6 +88,22 @@
   sizeProcessor.AddControlInfo (ChooserControlsInfo);
 }
 
+vector<string>
+tokenize(const string& str)
+{
+  vector<string> result;
+
+  size_t s=0, e=string::npos;
+  do {
+    e=str.find_first_of(", ",s);
+    if(s!=e)
+      result.push_back(str.substr(s,e-s));
+    s=str.find_first_not_of(", ",e);
+  } while(s != string::npos);
+
+  return result;
+}
+
 void
 ChooserPage::createListview ()
 {
@@ -97,6 +117,22 @@
   chooser->Show(SW_SHOW);
 
   chooser->defaultTrust (TRUST_CURR);
+
+  // select ones that the user explicitly specified
+  vector<string> pkgs = tokenize(PackageOption);
+  for (vector <packagemeta *>::iterator i = db.packages.begin ();
+       i != db.packages.end (); ++i)
+    {
+      packagemeta* pkg = *i;
+      if (find(pkgs.begin(),pkgs.end(),pkg->name)!=pkgs.end())
+	    {
+          pkg->desired = pkg->trustp (TRUST_CURR);
+          if (pkg->desired)
+              pkg->desired.pick (pkg->desired.accessible() && 
+                                  pkg->desired != pkg->installed);
+	    }
+    }
+
   chooser->setViewMode (PickView::views::Category);
   if (!SetDlgItemText (GetHWND (), IDC_CHOOSE_VIEWCAPTION, chooser->mode_caption ()))
     log (LOG_BABBLE) << "Failed to set View button caption %ld" << 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [patch] a new setup.exe parameter to specify packages
  2008-08-02 20:24 [patch] a new setup.exe parameter to specify packages Kohsuke Kawaguchi
@ 2008-08-04 15:35 ` Thrall, Bryan
  2008-08-04 16:13   ` Christopher Faylor
  2008-08-04 20:35   ` Kohsuke Kawaguchi
  0 siblings, 2 replies; 8+ messages in thread
From: Thrall, Bryan @ 2008-08-04 15:35 UTC (permalink / raw)
  To: cygwin-apps

Kohsuke Kawaguchi wrote on Saturday, August 02, 2008 3:24 PM:

> Hi,
> 
> I wrote a patch for setup.exe so that it can take a list of packages
> to be installed via the -P option, like this:
> 
>   setup.exe -P openssh,cvs,subversion
> 
> This would bring in the 3 modules and all their dependencies (of the
> curr version.) The main use case for this is to perform unattended
> installation from CLI.
> 
> I tried to make the coding style match with that of choose.cc, even
> though the coding style of setup.exe as a whole seems to be different
> from choose.cc. This is the first time I write a patch for Cygwin, so
> my apologies if I'm missing some requirements.

It seems this would be a popular feature, with several patches submitted
(including one from me):

http://cygwin.com/ml/cygwin-apps/2006-03/msg00070.html
http://www.cygwin.com/ml/cygwin-apps/2007-08/msg00054.html
http://cygwin.com/ml/cygwin-apps/2008-04/msg00133.html

But it never makes it into the source. It's a little frustrating.

(BTW, thanks for the patch, Kohsuke! Your effort is appreciated)
-- 
Bryan Thrall
FlightSafety International
bryan.thrall@flightsafety.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] a new setup.exe parameter to specify packages
  2008-08-04 15:35 ` Thrall, Bryan
@ 2008-08-04 16:13   ` Christopher Faylor
  2008-08-05 20:47     ` Brian Dessent
  2008-08-04 20:35   ` Kohsuke Kawaguchi
  1 sibling, 1 reply; 8+ messages in thread
From: Christopher Faylor @ 2008-08-04 16:13 UTC (permalink / raw)
  To: cygwin-apps

On Mon, Aug 04, 2008 at 10:34:21AM -0500, Thrall, Bryan wrote:
>Kohsuke Kawaguchi wrote on Saturday, August 02, 2008 3:24 PM:
>
>> Hi,
>> 
>> I wrote a patch for setup.exe so that it can take a list of packages
>> to be installed via the -P option, like this:
>> 
>>   setup.exe -P openssh,cvs,subversion
>> 
>> This would bring in the 3 modules and all their dependencies (of the
>> curr version.) The main use case for this is to perform unattended
>> installation from CLI.
>> 
>> I tried to make the coding style match with that of choose.cc, even
>> though the coding style of setup.exe as a whole seems to be different
>> from choose.cc. This is the first time I write a patch for Cygwin, so
>> my apologies if I'm missing some requirements.
>
>It seems this would be a popular feature, with several patches submitted
>(including one from me):
>
>http://cygwin.com/ml/cygwin-apps/2006-03/msg00070.html
>http://www.cygwin.com/ml/cygwin-apps/2007-08/msg00054.html
>http://cygwin.com/ml/cygwin-apps/2008-04/msg00133.html
>
>But it never makes it into the source. It's a little frustrating.
>
>(BTW, thanks for the patch, Kohsuke! Your effort is appreciated)

Maybe it's time to start looking for additional setup maintainers.
Anyone want to volunteer?

cgf

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] a new setup.exe parameter to specify packages
  2008-08-04 15:35 ` Thrall, Bryan
  2008-08-04 16:13   ` Christopher Faylor
@ 2008-08-04 20:35   ` Kohsuke Kawaguchi
  1 sibling, 0 replies; 8+ messages in thread
From: Kohsuke Kawaguchi @ 2008-08-04 20:35 UTC (permalink / raw)
  To: cygwin-apps

Thrall, Bryan wrote:
> Kohsuke Kawaguchi wrote on Saturday, August 02, 2008 3:24 PM:
> 
>> Hi,
>> 
>> I wrote a patch for setup.exe so that it can take a list of packages
>> to be installed via the -P option, like this:
>> 
>>   setup.exe -P openssh,cvs,subversion
>> 
>> This would bring in the 3 modules and all their dependencies (of the
>> curr version.) The main use case for this is to perform unattended
>> installation from CLI.
>> 
>> I tried to make the coding style match with that of choose.cc, even
>> though the coding style of setup.exe as a whole seems to be different
>> from choose.cc. This is the first time I write a patch for Cygwin, so
>> my apologies if I'm missing some requirements.
> 
> It seems this would be a popular feature, with several patches submitted
> (including one from me):

Ah, OK, I didn't realized that I was duplicating an effort. As long as 
any one of them gets integrated,  I'm happy.

> 
> http://cygwin.com/ml/cygwin-apps/2006-03/msg00070.html
> http://www.cygwin.com/ml/cygwin-apps/2007-08/msg00054.html
> http://cygwin.com/ml/cygwin-apps/2008-04/msg00133.html
> 
> But it never makes it into the source. It's a little frustrating.
> 
> (BTW, thanks for the patch, Kohsuke! Your effort is appreciated)


-- 
Kohsuke Kawaguchi 
http://weblogs.java.net/blog/kohsuke/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] a new setup.exe parameter to specify packages
  2008-08-04 16:13   ` Christopher Faylor
@ 2008-08-05 20:47     ` Brian Dessent
  2008-08-05 20:50       ` Christopher Faylor
  0 siblings, 1 reply; 8+ messages in thread
From: Brian Dessent @ 2008-08-05 20:47 UTC (permalink / raw)
  To: cygwin-apps

Christopher Faylor wrote:

> Maybe it's time to start looking for additional setup maintainers.
> Anyone want to volunteer?

I would be very pleased to see this happen, since it's clear that the
current amount of manpower that I can donate is lacking.

Brian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] a new setup.exe parameter to specify packages
  2008-08-05 20:47     ` Brian Dessent
@ 2008-08-05 20:50       ` Christopher Faylor
  2008-08-06 16:42         ` Dave Korn
  0 siblings, 1 reply; 8+ messages in thread
From: Christopher Faylor @ 2008-08-05 20:50 UTC (permalink / raw)
  To: cygwin-apps

On Tue, Aug 05, 2008 at 01:46:33PM -0700, Brian Dessent wrote:
>Christopher Faylor wrote:
>>Maybe it's time to start looking for additional setup maintainers.
>>Anyone want to volunteer?
>
>I would be very pleased to see this happen, since it's clear that the
>current amount of manpower that I can donate is lacking.

I assumed as much.  If this sounded in any way like a condemnation of
the current setup maintainers I really apologize.

cgf

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [patch] a new setup.exe parameter to specify packages
  2008-08-05 20:50       ` Christopher Faylor
@ 2008-08-06 16:42         ` Dave Korn
  2008-08-06 17:18           ` Ralph Hempel
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Korn @ 2008-08-06 16:42 UTC (permalink / raw)
  To: cygwin-apps

Christopher Faylor wrote on 05 August 2008 21:49:

> On Tue, Aug 05, 2008 at 01:46:33PM -0700, Brian Dessent wrote:
>> Christopher Faylor wrote:
>>> Maybe it's time to start looking for additional setup maintainers.
>>> Anyone want to volunteer?
>> 
>> I would be very pleased to see this happen, since it's clear that the
>> current amount of manpower that I can donate is lacking.
> 
> I assumed as much.  If this sounded in any way like a condemnation of
> the current setup maintainers I really apologize.
> 
> cgf

  No, no offense taken.  We know we're overloaded!

  OTOH, I have to roll out some new packages to my internal users in the
next few days, and it would be convenient for me if I could just email round
a shell script or command-line for them all to run rather than making them
click through all the dialogs and select packages in the chooser, so I think
I'll take the opportunity to upgrade our internal build of setup and
integrate one of the relevant patches while I'm doing it.

  Bryan, Kohsuke, thank you both for your efforts, and your patience; I hope
to be able to bring you good news very soon.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] a new setup.exe parameter to specify packages
  2008-08-06 16:42         ` Dave Korn
@ 2008-08-06 17:18           ` Ralph Hempel
  0 siblings, 0 replies; 8+ messages in thread
From: Ralph Hempel @ 2008-08-06 17:18 UTC (permalink / raw)
  To: cygwin-apps

Dave Korn wrote:

>   Bryan, Kohsuke, thank you both for your efforts, and your patience; I hope
> to be able to bring you good news very soon.

I hope so too! Thanks for working on this as well, Dave.

Cheers, Ralph

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-08-06 17:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-02 20:24 [patch] a new setup.exe parameter to specify packages Kohsuke Kawaguchi
2008-08-04 15:35 ` Thrall, Bryan
2008-08-04 16:13   ` Christopher Faylor
2008-08-05 20:47     ` Brian Dessent
2008-08-05 20:50       ` Christopher Faylor
2008-08-06 16:42         ` Dave Korn
2008-08-06 17:18           ` Ralph Hempel
2008-08-04 20:35   ` Kohsuke Kawaguchi

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