delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2002/04/22/17:25:39

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <http://sources.redhat.com/lists.html#faqs>
Mail-Followup-To: cygwin-apps AT cygwin DOT com
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
Date: Mon, 22 Apr 2002 14:23:58 -0700 (Pacific Daylight Time)
From: Michael A Chase <mchase AT ix DOT netcom DOT com>
Subject: Local file tracking class for setup.exe
To: Robert Collins <robert DOT collins AT itdomain DOT com DOT au>,
Cygwin-Apps <cygwin-apps AT sources DOT redhat DOT com>
MIME-Version: 1.0
References: <FC169E059D1A0442A04C40F86D9BA7600C5EB5 AT itdomain003 DOT itdomain DOT net DOT au>
In-Reply-To: <FC169E059D1A0442A04C40F86D9BA7600C5EB5@itdomain003.itdomain.net.au>
Reply-To: Michael A Chase <mchase AT ix DOT netcom DOT com>
Message-Id: <E16zlIU-0001NT-00@smtp6.mindspring.com>

On Mon, 22 Apr 2002 10:36:09 +1000 Robert Collins <robert DOT collins AT itdomain DOT com DOT au> wrote:

> > I've tried to look into this, but it's slow going because I'm 
> > having trouble following the process flow.  
> 
> Feel free to ask questions :}. I don't bite.... much.
> . . .  
> > Perhaps a separate class should be defined for tracking files 
> > found and their possible package associations.  This could be 
> > used later for removing obsolete versions of package archive files.
> 
> Hmmm. Could you enlarge on this idea? One of long term goals is to only
> download setup.ini if it's changed. This in turn allows us to leverage
> more mirror sites more quickly, so there should be no reason to change
> mirrors once one is happy with the selection. (Compare with apt-get). 

This class tracks the files in the local cache so other parts of setup.exe
can ask it if a file is present or not instead of having to look for
themselves.  As files are downloaded they can be added to the list.

I see this being especially useful in choose.cc or packagedb when only
downloading.  It would also make installing simpler since there would be a
single source for tracking which file to use for a given package version.

localfile Instance Data
// Borrowed partly from cygpackage
   String package
   //     vendor       // I don't think this is being used by any current packages
   String packagev
   enum   type         // Source or Binary
   String fn
   size_t filesize
   //     md5          // for future use

localfile Class Methods
   // Create object by parsing filename and getting size from filesystem
   localfile ( full_file_name )
   // Create object by parsing filename with file size already known
   localfile ( full_file_name, size )

localfile Instance Methods
   String package ()
   String version ()
   enum   type ()
   String filename ()
   size_t size ()

localfiles Instance Data
   localfile[] files

localfiles Class Methods
   // Load list of files found under local directory
   localfiles ( local_directory )

localfiles Instance Methods
   // Add one file to the list
   bool add ( full_file_name )
   bool add ( full_file_name, size )
      Return true if successful
      Return false if
         File doesn't exist or is 0 length (N/A if size given)
         File name didn't parse
         Duplicate Package + Version + Type (complain in setup.log)

   // Add to the localfiles list all parseable files under local_directory
   int load ( local_directory )
      Return number of files added

   // Get localfile instance that matches package, version, and type
   localfile file ( package, version, type )
      Return localfiles entry that matches
      Return 0 if not found

   // Get localfile instances that match package and type
   localfile[] versions ( package, type )
      Return array of localfiles entries that match
      Return 0 if none

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.htm
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019