]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
2002-07-15 Robert Collins <rbtcollins@hotmail.com>
authorRobert Collins <rbtcollins@hotmail.com>
Mon, 15 Jul 2002 13:29:38 +0000 (13:29 +0000)
committerRobert Collins <rbtcollins@hotmail.com>
Mon, 15 Jul 2002 13:29:38 +0000 (13:29 +0000)
        * package_version.h (packageversion::sources): Support multiple files in
        a single package version.
        * package_version.cc (_packageversion::accessible): Ditto.
        (packageversion::source): Ditto.

ChangeLog
package_version.cc
package_version.h

index f8a5bd271ae05762f1d39d9bfb9b79c0f182ebba..d737a8df1082badb5442c6bedad8e1342191cd1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-15  Robert Collins  <rbtcollins@hotmail.com>
+
+       * package_version.h (packageversion::sources): Support multiple files in
+       a single package version.
+       * package_version.cc (_packageversion::accessible): Ditto.
+       (packageversion::source): Ditto.
+
 2002-07-15  Robert Collins  <rbtcollins@hotmail.com>
 
        * iniparse.y: Implement support for multiple source files for a source
index d01016ca1599075861f77e2118318d7b5500ace3..570b6703b51d4533a5ee0a430cfc2155d95c0469 100644 (file)
@@ -280,7 +280,9 @@ packageversion::uninstall ()
 packagesource *
 packageversion::source ()
 {
-  return &data->source;
+  if (!data->sources.size())
+    data->sources.push_back (packagesource());
+  return &data->sources[0];
 }
 
 bool
@@ -461,8 +463,21 @@ _packageversion::sourcePackage ()
 bool
 _packageversion::accessible() const
 {
-  return ((::source != IDC_SOURCE_CWD) && source.sites.size()) ||
-    source.Cached ();
+  bool cached = true;
+  for (vector<packagesource>::const_iterator i = sources.begin();
+       i!=sources.end(); ++i)
+    if (!i->Cached ())
+      cached = false;
+  if (cached) 
+    return true;
+  if (::source == IDC_SOURCE_CWD)
+    return false;
+  unsigned int retrievable = 0;
+  for (vector<packagesource>::const_iterator i = sources.begin();
+      i!=sources.end(); ++i)
+    if (i->sites.size() || i->Cached ())
+      retrievable += 1;
+  return retrievable == sources.size();
 }
 
 bool
index b667b87e5690b907b4cba4b02380912d6d594cbd..f2c390a3b19513c3429e0d65c00f47381238f608 100644 (file)
@@ -128,7 +128,13 @@ public:
 
   void uninstall ();
   /* invariant: never null */
-  packagesource *source(); /* where can we source the files from */
+  packagesource *source(); /* where can we source the file from */
+  /* invariant: never null */
+  vector <packagesource> *sources(); /* expose the list of files.
+                                       source() returns the 'default' file
+                                       sources() allows managing multiple files
+                                       in a single package
+                                       */
 
   bool accessible () const;
 
@@ -185,7 +191,7 @@ public:
 
 
   virtual void uninstall () = 0;
-  packagesource source; /* where can we source the files from */
+  vector<packagesource> sources; /* where can we source the files from */
 
   bool accessible () const;
 
This page took 0.038037 seconds and 5 git commands to generate.