If a program manipulates a large amount of data, it does so in a small number of ways. - Alan J Perlis

the brown-dragon blog

Downloading Cygwin

2009-08-12

Cywin (on WinXP) is wonderful - it allows access to a Unix-like environment within Windows. I use it a lot but one pain point I have is needing to connect to the net every time I need a new lib or utility installed. This is a pain because the corporate firewall at work cribs on some downloads(size limitations) which is a PITA.

So I figured I'd download the entire cygwin install locally - that way I don't need to worry about the network and can install what I like when I like. This blog is about my experiences downloading the entire cygwin.

The entire cygwin download ended up to be 2.27 GB (phew!). That's a total of seven Microsoft Office installs! Cywin has a lot of stuff!

So one problem is, you simply cannot click-select each package in the interface. It would literally take you an hour or so and set you well on your way to carpal tunnel syndrome. That turned out not to be a big issue though, as the nice people at cygwin provide an option to "select all" in a slightly round-about fashion.

Steps to follow to "select all":

  1) Rename your existing cygwin folder (this prevents already installed packages from not being downloaded).
  2) Run the cygwin setup. Select "Download without Installing".
  2) Select your network setting and a good download site. Bring up the "Category" view.
  3) The very first category is a "All" category. It should be followed by a circular icon and the word "Default". Click "Default" or the icon ONCE and wait about 30 seconds (be patient).
  4) "Default" will change to "Install" which will download the entire cygwin package.
  5) After you finish the download remember to rename your old cygwin folder back.

Now, you are ready to download the entire cygwin binary install. However this will NOT give you the corresponding source! This was a deal-breaker for me. What's the point of open source if I can't dowload the source!?

After trying for a while I could not find a good way to get the source. So I downloaded the source to the installer itself (it took some digging to find but it's available here: http://sources.redhat.com/cygwin-apps/setup.html).

Then I patched it to download the source code as well:

cygwinsetup-2.573.2.3.full.p0

diff --git a/package_meta.cc b/package_meta.cc
old mode 100644
new mode 100755
index 1145980..4be491f
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -385,7 +385,7 @@ packagemeta::set_action (packageversion const &default_version)
   else
     {
       /* preserve the src tick box */
-      bool sourceticked = desired.sourcePackage().picked();
+      bool sourceticked = true;
       /* bump the version selected, skipping the radio button trust along the way */
       set<packageversion>::iterator i;
       for (i=versions.begin(); i != versions.end() && *i != desired; ++i);
@@ -460,7 +460,7 @@ packagemeta::set_action (_actions action, packageversion const &default_version)
      if (desired.accessible ())
        {
  desired.pick (true);
- desired.sourcePackage ().pick (false);
+ desired.sourcePackage ().pick (true);
        }
      else
        {
@@ -481,7 +481,7 @@ packagemeta::set_action (_actions action, packageversion const &default_version)
       if (desired)
  {
    desired.pick (true);
-   desired.sourcePackage ().pick (false);
+   desired.sourcePackage ().pick (true);
  }
     }
   else if (action == Uninstall_action)
diff --git a/package_version.cc b/package_version.cc
index a7fec14..7086e04 100644
--- a/package_version.cc
+++ b/package_version.cc
@@ -286,6 +286,7 @@ void
 packageversion::pick (bool aBool)
 {
   data->pick(aBool);
+  data->picksrc(aBool);
 }
 
 void
@@ -495,7 +496,7 @@ packageversion::scripts()
 
 /* the parent data class */
   
-_packageversion::_packageversion ():picked (false), references (0)
+_packageversion::_packageversion ():picked (true), references (0)
 {
 }
 
@@ -536,6 +537,7 @@ _packageversion::sourcePackage ()
      sourceVersion = ver;
           ++i;
  }
+      if (sourceVersion) sourceVersion.pick (true);
     }
   return sourceVersion;
 }
diff --git a/package_version.h b/package_version.h
index c8d8215..28d7c6e 100644
--- a/package_version.h
+++ b/package_version.h
@@ -195,6 +195,8 @@ public:
 
   virtual bool accessible () const;
 
+  virtual void picksrc (bool const &newValue) { if (sourcePackage ()) sourceVersion.pick (newValue); }
+
   /* TODO: Implement me:
      static package_meta * scan_package (io_stream *);
    */

And here is the patched exe if you don't want to recompile from source: setup-full-2.573.2.3.exe (MD5: c6f783051cf53d797c407c822c10638e]

Simply follow the above steps. This time, you will notice the source code packages are selected by default and you can download the entire cygwin install in a few clicks.

Other Posts

(ordered by Tags then Date)