This list is closed, nobody may subscribe to it.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(13) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(38) |
Jul
(10) |
Aug
(70) |
Sep
(63) |
Oct
(61) |
Nov
(41) |
Dec
(28) |
| 2002 |
Jan
(43) |
Feb
(11) |
Mar
(9) |
Apr
(2) |
May
(97) |
Jun
(94) |
Jul
(13) |
Aug
(49) |
Sep
(41) |
Oct
(24) |
Nov
(55) |
Dec
(126) |
| 2003 |
Jan
(90) |
Feb
(75) |
Mar
(32) |
Apr
(24) |
May
(54) |
Jun
(54) |
Jul
(22) |
Aug
(4) |
Sep
(16) |
Oct
(8) |
Nov
(6) |
Dec
(13) |
| 2004 |
Jan
|
Feb
(17) |
Mar
(60) |
Apr
(21) |
May
(12) |
Jun
|
Jul
(13) |
Aug
|
Sep
(29) |
Oct
|
Nov
|
Dec
(2) |
| 2005 |
Jan
(22) |
Feb
(3) |
Mar
(2) |
Apr
(13) |
May
(82) |
Jun
(18) |
Jul
(30) |
Aug
(17) |
Sep
(3) |
Oct
(19) |
Nov
(4) |
Dec
(8) |
| 2006 |
Jan
(1) |
Feb
(6) |
Mar
(2) |
Apr
(40) |
May
|
Jun
(21) |
Jul
(1) |
Aug
(410) |
Sep
(3) |
Oct
|
Nov
(56) |
Dec
(7) |
| 2007 |
Jan
(19) |
Feb
|
Mar
(4) |
Apr
(8) |
May
(19) |
Jun
(6) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(2) |
| 2008 |
Jan
(13) |
Feb
(18) |
Mar
(12) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
(11) |
Oct
(13) |
Nov
(17) |
Dec
(6) |
| 2010 |
Jan
(24) |
Feb
(10) |
Mar
(27) |
Apr
(20) |
May
(108) |
Jun
(8) |
Jul
(23) |
Aug
(38) |
Sep
(49) |
Oct
(17) |
Nov
(12) |
Dec
(14) |
| 2011 |
Jan
(17) |
Feb
(7) |
Mar
(28) |
Apr
(8) |
May
(20) |
Jun
(11) |
Jul
(7) |
Aug
(12) |
Sep
(4) |
Oct
(20) |
Nov
(19) |
Dec
(2) |
| 2012 |
Jan
(2) |
Feb
(6) |
Mar
(5) |
Apr
(24) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(18) |
Sep
(38) |
Oct
(26) |
Nov
(12) |
Dec
(6) |
| 2013 |
Jan
(19) |
Feb
(18) |
Mar
(44) |
Apr
(35) |
May
(18) |
Jun
(21) |
Jul
(10) |
Aug
(19) |
Sep
(44) |
Oct
(25) |
Nov
(1) |
Dec
(2) |
| 2014 |
Jan
(8) |
Feb
|
Mar
|
Apr
(5) |
May
(1) |
Jun
(3) |
Jul
|
Aug
(3) |
Sep
|
Oct
(4) |
Nov
(4) |
Dec
(7) |
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(4) |
Jul
(6) |
Aug
(2) |
Sep
(8) |
Oct
(2) |
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
(7) |
Feb
(9) |
Mar
(5) |
Apr
(5) |
May
(9) |
Jun
(4) |
Jul
(20) |
Aug
(4) |
Sep
(7) |
Oct
(6) |
Nov
(9) |
Dec
(2) |
| 2017 |
Jan
(7) |
Feb
(7) |
Mar
(5) |
Apr
|
May
(1) |
Jun
(4) |
Jul
(12) |
Aug
(4) |
Sep
(1) |
Oct
(4) |
Nov
(11) |
Dec
(14) |
| 2018 |
Jan
(3) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
|
|
3
|
4
|
5
|
6
|
7
|
8
(2) |
9
|
|
10
|
11
|
12
|
13
|
14
|
15
(5) |
16
(2) |
|
17
|
18
|
19
|
20
|
21
|
22
(8) |
23
(4) |
|
24
|
25
|
26
(3) |
27
|
28
|
29
|
30
|
|
31
|
|
|
|
|
|
|
|
From: Keith M. <kei...@us...> - 2010-01-26 21:08:39
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25102/src Added Files: pkgdeps.cpp Log Message: Implement rudimentary dependency resolver. --- NEW FILE: pkgdeps.cpp --- /* * pkgdeps.cpp * * $Id: pkgdeps.cpp,v 1.1 2010/01/26 21:08:30 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2009, 2010, MinGW Project * * * Implementation of the package dependency resolver method, of the * "pkgXmlDocument" class; includes the interface to the action item * task scheduler, which is called to ensure that processing for any * identified prerequisite packages is appropriately scheduled. * * * This is free software. Permission is granted to copy, modify and * redistribute this software, under the provisions of the GNU General * Public License, Version 3, (or, at your option, any later version), * as published by the Free Software Foundation; see the file COPYING * for licensing details. * * Note, in particular, that this software is provided "as is", in the * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY * PARTICULAR PURPOSE. Under no circumstances will the author, or the * MinGW Project, accept liability for any damages, however caused, * arising from the use of this software. * */ #include <string.h> #include "dmh.h" #include "pkginfo.h" #include "pkgbase.h" #include "pkgkeys.h" #include "pkgtask.h" static bool is_installed( pkgXmlNode *release ) { /* Helper to check installation status of a specified package release. */ const char *status; /* * First, check for any 'installed' attribute which may have been * explicitly specified for the 'release' record... */ if( (status = release->GetPropVal( installed_key, NULL )) != NULL ) /* * ...immediately returning the status deduced from it, * when present. */ return (strcmp( status, yes_value ) == 0); /* When the package definition itself doesn't bear an explicit * 'installed' attribute, then we must check the system map for * an associated installation record... */ const char *pkgname; if( ((pkgname = release->GetPropVal( tarname_key, NULL )) != NULL) && (release->GetInstallationRecord( pkgname ) != NULL) ) { /* ...and, when one is found, we can mark this package with * an explicit status attribute for future reference, before * we return confirmation of the installed status... */ release->SetAttribute( installed_key, yes_value ); return true; } /* If we get to here, we may deduce that the package is not * installed; once again, we set the explicit attribute value * to convey this for future reference, before returning the * appropriate status flag. */ release->SetAttribute( installed_key, no_value ); return false; } pkgXmlNode *pkgXmlNode::GetInstallationRecord( const char *pkgname ) { /* Retrieve the installation record, if any, for the package * specified by fully qualified canonical 'pkgname'. * * First, break down the specified package name, and retrieve * the sysroot database entry for its associated subsystem. */ pkgXmlNode *sysroot; pkgSpecs lookup( pkgname ); if( (sysroot = GetSysRoot( lookup.GetSubSystemName() )) != NULL ) { /* We successfully retrieved a sysroot entry; now we must * search the associated list of installed packages, for one * with the appropriate canonical package name. */ pkgXmlNode *pkg = sysroot->FindFirstAssociate( installed_key ); while( pkg != NULL ) { /* We found an installed package entry; check if it has * the correct canonical name... */ const char *installed = pkg->GetPropVal( tarname_key, NULL ); if( (installed != NULL) && (strcmp( installed, pkgname ) == 0) ) /* * ...returning this entry if so... */ return pkg; /* ...otherwise, move on to the next entry, if any. */ pkg = pkg->FindNextAssociate( installed_key ); } } /* If we get to here, we didn't find an entry for the required * package; return NULL, indicating that it is not installed. */ return NULL; } void pkgXmlDocument::ResolveDependencies( pkgXmlNode* package, pkgActionItem* rank ) { /* For the specified "package", (nominally a "release"), identify its * prerequisites, (as specified by "requires" tags), and schedule actions * to process them; repeat recursively, to identify further dependencies * of such prerequisites, and finally, extend the search to capture * additional dependencies common to the containing package group. */ while( package != NULL ) { /* We have a valid XML entity, which may identify dependencies; * check if it includes any "requires" specification... */ pkgXmlNode *dep = package->FindFirstAssociate( requires_key ); while( dep != NULL ) { /* We found a dependency specification... * Initially, assume this package is not installed. */ pkgXmlNode *installed = NULL; /* Identify the prerequisite package, from its canonical name... */ pkgActionItem wanted; pkgXmlNode *selected; pkgSpecs req( wanted.SetRequirements( dep ) ); /* * (Both the package name, and subsystem if specified, must match)... */ selected = FindPackageByName( req.GetPackageName(), req.GetSubSystemName() ); /* When we've identified the appropriate package... */ if( selected != NULL ) { /* ...and, more significantly, the appropriate component package, * where applicable... */ pkgXmlNode *component; const char *reqclass = req.GetComponentClass(); if( (component = selected->FindFirstAssociate( component_key )) == NULL ) /* * ...but if no separate component package exists, * consider the parent package itself, as sole component. */ component = selected; while( component != NULL ) { /* Step through the "releases" of this component package... */ pkgXmlNode *required = component->FindFirstAssociate( release_key ); while( required != NULL ) { /* ...noting if we find one already marked as "installed"... */ pkgSpecs tst( required->GetPropVal( tarname_key, NULL ) ); if( is_installed( required ) && (strcmp( tst.GetComponentClass(), reqclass ) == 0) ) installed = required; /* ...and identify the most suitable candidate "release" * to satisfy the current dependency... */ if( wanted.SelectIfMostRecentFit( required ) == required ) selected = component = required; /* ...continuing, until all available "releases" * have been evaluated accordingly. */ required = required->FindNextAssociate( release_key ); } /* Where multiple component packages do exist, * continue until all have been inspected. */ component = component->FindNextAssociate( component_key ); } } /* We have now identified the most suitable candidate package, * to resolve the current dependency... */ if( installed ) { /* ...this package is already installed, so we may schedule * a resolved dependency match, with no pending action... */ unsigned long fallback = request & ~ACTION_MASK; if( selected != installed ) { /* ...but, if there is a better candidate than the installed * version, we prefer to schedule an upgrade. */ fallback |= ACTION_UPGRADE; wanted.SelectPackage( installed, to_remove ); } rank = Schedule( fallback, wanted, rank ); } else if( (request & ACTION_MASK) == ACTION_INSTALL ) /* * The required package is not installed... * When performing an installation, we must schedule it * for installation now; (we may simply ignore it, if * we are performing a removal). */ rank = Schedule( request, wanted, rank ); /* Regardless of the action scheduled, we must recursively * consider further dependencies of the resolved prerequisite; * FIXME: do we need to do this, when performing a removal? */ ResolveDependencies( selected, rank ); /* Continue, until all prerequisites of the current package * have been evaluated. */ dep = dep->FindNextAssociate( requires_key ); } /* Also consider any dependencies which may be common to * all releases, or all components, of the current package; * we do this by walking back through the XML hierarchy, * searching for "requires" elements in all containing * contexts, until we reach the root element. */ package = package->GetParent(); } } void pkgXmlDocument::Schedule( unsigned long action, const char* name ) { /* Task scheduler interface; schedules actions to process dependencies * for the package specified by "name". */ pkgXmlNode *release; if( (release = FindPackageByName( name )) != NULL ) { /* We found the specification for the named package... */ pkgXmlNode *component = release->FindFirstAssociate( component_key ); if( component != NULL ) /* * When it is subdivided into component-packages, * we need to consider each as a possible candidate * for task scheduling. */ release = component; while( release != NULL ) { /* Within each candidate package or component-package... */ if( (release = release->FindFirstAssociate( release_key )) != NULL ) { /* ...initially assume it is not installed, and that * no installable upgrade is available. */ pkgActionItem latest; pkgXmlNode *installed = NULL, *upgrade = NULL; /* Establish the action for which dependency resolution is * to be performed; note that this may be promoted to a more * inclusive class, during resolution, so we need to reset * it for each new dependency which may be encountered. */ request = action; /* For each candidate release in turn... */ while( release != NULL ) { /* ...inspect it to identify any which is already installed, * and also the latest available... */ if( is_installed( release ) ) /* * ...i.e. here we have identified a release * which is currently installed... */ installed = release; if( latest.SelectIfMostRecentFit( release ) == release ) /* * ...while this is the most recent we have * encountered so far. */ upgrade = release; /* Continue with the next specified release, if any. */ release = release->FindNextAssociate( release_key ); } if( installed == NULL ) { /* There is no installed version... * therefore, there is nothing to do for any action * other than ACTION_INSTALL... */ if( (action & ACTION_MASK) == ACTION_INSTALL ) /* * ...in which case, we must recursively resolve * any dependencies for the scheduled "upgrade". */ ResolveDependencies( upgrade, Schedule( action, latest )); } else if( upgrade && (upgrade != installed) ) { /* There is an installed version... * but an upgrade to a newer version is available; * ACTION_INSTALL implies ACTION_UPGRADE. */ unsigned long fallback = action; if( (action & ACTION_MASK) == ACTION_INSTALL ) fallback = ACTION_UPGRADE + (action & ~ACTION_MASK); /* Again, we recursively resolve any dependencies * for the scheduled upgrade. */ ResolveDependencies( upgrade, Schedule( fallback, latest )); } else /* In this case, the package is already installed, * and no more recent release is available; we still * recursively resolve its dependencies, to capture * any potential upgrades for them. */ ResolveDependencies( upgrade, Schedule( action, latest )); } if( (component = component->FindNextAssociate( component_key )) != NULL ) /* * When evaluating a component-package, we extend our * evaluation, to consider for any further components of * the current package. */ release = component; } } else /* We found no information on the requested package; * diagnose as a non-fatal error. */ dmh_notify( DMH_ERROR, "%s: unknown package\n", name ); } /* $RCSfile: pkgdeps.cpp,v $: end of file */ |
|
From: Keith M. <kei...@us...> - 2010-01-26 21:07:28
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24122/src Modified Files: climain.cpp pkgbase.h pkgexec.cpp pkginet.cpp pkgkeys.c pkgkeys.h vercmp.cpp Log Message: Implement rudimentary dependency resolver. Index: pkgkeys.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgkeys.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgkeys.h 16 Jan 2010 20:49:57 -0000 1.1 --- pkgkeys.h 26 Jan 2010 21:07:18 -0000 1.2 *************** *** 66,68 **** --- 66,74 ---- EXTERN_C_DECL const char *uri_key; + /* Some standard values, which may be associated with certain + * of the above XML database keys. + */ + EXTERN_C_DECL const char *yes_value; + EXTERN_C_DECL const char *no_value; + #endif /* PKGKEYS_H: $RCSfile$: end of file */ Index: vercmp.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/vercmp.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** vercmp.cpp 16 Nov 2009 21:54:30 -0000 1.1 --- vercmp.cpp 26 Jan 2010 21:07:18 -0000 1.2 *************** *** 6,10 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 6,10 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 156,160 **** long cmp; for( int index = VERSION_MAJOR; index < VERSION_ELEMENT_COUNT; index++ ) ! if( (cmp = Compare( rhs, index )) != 0L ) return (cmp > 0L); /* If we get to here, lhs and rhs versions are identically equal, --- 156,160 ---- long cmp; for( int index = VERSION_MAJOR; index < VERSION_ELEMENT_COUNT; index++ ) ! if( (cmp = Compare( rhs, index )) != 0L ) return (cmp < 0L); /* If we get to here, lhs and rhs versions are identically equal, Index: climain.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/climain.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** climain.cpp 22 Jan 2010 17:11:48 -0000 1.4 --- climain.cpp 26 Jan 2010 21:07:17 -0000 1.5 *************** *** 91,95 **** dbase.LoadSystemMap(); - #if 0 /* ...schedule the specified action for each additional command line * argument, (each of which is assumed to represent a package name)... --- 91,94 ---- *************** *** 101,105 **** */ dbase.ExecuteActions(); - #endif } --- 100,103 ---- Index: pkgkeys.c =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgkeys.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgkeys.c 16 Jan 2010 20:49:57 -0000 1.1 --- pkgkeys.c 26 Jan 2010 21:07:18 -0000 1.2 *************** *** 55,57 **** --- 55,63 ---- const char *uri_key = "uri"; + /* Some standard values, which may be associated with certain + * of the above keys. + */ + const char *yes_value = "yes"; + const char *no_value = "no"; + /* $RCSfile$: end of file */ Index: pkgexec.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgexec.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pkgexec.cpp 16 Jan 2010 20:49:57 -0000 1.3 --- pkgexec.cpp 26 Jan 2010 21:07:18 -0000 1.4 *************** *** 93,97 **** max_wanted = NULL; /* nor any maximum version */ ! selection = NULL; /* no package selection yet, for this item */ /* Insert this item at a specified location in the actions list. --- 93,98 ---- max_wanted = NULL; /* nor any maximum version */ ! /* Initialise package selection to NONE, for this action... */ ! selection[to_remove] = selection[to_install] = NULL; /* Insert this item at a specified location in the actions list. *************** *** 206,210 **** */ pkgXmlNode* pkg; ! if( (pkg = item.selection->GetParent()) != NULL ) { /* We have a pointer to the XML database entry which identifies --- 207,211 ---- */ pkgXmlNode* pkg; ! if( (pkg = item.Selection()->GetParent()) != NULL ) { /* We have a pointer to the XML database entry which identifies *************** *** 218,222 **** * (i.e. to the same package), we return it... */ ! if( item->selection->GetParent() == pkg ) return item; } --- 219,223 ---- * (i.e. to the same package), we return it... */ ! if( item->Selection()->GetParent() == pkg ) return item; } *************** *** 297,306 **** && match_if_explicit( test.GetComponentVersion(), fit.GetComponentVersion() ) && ((max_wanted == NULL) || ((flags & STRICTLY_LT) ? (test < max_fit) : (test <= max_fit))) ! && ((flags & STRICTLY_GT) ? (test > min_fit) : (test >= min_fit)) ) { /* We have the correct package component, and it fits within * the allowed range of release versions... */ ! pkgSpecs last( selection ); if( test > last ) /* --- 298,307 ---- && match_if_explicit( test.GetComponentVersion(), fit.GetComponentVersion() ) && ((max_wanted == NULL) || ((flags & STRICTLY_LT) ? (test < max_fit) : (test <= max_fit))) ! && ((min_wanted == NULL) || ((flags & STRICTLY_GT) ? (test > min_fit) : (test >= min_fit))) ) { /* We have the correct package component, and it fits within * the allowed range of release versions... */ ! pkgSpecs last( Selection() ); if( test > last ) /* *************** *** 308,317 **** * so we now replace that... */ ! selection = package; } /* Whatever choice we make, we return the resultant selection... */ ! return selection; } --- 309,318 ---- * so we now replace that... */ ! selection[to_install] = package; } /* Whatever choice we make, we return the resultant selection... */ ! return Selection(); } *************** *** 325,332 **** pkgActionItem *ref = rank ? rank : actions; - /* Record the requested action code... - */ - request = action; - /* Don't reschedule, if we already have a prior matching item... */ --- 326,329 ---- *************** *** 344,347 **** --- 341,345 ---- */ return rank->Insert( ref ); + else /* ...otherwise, at the end of the list. *************** *** 356,358 **** --- 354,399 ---- } + void pkgActionItem::Execute() + { + if( this != NULL ) + { + pkgActionItem *current = this; + while( current->prev != NULL ) current = current->prev; + DownloadArchiveFiles( current ); + while( current != NULL ) + { + dmh_printf( "%s: %s\n", action_name(current->flags & ACTION_MASK), + current->Selection()->GetPropVal( tarname_key, "<unknown>" )); + + if( (current->flags & ACTION_REMOVE) == ACTION_REMOVE ) + { + /* The selected package has been marked for removal, either explicitly, + * or as an implicit prerequisite for upgrade; search to installed system + * manifest, to identify the specific version (if any) to be removed. + * + * FIXME: This implementation is a stub, to be rewritten when the system + * manifest structure has been specified and implemented. + */ + if( current->Selection( to_remove ) != NULL ) + dmh_printf( " removing %s\n", current->Selection( to_remove )->GetPropVal( tarname_key, "<unknown>" )); + } + + if( (current->flags & ACTION_INSTALL) == ACTION_INSTALL ) + { + /* The selected package has been marked for installation, either explicitly, + * or implicitly to complete a package upgrade. + * + * FIXME: Once more, this is a stub, to be extended to provide the working + * installer implementation. + */ + dmh_printf( " installing %s\n", current->Selection()->GetPropVal( tarname_key, "<unknown>" )); + } + + /* Proceed to next package with scheduled actions. + */ + current = current->next; + } + } + } + /* $RCSfile$: end of file */ Index: pkginet.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkginet.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pkginet.cpp 23 Jan 2010 17:01:53 -0000 1.4 --- pkginet.cpp 26 Jan 2010 21:07:18 -0000 1.5 *************** *** 289,293 **** * the required archive from a suitable internet mirror host. */ ! const char *package_name = current->selection->ArchiveName(); pkgInternetStreamingAgent download( package_name, current->ArchivePath() ); --- 289,293 ---- * the required archive from a suitable internet mirror host. */ ! const char *package_name = current->Selection()->ArchiveName(); pkgInternetStreamingAgent download( package_name, current->ArchivePath() ); *************** *** 298,302 **** /* ...if not, ask the download agent to fetch it... */ ! const char *url_template = get_host_info( current->selection, uri_key ); if( url_template != NULL ) { --- 298,302 ---- /* ...if not, ask the download agent to fetch it... */ ! const char *url_template = get_host_info( current->Selection(), uri_key ); if( url_template != NULL ) { *************** *** 304,308 **** * the package repository catalogue (configuration database)... */ ! const char *mirror = get_host_info( current->selection, mirror_key ); char package_url[mkpath( NULL, url_template, package_name, mirror )]; mkpath( package_url, url_template, package_name, mirror ); --- 304,308 ---- * the package repository catalogue (configuration database)... */ ! const char *mirror = get_host_info( current->Selection(), mirror_key ); char package_url[mkpath( NULL, url_template, package_name, mirror )]; mkpath( package_url, url_template, package_name, mirror ); Index: pkgbase.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgbase.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pkgbase.h 22 Jan 2010 17:11:48 -0000 1.3 --- pkgbase.h 26 Jan 2010 21:07:18 -0000 1.4 *************** *** 127,134 **** } ! /* Method for retrieving the system root management records * for a specified installed subsystem. */ pkgXmlNode *GetSysRoot( const char *subsystem ); /* The following pair of methods provide an iterator --- 127,135 ---- } ! /* Methods for retrieving the system root management records * for a specified installed subsystem. */ pkgXmlNode *GetSysRoot( const char *subsystem ); + pkgXmlNode *GetInstallationRecord( const char* ); /* The following pair of methods provide an iterator *************** *** 148,151 **** --- 149,153 ---- }; + enum { to_remove = 0, to_install, selection_types }; class pkgActionItem { *************** *** 172,179 **** const char* max_wanted; ! /* Pointer to the XML database entry for the package selected * for processing by this action. */ ! pkgXmlNode* selection; /* Method for retrieving packages from a distribution server. --- 174,181 ---- const char* max_wanted; ! /* Pointers to the XML database entries for the package selected * for processing by this action. */ ! pkgXmlNode* selection[ selection_types ]; /* Method for retrieving packages from a distribution server. *************** *** 201,204 **** --- 203,218 ---- const char* SetRequirements( pkgXmlNode* ); pkgXmlNode* SelectIfMostRecentFit( pkgXmlNode* ); + inline void SelectPackage( pkgXmlNode *pkg, int opt = to_install ) + { + /* Mark a package as the selection for a specified action. + */ + selection[ opt ] = pkg; + } + inline pkgXmlNode* Selection( int mode = to_install ) + { + /* Retrieve the package selection for a specified action. + */ + return selection[ mode ]; + } /* Method specifying where downloaded packages are stored. |
|
From: Keith M. <kei...@us...> - 2010-01-26 21:07:25
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24122 Modified Files: ChangeLog Makefile.in Log Message: Implement rudimentary dependency resolver. Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.in 22 Jan 2010 17:11:47 -0000 1.7 --- Makefile.in 26 Jan 2010 21:07:16 -0000 1.8 *************** *** 52,56 **** pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \ pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ ! sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) \ mkpath.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ --- 52,56 ---- pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \ pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ ! sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) pkgdeps.$(OBJEXT) \ mkpath.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ *************** *** 83,86 **** --- 83,87 ---- pkgbind.$(OBJEXT): pkgbase.h pkgkeys.h tinyxml.h tinystr.h dmh.h pkgexec.$(OBJEXT): pkgbase.h pkgkeys.h pkgtask.h tinyxml.h tinystr.h mkpath.h dmh.h + pkgdeps.$(OBJEXT): pkgbase.h pkgkeys.h pkginfo.h pkgtask.h tinyxml.h tinystr.h dmh.h pkgspec.$(OBJEXT): pkgbase.h pkgkeys.h pkginfo.h tinyxml.h tinystr.h vercmp.h pkginet.$(OBJEXT): pkgbase.h pkgkeys.h pkgtask.h pkgstrm.h mkpath.h dmh.h Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ChangeLog 23 Jan 2010 17:01:48 -0000 1.19 --- ChangeLog 26 Jan 2010 21:07:13 -0000 1.20 *************** *** 1,2 **** --- 1,34 ---- + 2010-01-26 Keith Marshall <kei...@us...> + + Implement rudimentary dependency resolver. + + * src/pkgdeps.cpp: New file. + + * Makefile.in (CORE_DLL_OBJECTS): Add pkgdeps.$(OBJEXT) reference; + establish header file dependencies. + + * src/pkgbase.h (to_remove, to_install, selection_types): New enum. + (pkgActionItem::selection): Extend it to store as enumerated pair... + (pkgActionItem::SelectPackage): New inline method; assign them. + (pkgActionItem::Selection): New inline method; retrieve them. + (pkgXmlNode::GetInstallationRecord): New method; declare it. + + * src/pkgexec.cpp (pkgActionItem): In constructor... + (selection): ...initialise both references in enumerated pair. + (pkgActionItem::GetReference): Use `Selection()' method. + (pkgActionItem::SelectIfMostRecent): Ditto; also correct logic for + making selection, and assign to `to_install' element. + (pkgXmlDocument::Schedule): Don't update `request'. + (pkgActionItem::Execute): Implement as stub. + + * src/pkginet.cpp (pkgActionItem::DownloadArchiveFiles): Use new + `Selection()' method. + + * src/pkgkeys.h (yes_value, no_value): Declare new string constants. + * src/pkgkeys.c (yes_value, no_value): Implement them. + + * src/vercmp.cpp: Update copyright notice. + (pkgVersionInfo::operator<=): Bug fix; must test for `<', but had `>'. + 2010-01-23 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-01-23 17:02:05
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5943/src Modified Files: pkginet.cpp pkgstrm.cpp pkgstrm.h Log Message: Avoid segmentation faults when processing invalid data streams. Index: pkgstrm.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgstrm.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgstrm.cpp 23 Nov 2009 20:44:25 -0000 1.1 --- pkgstrm.cpp 23 Jan 2010 17:01:53 -0000 1.2 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 242,247 **** * initialised state... */ ! lzma_stream_initialise( &stream ); ! status = lzma_alone_decoder( &stream, memlimit() ); } --- 242,250 ---- * initialised state... */ ! if( fd != -1 ) ! { ! lzma_stream_initialise( &stream ); ! status = lzma_alone_decoder( &stream, memlimit() ); ! } } *************** *** 256,261 **** * Should we handle it any more explicitly? */ ! lzma_end( &stream ); ! close( fd ); } --- 259,267 ---- * Should we handle it any more explicitly? */ ! if( fd != -1 ) ! { ! lzma_end( &stream ); ! close( fd ); ! } } *************** *** 264,268 **** /* Read an lzma compressed data stream; store up to "max" bytes of * decompressed data into "buf". ! * * Start by directing the decoder to use "buf", initially marking it * as "empty". --- 270,282 ---- /* Read an lzma compressed data stream; store up to "max" bytes of * decompressed data into "buf". ! */ ! if( fd == -1 ) ! /* ! * We cannot read from a stream with an invalid descriptor; ! * in this circumstance, just say "nothing was read"... ! */ ! return fd; ! ! /* Otherwise the stream is ready to read... * Start by directing the decoder to use "buf", initially marking it * as "empty". *************** *** 345,350 **** * that there is no trailing garbage remaining from the input stream. */ ! lzma_end( &stream ); ! close( fd ); } --- 359,367 ---- * that there is no trailing garbage remaining from the input stream. */ ! if( fd != -1 ) ! { ! lzma_end( &stream ); ! close( fd ); ! } } *************** *** 353,357 **** /* Read an xz compressed data stream; store up to "max" bytes of * decompressed data into "buf". ! * * Start by directing the decoder to use "buf", initially marking it * as "empty". --- 370,382 ---- /* Read an xz compressed data stream; store up to "max" bytes of * decompressed data into "buf". ! */ ! if( fd == -1 ) ! /* ! * We cannot read from a stream with an invalid descriptor; ! * in this circumstance, just say "nothing was read"... ! */ ! return fd; ! ! /* Otherwise the stream is ready to read... * Start by directing the decoder to use "buf", initially marking it * as "empty". Index: pkgstrm.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgstrm.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkgstrm.h 23 Jan 2010 15:20:06 -0000 1.2 --- pkgstrm.h 23 Jan 2010 17:01:53 -0000 1.3 *************** *** 6,10 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 6,10 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 37,40 **** --- 37,41 ---- public: pkgArchiveStream(){} + virtual bool IsReady() = 0; virtual int Read( char*, size_t ) = 0; virtual ~pkgArchiveStream(){} *************** *** 64,67 **** --- 65,69 ---- virtual ~pkgRawArchiveStream(); + inline bool IsReady(){ return fd != -1; } virtual int Read( char*, size_t ); }; *************** *** 85,88 **** --- 87,91 ---- virtual ~pkgGzipArchiveStream(); + inline bool IsReady(){ return stream != NULL; } virtual int Read( char*, size_t ); }; *************** *** 101,104 **** --- 104,108 ---- virtual ~pkgBzipArchiveStream(); + inline bool IsReady(){ return stream != NULL; } virtual int Read( char*, size_t ); }; *************** *** 119,122 **** --- 123,127 ---- virtual ~pkgLzmaArchiveStream(); + inline bool IsReady(){ return fd != -1; } virtual int Read( char*, size_t ); }; *************** *** 138,141 **** --- 143,147 ---- virtual ~pkgXzArchiveStream(); + inline bool IsReady(){ return fd != -1; } virtual int Read( char*, size_t ); }; Index: pkginet.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkginet.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pkginet.cpp 16 Jan 2010 20:49:57 -0000 1.3 --- pkginet.cpp 23 Jan 2010 17:01:53 -0000 1.4 *************** *** 375,379 **** ( const char *local_name, const char *dest_specification ): pkgInternetStreamingAgent( local_name, dest_specification ), ! pkgLzmaArchiveStream( -1 ){} int pkgInternetLzmaStreamingAgent::GetRawData( int fd, uint8_t *buf, size_t max ) --- 375,389 ---- ( const char *local_name, const char *dest_specification ): pkgInternetStreamingAgent( local_name, dest_specification ), ! /* ! * Note that, when we come to initialise the lzma streaming component ! * of this derived class, we will be streaming directly from the internet, ! * rather than from a file stream, so we don't require a file descriptor ! * for the input stream; however, the class semantics still expect one. ! * To avoid accidental association with an existing file stream, we ! * use a negative value, (which is never a valid file descriptor); ! * however, we must not choose -1, since the class implementation ! * will decline to process the stream; hence, we choose -2. ! */ ! pkgLzmaArchiveStream( -2 ){} int pkgInternetLzmaStreamingAgent::GetRawData( int fd, uint8_t *buf, size_t max ) |
|
From: Keith M. <kei...@us...> - 2010-01-23 17:02:03
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5943 Modified Files: ChangeLog Log Message: Avoid segmentation faults when processing invalid data streams. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ChangeLog 23 Jan 2010 15:20:06 -0000 1.18 --- ChangeLog 23 Jan 2010 17:01:48 -0000 1.19 *************** *** 1,4 **** --- 1,24 ---- 2010-01-23 Keith Marshall <kei...@us...> + Avoid segmentation faults when processing invalid data streams. + + * src/pkgstrm.h: Update copyright notice. + (pkgArchiveStream::IsReady): New pure virtual method. + (pkgRawArchiveStream::IsReady): Provide inline implementation. + (pkgGzipArchiveStream::IsReady): Likewise. + (pkgBzipArchiveStream::IsReady): Likewise. + (pkgLzmaArchiveStream::IsReady): Likewise. + (pkgXzArchiveStream::IsReady): Likewise. + + * src/pkgstrm.cpp: Update copyright notice. + (pkgLzmaArchiveStream, pkgXzArchiveStream) [fd == -1]: Decline to + perform any form of read or decode processing. + + * src/pkginet.cpp (pkgInternetLzmaStreamingAgent): Use `fd = -2' as + pseudo-descriptor for the pkgLzmaArchiveStream derived component of + this internet data streaming class. + + 2010-01-23 Keith Marshall <kei...@us...> + Require liblzma >= liblzma-4.999.9beta_20091209-3-mingw32-dev |
|
From: Keith M. <kei...@us...> - 2010-01-23 15:20:14
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27766/src Modified Files: pkgstrm.h Log Message: Require liblzma >= liblzma-4.999.9beta_20091209-3-mingw32-dev Index: pkgstrm.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgstrm.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgstrm.h 23 Nov 2009 20:44:25 -0000 1.1 --- pkgstrm.h 23 Jan 2010 15:20:06 -0000 1.2 *************** *** 71,90 **** #include <zlib.h> #include <bzlib.h> - #ifdef __GNUC__ - /* - * lzma.h is broken w.r.t. static vs. dynamic linking; it always - * declares all functions with the dllimport attribute, making it - * impossible to link with a static liblzma.a, either by using GNU - * ld's -Bstatic option in the presence of co-existing liblzma.a - * static and liblzma.dll.a import libraries, or in the case where - * the import library is not installed. To work around this defect, - * we MUST declare LZMA_API_STATIC before we include lzma.h. This - * DOES NOT in any way interfere with GNU ld's default preference - * for dynamic linking; this will still be the effective linking - * method if the import library is present, and the -Bstatic - * option is not specified. - */ - # define LZMA_API_STATIC 1 - #endif #include <lzma.h> --- 71,74 ---- |
|
From: Keith M. <kei...@us...> - 2010-01-23 15:20:14
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27766 Modified Files: ChangeLog Log Message: Require liblzma >= liblzma-4.999.9beta_20091209-3-mingw32-dev Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ChangeLog 22 Jan 2010 21:51:53 -0000 1.17 --- ChangeLog 23 Jan 2010 15:20:06 -0000 1.18 *************** *** 1,2 **** --- 1,11 ---- + 2010-01-23 Keith Marshall <kei...@us...> + + Require liblzma >= liblzma-4.999.9beta_20091209-3-mingw32-dev + + * src/pkgstrm.h (LZMA_API_STATIC): Remove definition and associated + comment; it was required to permit, (but not to enforce), linking to + the static liblzma.a library, with earlier beta releases, but this + anomaly has now been corrected. + 2010-01-22 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-01-22 21:52:43
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19027 Modified Files: ChangeLog Log Message: Remove zlib sources from trunk. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ChangeLog 22 Jan 2010 17:33:05 -0000 1.16 --- ChangeLog 22 Jan 2010 21:51:53 -0000 1.17 *************** *** 1,4 **** --- 1,10 ---- 2010-01-22 Keith Marshall <kei...@us...> + Remove zlib sources from trunk. + (Application builders should use free standing implementation of + zlib, from MinGW's package distribution page on SourceForge). + + 2010-01-22 Keith Marshall <kei...@us...> + Remove bzip2 sources from trunk. (Application builders should use free standing implementation of |
|
From: Keith M. <kei...@us...> - 2010-01-22 21:52:22
|
Update of /cvsroot/mingw/mingw-get/zlib/contrib/minizip In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19027/zlib/contrib/minizip Removed Files: crypt.h ioapi.c ioapi.h unzip.c unzip.h Log Message: Remove zlib sources from trunk. --- unzip.c DELETED --- --- ioapi.h DELETED --- --- ioapi.c DELETED --- --- unzip.h DELETED --- --- crypt.h DELETED --- |
|
From: Keith M. <kei...@us...> - 2010-01-22 21:52:21
|
Update of /cvsroot/mingw/mingw-get/zlib/contrib In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19027/zlib/contrib Removed Files: README.contrib Log Message: Remove zlib sources from trunk. --- README.contrib DELETED --- |
|
From: Keith M. <kei...@us...> - 2010-01-22 21:52:12
|
Update of /cvsroot/mingw/mingw-get/zlib In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19027/zlib Removed Files: MODIFIED_ZLIB.txt adler32.c crc32.c crc32.h deflate.c deflate.h gzio.c infback.c inffast.c inffast.h inffixed.h inflate.c inflate.h inftrees.c inftrees.h trees.c trees.h zconf.h zlib.h zutil.c zutil.h Log Message: Remove zlib sources from trunk. --- inffast.h DELETED --- --- inflate.c DELETED --- --- trees.h DELETED --- --- inffixed.h DELETED --- --- inftrees.h DELETED --- --- zlib.h DELETED --- --- zconf.h DELETED --- --- inflate.h DELETED --- --- inffast.c DELETED --- --- inftrees.c DELETED --- --- gzio.c DELETED --- --- MODIFIED_ZLIB.txt DELETED --- --- zutil.h DELETED --- --- infback.c DELETED --- --- deflate.c DELETED --- --- trees.c DELETED --- --- zutil.c DELETED --- --- crc32.h DELETED --- --- crc32.c DELETED --- --- deflate.h DELETED --- --- adler32.c DELETED --- |
|
From: Keith M. <kei...@us...> - 2010-01-22 17:33:15
|
Update of /cvsroot/mingw/mingw-get/bzip2 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8233/bzip2 Removed Files: LICENSE MODIFIED_BZIP2.txt README bzlib.c bzlib.h bzlib_private.h crctable.c decompress.c huffman.c randtable.c Log Message: Remove bzip2 sources from trunk. --- bzlib.c DELETED --- --- randtable.c DELETED --- --- LICENSE DELETED --- --- bzlib.h DELETED --- --- decompress.c DELETED --- --- MODIFIED_BZIP2.txt DELETED --- --- bzlib_private.h DELETED --- --- crctable.c DELETED --- --- huffman.c DELETED --- --- README DELETED --- |
|
From: Keith M. <kei...@us...> - 2010-01-22 17:33:13
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8233 Modified Files: ChangeLog Log Message: Remove bzip2 sources from trunk. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ChangeLog 22 Jan 2010 17:11:47 -0000 1.15 --- ChangeLog 22 Jan 2010 17:33:05 -0000 1.16 *************** *** 1,4 **** --- 1,10 ---- 2010-01-22 Keith Marshall <kei...@us...> + Remove bzip2 sources from trunk. + (Application builders should use free standing implementation of + bzip2, from MinGW's package distribution page on SourceForge). + + 2010-01-22 Keith Marshall <kei...@us...> + Add subsystem specific sysroot mapping facility. |
|
From: Keith M. <kei...@us...> - 2010-01-22 17:11:59
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3360 Modified Files: ChangeLog Makefile.in Log Message: Add subsystem specific sysroot mapping facility. Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.in 16 Jan 2010 20:49:43 -0000 1.6 --- Makefile.in 22 Jan 2010 17:11:47 -0000 1.7 *************** *** 27,33 **** VPATH = ${srcdir}/src ${srcdir}/src/pkginfo ${srcdir}/tinyxml CC = @CC@ CFLAGS = @CFLAGS@ ! CPPFLAGS = @CPPFLAGS@ $(INCLUDES) CXX = @CXX@ --- 27,35 ---- VPATH = ${srcdir}/src ${srcdir}/src/pkginfo ${srcdir}/tinyxml + DEBUGLEVEL = 0 + CC = @CC@ CFLAGS = @CFLAGS@ ! CPPFLAGS = @CPPFLAGS@ -D DEBUGLEVEL=$(DEBUGLEVEL) $(INCLUDES) CXX = @CXX@ *************** *** 50,54 **** pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \ pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ ! pkgkeys.$(OBJEXT) \ mkpath.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ --- 52,56 ---- pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \ pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ ! sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) \ mkpath.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ *************** *** 75,78 **** --- 77,81 ---- dmh.$(OBJEXT): dmh.h climain.$(OBJEXT): pkgbase.h pkgtask.h tinyxml.h tinystr.h dmh.h + sysroot.$(OBJEXT): pkgbase.h pkgkeys.h tinyxml.h tinystr.h mkpath.h dmh.h pkgname.$(OBJEXT): pkgbase.h pkgkeys.h dmh.h Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ChangeLog 16 Jan 2010 20:49:22 -0000 1.14 --- ChangeLog 22 Jan 2010 17:11:47 -0000 1.15 *************** *** 1,2 **** --- 1,26 ---- + 2010-01-22 Keith Marshall <kei...@us...> + + Add subsystem specific sysroot mapping facility. + + * src/pkghash.c: New file; required by... + * src/sysroot.cpp: New file; it implements... + (pkgXmlDocument::LoadSystemMap, pkgXmlNode::GetSysRoot): New methods. + + * src/pkgbase.h: Update copyright notice. + (pkgXmlDocument::LoadSystemMap): Declare it. + (pkgXmlDocument::AddDeclaration): New inline method. + (pkgXmlDocument::SetRoot, pkgXmlDocument::Save): Likewise. + (pkgXmlNode::GetSysRoot): Declare it. + (pkgXmlNode::GetDocumentRoot): New inline method. + (pkgXmlNode::AddChild, pkgXmlNode::DeleteChild): Likewise. + + * src/climain.cpp: Update copyright notice. + (climain): Invoke pkgXmlDocument::LoadSystemMap() as required. + + * Makefile.in (CORE_DLL_OBJECTS): Add ... + (pkghash.$(OBJEXT), sysroot.$(OBJEXT)): ...these; upate dependencies. + (DEBUGLEVEL): New macro; define it. + (CPPFLAGS): Use it. + 2010-01-16 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-01-22 17:11:56
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3360/src Modified Files: climain.cpp pkgbase.h Added Files: pkghash.c sysroot.cpp Log Message: Add subsystem specific sysroot mapping facility. --- NEW FILE: pkghash.c --- /* * pkghash.c * * $Id: pkghash.c,v 1.1 2010/01/22 17:11:48 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2009, 2010, MinGW Project * * * Hashing functions, used to generate CRC hashes from path names, * and to derive signature file names from hashed path names. * * * This is free software. Permission is granted to copy, modify and * redistribute this software, under the provisions of the GNU General * Public License, Version 3, (or, at your option, any later version), * as published by the Free Software Foundation; see the file COPYING * for licensing details. * * Note, in particular, that this software is provided "as is", in the * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY * PARTICULAR PURPOSE. Under no circumstances will the author, or the * MinGW Project, accept liability for any damages, however caused, * arising from the use of this software. * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #if defined( __MS_DOS__ ) || defined( _WIN32 ) || defined( __CYGWIN__ ) # include <ctype.h> /* * When generating path name hashes for Microsoft file systems, we want * the same result irrespective of case distinctions in the input name, * or of choice of `/' or `\' as the directory name separator; thus we * use this input mapping function which passes each input character to * the hashing algorithm as its lower case equivalent, and `\' as if it * had been specified as `/'. */ static __inline__ __attribute__((__always_inline__)) unsigned long input_as_ulong( const char value ) { if( value == '\\' ) return (unsigned long)('/'); return (unsigned long)(tolower(value)); } #else /* * Alternatively, for non-Microsoft file systems, we simply cast each * input character to its literal unsigned long equivalent value. */ # define input_as_ulong( value ) (unsigned long)(value) #endif static __inline__ unsigned long generic_crc_update ( unsigned bits, unsigned long poly, unsigned long input, unsigned long hash ) { /* Helper function; it incorporates the effect of the next input byte * into the hash, as already computed from all preceding input bytes, * using the specified generator polynomial and bit length. */ int bitcount = 8; /* bits in input byte */ unsigned long mask = 1UL << (bits - 1); /* most significant bit */ /* The input byte is passed as the least significant 8-bits of the * associated unsigned long argument; we begin by aligning its most * significant bit with the most significant bit of the hash... */ input <<= bits - bitcount; while( bitcount-- > 0 ) { /* ...then for all eight input bits, from most significant to * least significant... */ if( (hash ^ input) & mask ) /* * ...a 'one' bit here indicates that appending the current * input bit to the current interim CRC residual makes that * residual modulo-2 divisible by the generator polynomial, * so align and modulo-2 subtract (i.e. XOR) it. */ hash = (hash << 1) ^ poly; else /* ...otherwise, we simply shift out the most significant bit * of the original hash value, (effectively appending a 'zero' * bit to the CRC quotient, and adjusting the residual hash), * in preparation for processing the next input bit... */ hash <<= 1; /* ...and, in either case, progress to the next input bit. */ input <<= 1; } /* Ultimately, we return the new value of the hash... * Note that we don't discard superfluous carry bits here; * the caller *must* mask the return value, to extract the * appropriate number of least significant bits from the * returned value, to obtain the specified CRC hash. */ return hash; } unsigned long generic_crc ( unsigned bits, unsigned long poly, const char *input, size_t length ) { /* Compute a CRC hash of specified bit length, using the specified * generator polynomial, for the given input byte stream buffer of * specified length. */ unsigned long hash = 0UL; /* Initial value */ while( length-- > 0 ) /* * Update the hash value, processing each byte of the input buffer * in turn, until all specified bytes have been processed. */ hash = generic_crc_update( bits, poly, input_as_ulong( *input++ ), hash ); /* Note that, for CRCs of fewer than the number of bits in an unsigned * long, the accumulated hash may include unwanted noise, (carried out), * in the more significant bits. The required hash value is to be found * in the specified number of less significant bits; mask out the noise, * and return the required hash value. */ return hash & ((1UL << bits) - 1L); } char *hashed_name( int retry, const char *tag, const char *refname ) { /* Generate a hashed name, comprising the specified 'tag' prefix, * followed by the collision retry index, the length and a pair of * distinct CRC hashes, which is representative of the specified * 'refname' string. The result is returned in a buffer allocated * dynamically on the heap; this should be freed by the caller, * when no longer required. */ char *retname; size_t len = strlen( tag ); /* While hash collision may be improbable, it is not impossible; * to mitigate, we provide a collection of generator polynomials, * selected in pairs indexed by the 'retry' parameter, offering * eight hash possibilities for each input 'refname'. */ static unsigned long p16[] = /* 16-bit CRC generator polynomials */ { 0x1021, /* CCITT standard */ 0x8408, /* CCITT reversed */ 0x8005, /* CRC-16 standard */ 0xA001 /* CRC-16 reversed */ }; static unsigned long p24[] = /* 24-bit CRC generator polynomials */ { 0x5d6dcb, /* CRC-24 (FlexRay) */ 0x864cfb /* CRC-24 (OpenPGP) */ }; if( (retname = malloc( 19 + len )) != NULL ) { /* Return buffer successfully allocated; populate it... */ retry &= 7; len = strlen( refname ); sprintf( retname, "%s-%u-%03u-%04x-%06x", tag, retry, len, (unsigned)(generic_crc( 16, p16[retry>>1], refname, len )), /* 16-bit CRC */ (unsigned)(generic_crc( 24, p24[retry&1], refname, len )) /* 24-bit CRC */ ); } /* Return value is either a pointer to the populated buffer, * or NULL on allocation failure. */ return retname; } /* $RCSfile: pkghash.c,v $: end of file */ Index: pkgbase.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgbase.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkgbase.h 17 Dec 2009 17:35:12 -0000 1.2 --- pkgbase.h 22 Jan 2010 17:11:48 -0000 1.3 *************** *** 6,10 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 6,10 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 94,100 **** --- 94,122 ---- return retval ? retval : subst; } + inline pkgXmlNode* AddChild( TiXmlNode *child ) + { + /* This is wxXmlNode's method for adding a child node, it is + * equivalent to tinyxml's LinkEndChild() method. + */ + return (pkgXmlNode*)(LinkEndChild( child )); + } + inline bool DeleteChild( pkgXmlNode *child ) + { + /* Both TiXmlNode and wxXmlNode have RemoveChild methods, but the + * implementations are semantically different; for tinyxml, we may + * simply use the RemoveChild method here, where for wxXmlNode, we + * would use RemoveChild followed by `delete child'. + */ + return RemoveChild( child ); + } /* Additional methods specific to the application. */ + inline pkgXmlNode *GetDocumentRoot() + { + /* Convenience method to retrieve a pointer to the document root. + */ + return (pkgXmlNode*)(GetDocument()->RootElement()); + } inline bool IsElementOfType( const char* tagname ) { *************** *** 105,108 **** --- 127,135 ---- } + /* Method for retrieving the system root management records + * for a specified installed subsystem. + */ + pkgXmlNode *GetSysRoot( const char *subsystem ); + /* The following pair of methods provide an iterator * for enumerating the contained nodes, within the owner, *************** *** 220,223 **** --- 247,277 ---- return (pkgXmlNode *)(RootElement()); } + inline void AddDeclaration + ( const char *version, const char *encoding, const char *standalone ) + { + /* Not a standard method of either wxXmlDocumemnt or TiXmlDocument; + * this is a convenience method for setting up a new XML database. + */ + TiXmlDeclaration decl( version, encoding, standalone ); + LinkEndChild( &decl ); + } + inline void SetRoot( TiXmlNode* root ) + { + /* tinyxml has no direct equivalent for this wxXmlDocument method; + * to emulate it, we must first explicitly delete an existing root + * node, if any, then link the new root node as a document child. + */ + pkgXmlNode *oldroot; + if( (oldroot = GetRoot()) != NULL ) + delete oldroot; + LinkEndChild( root ); + } + inline bool Save( const char *filename ) + { + /* This wxXmlDocument method for saving the database is equivalent + * to the corresponding tinyxml SaveFile( const char* ) method. + */ + return SaveFile( filename ); + } private: *************** *** 238,241 **** --- 292,300 ---- pkgXmlNode* BindRepositories( bool ); + /* Method to load the system map, and the lists of installed + * packages associated with each specified sysroot. + */ + void LoadSystemMap(); + /* Method to locate the XML database entry for a named package. */ --- NEW FILE: sysroot.cpp --- /* * sysroot.cpp * * $Id: sysroot.cpp,v 1.1 2010/01/22 17:11:48 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2010, MinGW Project * * * Implementation of the system map loader, sysroot management and * installation tracking functions. * * * This is free software. Permission is granted to copy, modify and * redistribute this software, under the provisions of the GNU General * Public License, Version 3, (or, at your option, any later version), * as published by the Free Software Foundation; see the file COPYING * for licensing details. * * Note, in particular, that this software is provided "as is", in the * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY * PARTICULAR PURPOSE. Under no circumstances will the author, or the * MinGW Project, accept liability for any damages, however caused, * arising from the use of this software. * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #ifdef _MAX_PATH /* * Work around a PATH_MAX declaration anomaly in MinGW. */ # undef PATH_MAX # define PATH_MAX _MAX_PATH #endif #include "dmh.h" #include "mkpath.h" #include "pkgbase.h" #include "pkgkeys.h" EXTERN_C char *hashed_name( int, const char*, const char* ); static bool samepath( const char *tstpath, const char *refpath ) { /* Helper to determine equivalence of two path name references. * * We begin by checking that both of the path name references are * actually defined, with non-NULL values. */ if( (tstpath == NULL) || (refpath == NULL) ) /* * If either path is undefined, then they are equivalent only * if both are undefined. */ return (tstpath == refpath); /* Convert both input path name strings to canonical forms, * before comparing them for equivalence. */ char canonical_tstpath[PATH_MAX], canonical_refpath[PATH_MAX]; if( (_fullpath( canonical_tstpath, tstpath, PATH_MAX) != NULL) && (_fullpath( canonical_refpath, refpath, PATH_MAX) != NULL) ) { /* We successfully obtained canonical forms for both paths * which are to be compared; we return the result of a case * insensitive comparison; (note that it is not necessary to * consider '/' vs. '\' directory name separator distinctions * here, because all such separators are normalised to '\' in * the canonical forms of the path names). */ return stricmp( canonical_tstpath, canonical_refpath ) == 0; } /* If we get to here, then we failed to get the canonical forms * for both input path name strings; fall back to a less reliable * comparison of the non-canonical forms, ignoring case and any * distinction between '/' and '\' as directory separators... */ while( *tstpath && *refpath ) { /* Hence, comparing character by character, while we have not * reached the terminating '\0' on at least one path name string... */ if( ((*tstpath == '/') || (*tstpath == '\\')) && ((*refpath == '/') || (*refpath == '\\')) ) { /* Here we simply step over a matched directory separator, * regardless of '/' vs. '\' distinction. */ ++tstpath; ++refpath; } else if( tolower( *tstpath++ ) != tolower( *refpath++ ) ) /* * Here we force a 'false' return, on a case-insensitive * MISMATCH between the two path name strings. */ return false; } /* Finally, if we get to here, we found the '\0' terminator * for at least one of the non-canonical path name strings; * for equivalence, we must have reached it for both. */ return (*tstpath == *refpath); } void pkgXmlDocument::LoadSystemMap() { /* Load an initial, or a replacement, system map into the * internal XML database image space. */ pkgXmlNode *dbase = GetRoot(); pkgXmlNode *sysmap = dbase->FindFirstAssociate( sysmap_key ); pkgXmlNode *sysroot = dbase->FindFirstAssociate( sysroot_key ); /* First, we clear out any pre-existing sysroot mappings, * which may have been inherited from a previous system map... */ while( sysroot != NULL ) { /* This has the side effect of leaving the sysroot pointer * initialised, as required, to NULL, while also locating and * deleting the pre-existing database entries. */ pkgXmlNode *to_clear = sysroot; sysroot = sysroot->FindNextAssociate( sysroot_key ); dbase->DeleteChild( to_clear ); } /* Next, we identify the system map to be loaded, by inspection * of the profile entries already loaded into the XML database. */ while( sysmap != NULL ) { /* Consider all specified system maps... * Any which are not selected for loading are to be purged * from the internal XML database image. */ pkgXmlNode *to_clear = sysmap; /* Only the first system map which matches the specified selection * `id' criterion, and which registers at least one sysroot for which * the installation is to be managed, can be loaded... */ if( sysroot == NULL ) { /* We have not yet registered any sysroot for a managed installation; * this implies that no system map has yet been selected for loading, * so check if the current one matches the selection criterion... */ const char *id = sysmap->GetPropVal( id_key, "<default>" ); if( match_if_explicit( id, NULL ) ) { /* This system map is a candidate for loading; * process all of its subsystem specific sysroot declarations... */ #if DEBUGLEVEL fprintf( stderr, "Load system map: id = %s\n", id ); #endif pkgXmlNode *subsystem = sysmap->FindFirstAssociate( sysroot_key ); while( subsystem != NULL ) { /* ...to identify all unique sysroot path specifications, * (ignoring any for which no path has been specified). */ const char *path; if( (path = subsystem->GetPropVal( pathname_key, NULL )) != NULL ) { /* This subsystem has a valid sysroot path specification; * check for a prior registration, (i.e. of a common sysroot * which is shared by a preceding subsystem declaration). */ sysroot = dbase->FindFirstAssociate( sysroot_key ); while( (sysroot != NULL) && ! samepath( path, sysroot->GetPropVal( pathname_key, NULL )) ) sysroot = sysroot->FindNextAssociate( sysroot_key ); #if DEBUGLEVEL fprintf( stderr, "Bind subsystem %s: sysroot = %s\n", subsystem->GetPropVal( subsystem_key, "<unknown>" ), path ); #endif if( sysroot == NULL ) { /* This sysroot has not yet been registered... */ int retry = 0; const char *sigpath = "%R" "var/lib/mingw-get/data/%F.xml"; while( retry < 16 ) { /* Generate a hashed signature for the sysroot installation * record, and derive an associated database file path name * from it. Note that this hash is returned in 'malloc'ed * memory, which we must later free. Also note that there * are eight possible hashes, to mitigate hash collision, * each of which is denoted by retry modulo eight; we make * an initial pass through the possible hashes, looking for * an existing installation map for this sysroot, loading * it immediately if we find it. Otherwise, we continue * with a second cycle, (retry = 8..15), looking for the * first generated hash with no associated file; we then * use this to create a new installation record file. */ char *sig = hashed_name( retry++, sysroot_key, path ); char sigfile[mkpath( NULL, sigpath, sig, NULL )]; mkpath( sigfile, sigpath, sig, NULL ); /* Check for an existing sysroot file associated with the * current hash value... */ pkgXmlDocument check( sigfile ); if( check.IsOk() ) { /* ...such a file does exist, but we must still check * that it relates to the path for the desired sysroot... */ if( retry < 9 ) { /* ...however, we only perform this check during the * first pass through the possible hashes; (second time * through, we are only interested in a hash which does * not have an associated file; note that the first pass * through is for retry = 0..7, but by the time we get * to here we have already incremented 7 to become 8, * hence the check for retry < 9). */ pkgXmlNode *root; if( ((root = check.GetRoot()) != NULL) && samepath( root->GetPropVal( pathname_key, NULL ), path ) ) { /* This is the sysroot record we require... * Copy its root element into the internal database, * and force an early exit from the retry loop. */ dbase->AddChild( root->Clone() ); retry = 16; } } } /* Once more noting the prior increment of retry, such * that it has now become 8 for the hash generation with * retry = 7... */ else if( retry > 8 ) { /* ...we have exhausted all possible hash references, * finding no existing mapping database for this sysroot... * The current hashed file name has not yet been assigned, * so initialise it as a new database for this sysroot. * * FIXME: perhaps we should not do this arbitrarily for * any non-default system root. */ check.AddDeclaration( "1.0", "UTF-8", "yes" ); /* Initialise the root element for this new database. */ pkgXmlNode root( sysroot_key ); root.SetAttribute( id_key, sig ); root.SetAttribute( pathname_key, path ); check.SetRoot( &root ); /* Link a copy of it as the corresponding sysroot * entry in the internal database. */ dbase->AddChild( root.Clone() ); /* Commit the initial state of this sysroot database * to a disk file, for future reference, and terminate * the retry loop at the end of this cycle. */ check.Save( sigfile ); retry = 16; } /* Before abandoning our reference to the current hash * signature, free the memory allocated for it. */ free( (void *)(sig) ); } } } /* Repeat, to map the sysroots for any additional subsystems * which may be specified. */ subsystem = subsystem->FindNextAssociate( sysroot_key ); } /* Cancel the 'clear' request for the system map we just loaded. */ to_clear = NULL; } } /* Select the next system map declaration, if any, to be processed; * note that we must do this BEFORE we clear the current map, (if it * was unused), since the clear action would destroy the contained * reference for the next system map element. */ sysmap = sysmap->FindNextAssociate( sysmap_key ); /* Finally, if the current system map was not loaded... */ if( to_clear != NULL ) /* * ...then we delete its declaration from the active data space. */ dbase->DeleteChild( to_clear ); } } pkgXmlNode* pkgXmlNode::GetSysRoot( const char *subsystem ) { /* Retrieve the installation records for the system root associated * with the specified software subsystem. * * Note that, by the time this is called, there should be exactly * one system map entry remaining in the internal XML database, so * we need only find the first such entry. */ pkgXmlNode *dbase, *sysmap; if( ((dbase = GetDocumentRoot()) != NULL) && ((sysmap = dbase->FindFirstAssociate( sysmap_key )) != NULL) ) { /* We've located the system map; walk its list of sysroot entries... */ pkgXmlNode *sysroot = sysmap->FindFirstAssociate( sysroot_key ); while( sysroot != NULL ) { /* ...until we find one for the subsystem of interest... */ if( match_if_explicit( subsystem, sysroot->GetPropVal( subsystem_key, NULL )) ) { /* ...from which we retrieve the sysroot path specification... */ const char *sysroot_path; if( (sysroot_path = sysroot->GetPropVal( pathname_key, NULL )) != NULL ) { /* ...which we then use as an identifying reference... */ pkgXmlNode *lookup = dbase->FindFirstAssociate( sysroot_key ); while( lookup != NULL ) { /* ...to select and return the associated sysroot record * (if any) at the top level in the internal XML database. */ if( samepath( sysroot_path, lookup->GetPropVal( pathname_key, NULL )) ) return lookup; /* We haven't found the required sysroot record yet... * move on to the next available. */ lookup = lookup->FindNextAssociate( sysroot_key ); } } } /* We are still looking for a matching sysroot entry in the * system map; move on to the next candidate. */ sysroot = sysroot->FindNextAssociate( sysroot_key ); } } /* If we get to here, we didn't find any appropriate system root * record; return NULL to signal this. */ return NULL; } /* $RCSfile: sysroot.cpp,v $: end of file */ Index: climain.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/climain.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** climain.cpp 17 Dec 2009 17:35:11 -0000 1.3 --- climain.cpp 22 Jan 2010 17:11:48 -0000 1.4 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 82,86 **** dmh_notify( DMH_FATAL, "%s: invalid application profile\n", dbase.Value() ); - #if 0 /* If the requested action was "update", then we've already done it, * as a side effect of binding the cached repository catalogues... --- 82,85 ---- *************** *** 88,107 **** if( action != ACTION_UPDATE ) { ! /* ...otherwise, we still need to schedule and execute the action request... ! * ! * so, schedule the specified action for each additionally specified command ! * line argument, (each of which is assumed to represent a package name)... */ while( --argc ) dbase.Schedule( (unsigned long)(action), *++argv ); ! /* ...and finally, execute all scheduled actions... */ dbase.ExecuteActions(); - } #endif /* If we get this far, then all actions completed successfully; ! * we are done... */ return EXIT_SUCCESS; --- 87,109 ---- if( action != ACTION_UPDATE ) { ! /* ...otherwise, we need to load the system map... ! */ ! dbase.LoadSystemMap(); ! ! #if 0 ! /* ...schedule the specified action for each additional command line ! * argument, (each of which is assumed to represent a package name)... */ while( --argc ) dbase.Schedule( (unsigned long)(action), *++argv ); ! /* ...and finally, execute all scheduled actions. */ dbase.ExecuteActions(); #endif + } /* If we get this far, then all actions completed successfully; ! * we are done. */ return EXIT_SUCCESS; |
|
From: Keith M. <kei...@us...> - 2010-01-16 20:50:28
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23599 Modified Files: ChangeLog Makefile.in Log Message: Assign standardised keys for XML database lookup. Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.in 8 Jan 2010 17:44:16 -0000 1.5 --- Makefile.in 16 Jan 2010 20:49:43 -0000 1.6 *************** *** 50,53 **** --- 50,54 ---- pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \ pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ + pkgkeys.$(OBJEXT) \ mkpath.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ *************** *** 75,84 **** climain.$(OBJEXT): pkgbase.h pkgtask.h tinyxml.h tinystr.h dmh.h ! pkgname.$(OBJEXT): pkgbase.h dmh.h ! pkgfind.$(OBJEXT): pkgbase.h tinyxml.h tinystr.h ! pkgbind.$(OBJEXT): pkgbase.h tinyxml.h tinystr.h dmh.h ! pkgexec.$(OBJEXT): pkgbase.h pkgtask.h tinyxml.h tinystr.h mkpath.h dmh.h ! pkgspec.$(OBJEXT): pkgbase.h pkginfo.h tinyxml.h tinystr.h vercmp.h ! pkginet.$(OBJEXT): pkgbase.h pkgtask.h pkgstrm.h mkpath.h dmh.h pkgstrm.$(OBJEXT): pkgstrm.h --- 76,85 ---- climain.$(OBJEXT): pkgbase.h pkgtask.h tinyxml.h tinystr.h dmh.h ! pkgname.$(OBJEXT): pkgbase.h pkgkeys.h dmh.h ! pkgfind.$(OBJEXT): pkgbase.h pkgkeys.h tinyxml.h tinystr.h ! pkgbind.$(OBJEXT): pkgbase.h pkgkeys.h tinyxml.h tinystr.h dmh.h ! pkgexec.$(OBJEXT): pkgbase.h pkgkeys.h pkgtask.h tinyxml.h tinystr.h mkpath.h dmh.h ! pkgspec.$(OBJEXT): pkgbase.h pkgkeys.h pkginfo.h tinyxml.h tinystr.h vercmp.h ! pkginet.$(OBJEXT): pkgbase.h pkgkeys.h pkgtask.h pkgstrm.h mkpath.h dmh.h pkgstrm.$(OBJEXT): pkgstrm.h Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ChangeLog 8 Jan 2010 17:44:09 -0000 1.13 --- ChangeLog 16 Jan 2010 20:49:22 -0000 1.14 *************** *** 1,2 **** --- 1,16 ---- + 2010-01-16 Keith Marshall <kei...@us...> + + Assign standardised keys for XML database lookup. + + * src/pkgkeys.h: New file; provide public key declarations. + * src/pkgkeys.c: New file; implement them. + + * src/pkgbind.cpp: Use them; update copyright notice. + * src/pkgexec.cpp, src/pkgfind.cpp, src/pkginet.cpp: Likewise. + * src/pkgname.cpp, src/pkgspec.cpp: Likewise. + + * Makfile.in (CORE_DLL_OBJECTS): Add pkgkeys.$(OBJEXT); update all + dependencies accordingly. + 2010-01-08 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-01-16 20:50:05
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23599/src Modified Files: pkgbind.cpp pkgexec.cpp pkgfind.cpp pkginet.cpp pkgname.cpp pkgspec.cpp Added Files: pkgkeys.c pkgkeys.h Log Message: Assign standardised keys for XML database lookup. --- NEW FILE: pkgkeys.h --- #ifndef PKGKEYS_H /* * pkgkeys.c * * $Id: pkgkeys.h,v 1.1 2010/01/16 20:49:57 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2010, MinGW Project * * * Public declarations of the global definitions for the string * constants which are used as keys in the XML database. * * * This is free software. Permission is granted to copy, modify and * redistribute this software, under the provisions of the GNU General * Public License, Version 3, (or, at your option, any later version), * as published by the Free Software Foundation; see the file COPYING * for licensing details. * * Note, in particular, that this software is provided "as is", in the * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY * PARTICULAR PURPOSE. Under no circumstances will the author, or the * MinGW Project, accept liability for any damages, however caused, * arising from the use of this software. * */ #define PKGKEYS_H 1 #ifndef EXTERN_C_DECL # ifdef __cplusplus # define EXTERN_C_DECL extern "C" # else # define EXTERN_C_DECL extern # endif #endif EXTERN_C_DECL const char *alias_key; EXTERN_C_DECL const char *application_key; EXTERN_C_DECL const char *catalogue_key; EXTERN_C_DECL const char *component_key; EXTERN_C_DECL const char *download_host_key; EXTERN_C_DECL const char *eq_key; EXTERN_C_DECL const char *ge_key; EXTERN_C_DECL const char *gt_key; EXTERN_C_DECL const char *id_key; EXTERN_C_DECL const char *installed_key; EXTERN_C_DECL const char *issue_key; EXTERN_C_DECL const char *le_key; EXTERN_C_DECL const char *lt_key; EXTERN_C_DECL const char *mirror_key; EXTERN_C_DECL const char *name_key; EXTERN_C_DECL const char *package_key; EXTERN_C_DECL const char *package_collection_key; EXTERN_C_DECL const char *package_list_key; EXTERN_C_DECL const char *pathname_key; EXTERN_C_DECL const char *profile_key; EXTERN_C_DECL const char *release_key; EXTERN_C_DECL const char *repository_key; EXTERN_C_DECL const char *requires_key; EXTERN_C_DECL const char *subsystem_key; EXTERN_C_DECL const char *sysmap_key; EXTERN_C_DECL const char *sysroot_key; EXTERN_C_DECL const char *tarname_key; EXTERN_C_DECL const char *uri_key; #endif /* PKGKEYS_H: $RCSfile: pkgkeys.h,v $: end of file */ Index: pkgbind.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgbind.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkgbind.cpp 17 Dec 2009 17:35:12 -0000 1.2 --- pkgbind.cpp 16 Jan 2010 20:49:50 -0000 1.3 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 32,35 **** --- 32,36 ---- #include "dmh.h" #include "pkgbase.h" + #include "pkgkeys.h" pkgXmlNode *pkgXmlDocument::BindRepositories( bool force_update ) *************** *** 45,55 **** * and that the associated application is "mingw-get"... */ ! if( (strcmp( dbase->GetName(), "profile" ) == 0) ! && (strcmp( dbase->GetPropVal( "application", "?" ), "mingw-get") == 0) ) { /* Sanity check passed... * Walk the XML data tree, selecting "repository" specifications... */ ! pkgXmlNode *repository = dbase->FindFirstAssociate( "repository" ); while( repository != NULL ) { --- 46,56 ---- * and that the associated application is "mingw-get"... */ ! if( (strcmp( dbase->GetName(), profile_key ) == 0) ! && (strcmp( dbase->GetPropVal( application_key, "?" ), "mingw-get") == 0) ) { /* Sanity check passed... * Walk the XML data tree, selecting "repository" specifications... */ ! pkgXmlNode *repository = dbase->FindFirstAssociate( repository_key ); while( repository != NULL ) { *************** *** 62,71 **** * URI template, and hosted by the download server itself. */ ! pkgXmlNode *catalogue = repository->FindFirstAssociate( "package-list" ); while( catalogue != NULL ) { /* ...and for each named "catalogue"... */ ! const char *dfile, *dname = catalogue->GetPropVal( "catalogue", NULL ); if( (dname != NULL) && ((dfile = xmlfile( dname )) != NULL) ) { --- 63,72 ---- * URI template, and hosted by the download server itself. */ ! pkgXmlNode *catalogue = repository->FindFirstAssociate( package_list_key ); while( catalogue != NULL ) { /* ...and for each named "catalogue"... */ ! const char *dfile, *dname = catalogue->GetPropVal( catalogue_key, NULL ); if( (dname != NULL) && ((dfile = xmlfile( dname )) != NULL) ) { *************** *** 95,99 **** * records contained within it... */ ! pkglist = pkglist->FindFirstAssociate( "package-collection" ); while( pkglist != NULL ) { --- 96,100 ---- * records contained within it... */ ! pkglist = pkglist->FindFirstAssociate( package_collection_key ); while( pkglist != NULL ) { *************** *** 105,109 **** * within the current catalogue... */ ! pkglist = pkglist->FindNextAssociate( "package-collection" ); } } --- 106,110 ---- * within the current catalogue... */ ! pkglist = pkglist->FindNextAssociate( package_collection_key ); } } *************** *** 123,127 **** * the current repository collection. */ ! catalogue = catalogue->FindNextAssociate( "package-list" ); } --- 124,128 ---- * the current repository collection. */ ! catalogue = catalogue->FindNextAssociate( package_list_key ); } *************** *** 130,134 **** * specified (if any). */ ! repository = repository->FindNextAssociate( "repository" ); } --- 131,135 ---- * specified (if any). */ ! repository = repository->FindNextAssociate( repository_key ); } Index: pkgfind.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgfind.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgfind.cpp 23 Nov 2009 20:44:25 -0000 1.1 --- pkgfind.cpp 16 Jan 2010 20:49:57 -0000 1.2 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 29,32 **** --- 29,33 ---- #include "pkgbase.h" + #include "pkgkeys.h" static inline *************** *** 37,47 **** * a "package", having the "wanted" name; else "false". */ ! return pkg->IsElementOfType( "package" ) /* * subject to the canonical name of the package matching * the "wanted" name, or any assigned package name alias... */ ! &&( (strcmp( wanted, pkg->GetPropVal( "name", "" )) == 0) ! || (has_keyword( pkg->GetPropVal( "alias", NULL ), wanted ) != 0) ); } --- 38,48 ---- * a "package", having the "wanted" name; else "false". */ ! return pkg->IsElementOfType( package_key ) /* * subject to the canonical name of the package matching * the "wanted" name, or any assigned package name alias... */ ! &&( (strcmp( wanted, pkg->GetPropVal( name_key, "" )) == 0) ! || (has_keyword( pkg->GetPropVal( alias_key, NULL ), wanted ) != 0) ); } *************** *** 61,66 **** /* Select only "package-collection" elements... */ ! if( dir->IsElementOfType( "package-collection" ) ! && match_if_explicit( subsystem, dir->GetPropVal( "subsystem", NULL )) ) { /* ...inspect the content of each... --- 62,67 ---- /* Select only "package-collection" elements... */ ! if( dir->IsElementOfType( package_collection_key ) ! && match_if_explicit( subsystem, dir->GetPropVal( subsystem_key, NULL )) ) { /* ...inspect the content of each... --- NEW FILE: pkgkeys.c --- /* * pkgkeys.c * * $Id: pkgkeys.c,v 1.1 2010/01/16 20:49:57 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2010, MinGW Project * * * Implementation of the global definitions for the string constants * which are used as keys in the XML database. * * * This is free software. Permission is granted to copy, modify and * redistribute this software, under the provisions of the GNU General * Public License, Version 3, (or, at your option, any later version), * as published by the Free Software Foundation; see the file COPYING * for licensing details. * * Note, in particular, that this software is provided "as is", in the * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY * PARTICULAR PURPOSE. Under no circumstances will the author, or the * MinGW Project, accept liability for any damages, however caused, * arising from the use of this software. * */ const char *alias_key = "alias"; const char *application_key = "application"; const char *catalogue_key = "catalogue"; const char *component_key = "component"; const char *download_host_key = "download-host"; const char *eq_key = "eq"; const char *ge_key = "ge"; const char *gt_key = "gt"; const char *id_key = "id"; const char *installed_key = "installed"; const char *issue_key = "issue"; const char *le_key = "le"; const char *lt_key = "lt"; const char *mirror_key = "mirror"; const char *name_key = "name"; const char *package_key = "package"; const char *package_collection_key = "package-collection"; const char *package_list_key = "package-list"; const char *pathname_key = "path"; const char *profile_key = "profile"; const char *release_key = "release"; const char *repository_key = "repository"; const char *requires_key = "requires"; const char *subsystem_key = "subsystem"; const char *sysmap_key = "system-map"; const char *sysroot_key = "sysroot"; const char *tarname_key = "tarname"; const char *uri_key = "uri"; /* $RCSfile: pkgkeys.c,v $: end of file */ Index: pkgexec.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgexec.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkgexec.cpp 17 Dec 2009 17:35:12 -0000 1.2 --- pkgexec.cpp 16 Jan 2010 20:49:57 -0000 1.3 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 29,32 **** --- 29,33 ---- #include "pkgbase.h" + #include "pkgkeys.h" #include "pkginfo.h" #include "pkgtask.h" *************** *** 237,241 **** /* First check for a strict equality requirement... */ ! if( (min_wanted = req->GetPropVal( "eq", NULL )) != NULL ) /* * ...and if specified, set the selection range such that --- 238,242 ---- /* First check for a strict equality requirement... */ ! if( (min_wanted = req->GetPropVal( eq_key, NULL )) != NULL ) /* * ...and if specified, set the selection range such that *************** *** 249,254 **** * setting the minimum release selector... */ ! if( ((min_wanted = req->GetPropVal( "ge", NULL )) == NULL) ! && ((min_wanted = req->GetPropVal( "gt", NULL )) != NULL) ) /* * ...and its selection mode flag accordingly. --- 250,255 ---- * setting the minimum release selector... */ ! if( ((min_wanted = req->GetPropVal( ge_key, NULL )) == NULL) ! && ((min_wanted = req->GetPropVal( gt_key, NULL )) != NULL) ) /* * ...and its selection mode flag accordingly. *************** *** 260,265 **** * setting the maximum release selector... */ ! if( ((max_wanted = req->GetPropVal( "le", NULL )) == NULL) ! && ((max_wanted = req->GetPropVal( "lt", NULL )) != NULL) ) /* * ...and its selection mode flag accordingly. --- 261,266 ---- * setting the maximum release selector... */ ! if( ((max_wanted = req->GetPropVal( le_key, NULL )) == NULL) ! && ((max_wanted = req->GetPropVal( lt_key, NULL )) != NULL) ) /* * ...and its selection mode flag accordingly. Index: pkgname.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgname.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgname.cpp 23 Nov 2009 20:44:25 -0000 1.1 --- pkgname.cpp 16 Jan 2010 20:49:57 -0000 1.2 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 33,36 **** --- 33,37 ---- #include "dmh.h" #include "pkgbase.h" + #include "pkgkeys.h" static *************** *** 75,79 **** */ dmh_notify( DMH_WARNING, "%s: archive name reassignment ignored\n", ! rel->GetPropVal( "tarname", "<unknown>" ) ); else --- 76,80 ---- */ dmh_notify( DMH_WARNING, "%s: archive name reassignment ignored\n", ! rel->GetPropVal( tarname_key, "<unknown>" ) ); else *************** *** 91,95 **** * "tarname" specification; return a pointer to it's value. */ ! return (opt || matched) ? rel->GetPropVal( "tarname", NULL ) : NULL; } --- 92,96 ---- * "tarname" specification; return a pointer to it's value. */ ! return (opt || matched) ? rel->GetPropVal( tarname_key, NULL ) : NULL; } Index: pkginet.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkginet.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkginet.cpp 16 Dec 2009 20:09:00 -0000 1.2 --- pkginet.cpp 16 Jan 2010 20:49:57 -0000 1.3 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 37,40 **** --- 37,41 ---- #include "pkgbase.h" + #include "pkgkeys.h" #include "pkgtask.h" *************** *** 177,181 **** /* Starting from the "ref" package entry in the catalogue... */ ! pkgXmlNode *host = ref->FindFirstAssociate( "download-host" ); while( host != NULL ) { --- 178,182 ---- /* Starting from the "ref" package entry in the catalogue... */ ! pkgXmlNode *host = ref->FindFirstAssociate( download_host_key ); while( host != NULL ) { *************** *** 190,194 **** * associated with the same catalogue entry... */ ! host = host->FindNextAssociate( "download-host" ); } /* Failing an immediate match, extend the search to the --- 191,195 ---- * associated with the same catalogue entry... */ ! host = host->FindNextAssociate( download_host_key ); } /* Failing an immediate match, extend the search to the *************** *** 297,301 **** /* ...if not, ask the download agent to fetch it... */ ! const char *url_template = get_host_info( current->selection, "uri" ); if( url_template != NULL ) { --- 298,302 ---- /* ...if not, ask the download agent to fetch it... */ ! const char *url_template = get_host_info( current->selection, uri_key ); if( url_template != NULL ) { *************** *** 303,307 **** * the package repository catalogue (configuration database)... */ ! const char *mirror = get_host_info( current->selection, "mirror" ); char package_url[mkpath( NULL, url_template, package_name, mirror )]; mkpath( package_url, url_template, package_name, mirror ); --- 304,308 ---- * the package repository catalogue (configuration database)... */ ! const char *mirror = get_host_info( current->selection, mirror_key ); char package_url[mkpath( NULL, url_template, package_name, mirror )]; mkpath( package_url, url_template, package_name, mirror ); *************** *** 410,414 **** if( src.IsOk() ! && ((issue = src.GetRoot()->GetPropVal( "issue", NULL )) != NULL) ) /* * Found an issue number; return a copy... --- 411,415 ---- if( src.IsOk() ! && ((issue = src.GetRoot()->GetPropVal( issue_key, NULL )) != NULL) ) /* * Found an issue number; return a copy... *************** *** 432,436 **** */ const char *url_template; ! if( (url_template = repository->GetPropVal( "uri", NULL )) != NULL ) { /* Initialise a streaming agent, to manage the catalogue download; --- 433,437 ---- */ const char *url_template; ! if( (url_template = repository->GetPropVal( uri_key, NULL )) != NULL ) { /* Initialise a streaming agent, to manage the catalogue download; *************** *** 444,448 **** * a locally cached, decompressed copy of the XML file. */ ! const char *mirror = repository->GetPropVal( "mirror", NULL ); char catalogue_url[mkpath( NULL, url_template, name, mirror )]; mkpath( catalogue_url, url_template, name, mirror ); --- 445,449 ---- * a locally cached, decompressed copy of the XML file. */ ! const char *mirror = repository->GetPropVal( mirror_key, NULL ); char catalogue_url[mkpath( NULL, url_template, name, mirror )]; mkpath( catalogue_url, url_template, name, mirror ); Index: pkgspec.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgspec.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgspec.cpp 16 Nov 2009 21:54:30 -0000 1.1 --- pkgspec.cpp 16 Jan 2010 20:49:57 -0000 1.2 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 27,30 **** --- 27,31 ---- */ #include "pkginfo.h" + #include "pkgkeys.h" #include "vercmp.h" *************** *** 46,50 **** * then construct the "pkgSpecs" as if it were specified directly. */ ! const char *tarname = release ? release->GetPropVal( "tarname", NULL ) : NULL; content = get_pkginfo( tarname ? tarname : "", specs ); } --- 47,51 ---- * then construct the "pkgSpecs" as if it were specified directly. */ ! const char *tarname = release ? release->GetPropVal( tarname_key, NULL ) : NULL; content = get_pkginfo( tarname ? tarname : "", specs ); } |
|
From: Cesar S. <cst...@us...> - 2010-01-15 21:24:43
|
Update of /cvsroot/mingw/msys/rt/src/winsup/cygwin In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21880 Modified Files: ChangeLog.MSYS path.cc Log Message: Avoid reading a string past its end. * path.cc (msys_p2w): Check for end-of-string before "/" for an argument beginning with "-". Index: path.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/path.cc,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** path.cc 15 Jan 2010 18:45:20 -0000 1.50 --- path.cc 15 Jan 2010 21:24:33 -0000 1.51 *************** *** 3250,3259 **** // path argument attached, eg -I/include */ // ! sspath = (char *)spath; ! sspath++; ! sspath++; ! if (*sspath == '/') { debug_printf("spath = %s", spath); char *swin32_path = msys_p2w (sspath); if (swin32_path == sspath) --- 3250,3257 ---- // path argument attached, eg -I/include */ // ! if (spath[1] && spath[2] == '/') { debug_printf("spath = %s", spath); + sspath = spath + 2; char *swin32_path = msys_p2w (sspath); if (swin32_path == sspath) Index: ChangeLog.MSYS =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/ChangeLog.MSYS,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** ChangeLog.MSYS 15 Jan 2010 18:45:19 -0000 1.106 --- ChangeLog.MSYS 15 Jan 2010 21:24:29 -0000 1.107 *************** *** 1,4 **** --- 1,9 ---- 2010.01.15 Cesar Strauss <ces...@gm...> + * path.cc (msys_p2w): Check for end-of-string before "/" + for an argument beginning with "-". + + 2010.01.15 Cesar Strauss <ces...@gm...> + * path.cc (msys_p2w): Improve documentation. |
|
From: Cesar S. <cst...@us...> - 2010-01-15 18:45:29
|
Update of /cvsroot/mingw/msys/rt/src/winsup/cygwin In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28468 Modified Files: ChangeLog.MSYS path.cc Log Message: Improve documentation. * path.cc (msys_p2w): Improve documentation. Index: path.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/path.cc,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** path.cc 11 Jul 2008 01:20:20 -0000 1.49 --- path.cc 15 Jan 2010 18:45:20 -0000 1.50 *************** *** 2976,2979 **** --- 2976,2983 ---- These are exported to the world as cygwin_foo by cygwin.din. */ + // + // The returned pointer should be freed with free unless, + // as it turns out, it is equal to the input pointer. + // extern "C" char * *************** *** 2993,3000 **** debug_printf("msys_p2w (%s)", path); char *spath = (char *)alloca (pathlen + 1); memcpy (spath, path, pathlen + 1); char * sspath; ! // retpath will be what sets win32_path before exiting. char *retpath = (char *)malloc(((MAX_PATH - pathlen) > 0) ? MAX_PATH : pathlen + MAX_PATH); --- 2997,3011 ---- debug_printf("msys_p2w (%s)", path); + // + // copy of the path string that we can overwrite + // char *spath = (char *)alloca (pathlen + 1); memcpy (spath, path, pathlen + 1); + char * sspath; ! ! // ! // retpath contains the converted path string to be returned ! // char *retpath = (char *)malloc(((MAX_PATH - pathlen) > 0) ? MAX_PATH : pathlen + MAX_PATH); *************** *** 3176,3179 **** --- 3187,3194 ---- // { + // + // Convert only up to a ".." path component, and + // keep all what follows as is. + // sspath = strchr (spath, '.'); if (sspath && *(sspath - 1) == '/' && *(sspath + 1) == '.') *************** *** 3231,3234 **** --- 3246,3253 ---- else { + // + // Check for single letter option with a + // path argument attached, eg -I/include */ + // sspath = (char *)spath; sspath++; Index: ChangeLog.MSYS =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/ChangeLog.MSYS,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** ChangeLog.MSYS 15 Jan 2010 16:28:10 -0000 1.105 --- ChangeLog.MSYS 15 Jan 2010 18:45:19 -0000 1.106 *************** *** 1,4 **** --- 1,8 ---- 2010.01.15 Cesar Strauss <ces...@gm...> + * path.cc (msys_p2w): Improve documentation. + + 2010.01.15 Cesar Strauss <ces...@gm...> + Add sanity checks to avoid possible crash. * ismsys.cc (GetFileDataStr): null-terminate the return data. |
|
From: Cesar S. <cst...@us...> - 2010-01-15 16:28:29
|
Update of /cvsroot/mingw/msys/rt/src/winsup/cygwin In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9242 Modified Files: ChangeLog.MSYS ismsys.cc Log Message: Add sanity checks to avoid possible crash. * ismsys.cc (GetFileDataStr): null-terminate the return data. (IsMsys): Bound-check the pointer passed to strcmp. Index: ismsys.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/ismsys.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ismsys.cc 28 Dec 2009 22:07:32 -0000 1.5 --- ismsys.cc 15 Jan 2010 16:28:10 -0000 1.6 *************** *** 67,71 **** { TRACE_IN; ! char *FileData = new char [bytes2get]; unsigned bytesread; --- 67,71 ---- { TRACE_IN; ! char *FileData = new char [bytes2get+1]; unsigned bytesread; *************** *** 83,86 **** --- 83,88 ---- } + FileData[bytes2get] = 0; + return FileData; } *************** *** 141,144 **** --- 143,152 ---- for (int I=0; impdata[I].name; I++) { + if (impdata[I].name < PE_ImportRva || + impdata[I].name - PE_ImportRva >= PE_ImportDataSz) + { + debug_printf("Unrecognized PE format"); + break; + } if (!strcmp((char *) PE_Import + impdata[I].name - PE_ImportRva, "msys-1.0.dll")) Index: ChangeLog.MSYS =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/ChangeLog.MSYS,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** ChangeLog.MSYS 15 Jan 2010 16:14:52 -0000 1.104 --- ChangeLog.MSYS 15 Jan 2010 16:28:10 -0000 1.105 *************** *** 1,4 **** --- 1,10 ---- 2010.01.15 Cesar Strauss <ces...@gm...> + Add sanity checks to avoid possible crash. + * ismsys.cc (GetFileDataStr): null-terminate the return data. + (IsMsys): Bound-check the pointer passed to strcmp. + + 2010.01.15 Cesar Strauss <ces...@gm...> + * include/cygwin/version.h: Increment version to 1.0.13. |
|
From: Cesar S. <cst...@us...> - 2010-01-15 16:15:14
|
Update of /cvsroot/mingw/msys/rt/src/winsup/cygwin In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7336 Modified Files: ChangeLog.MSYS Log Message: Increment version to 1.0.13 * include/cygwin/version.h: Increment version to 1.0.13. Index: ChangeLog.MSYS =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/ChangeLog.MSYS,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** ChangeLog.MSYS 14 Jan 2010 04:16:37 -0000 1.103 --- ChangeLog.MSYS 15 Jan 2010 16:14:52 -0000 1.104 *************** *** 1,2 **** --- 1,6 ---- + 2010.01.15 Cesar Strauss <ces...@gm...> + + * include/cygwin/version.h: Increment version to 1.0.13. + 2010.01.12 Charles Wilson <mi...@cw...> |
|
From: Cesar S. <cst...@us...> - 2010-01-15 16:15:12
|
Update of /cvsroot/mingw/msys/rt/src/winsup/cygwin/include/cygwin In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7336/include/cygwin Modified Files: version.h Log Message: Increment version to 1.0.13 * include/cygwin/version.h: Increment version to 1.0.13. Index: version.h =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/include/cygwin/version.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** version.h 14 Jan 2010 04:16:37 -0000 1.15 --- version.h 15 Jan 2010 16:14:54 -0000 1.16 *************** *** 43,52 **** /* The current cygwin version is 1.3.3 */ ! /* The current msys version is 1.0.12 */ #define CYGWIN_VERSION_DLL_MAJOR 1000 ! #define CYGWIN_VERSION_DLL_MINOR 12 #define DLL_VERSION_MAJOR 1000 ! #define DLL_VERSION_MINOR 12 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are --- 43,52 ---- /* The current cygwin version is 1.3.3 */ ! /* The current msys version is 1.0.13 */ #define CYGWIN_VERSION_DLL_MAJOR 1000 ! #define CYGWIN_VERSION_DLL_MINOR 13 #define DLL_VERSION_MAJOR 1000 ! #define DLL_VERSION_MINOR 13 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are |
|
From: Keith M. <kei...@us...> - 2010-01-08 17:44:59
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28267 Modified Files: ChangeLog Makefile.in configure.ac Added Files: version.c.in Log Message: Add CLI version reporting option. Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.in 23 Nov 2009 20:44:23 -0000 1.4 --- Makefile.in 8 Jan 2010 17:44:16 -0000 1.5 *************** *** 4,8 **** # # Written by Keith Marshall <kei...@us...> ! # Copyright (C) 2009, MinGW Project # # --- 4,8 ---- # # Written by Keith Marshall <kei...@us...> ! # Copyright (C) 2009, 2010, MinGW Project # # *************** *** 66,70 **** $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+ ! mingw-get$(EXEEXT): clistub.$(OBJEXT) $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+ --- 66,70 ---- $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+ ! mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT) $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+ *************** *** 100,104 **** distclean: clean ! rm -f config.* Makefile # $RCSfile$: end of file --- 100,104 ---- distclean: clean ! rm -f config.* version.c Makefile # $RCSfile$: end of file Index: configure.ac =================================================================== RCS file: /cvsroot/mingw/mingw-get/configure.ac,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** configure.ac 31 Oct 2009 21:08:41 -0000 1.1 --- configure.ac 8 Jan 2010 17:44:20 -0000 1.2 *************** *** 4,8 **** # # Written by Keith Marshall <kei...@us...> ! # Copyright (C) 2009, MinGW Project # # --- 4,8 ---- # # Written by Keith Marshall <kei...@us...> ! # Copyright (C) 2009, 2010, MinGW Project # # *************** *** 23,27 **** # arising from the use of this software. # ! AC_INIT([mingw-get],[0.0],[http://mingw.org/reporting_bugs]) # We need both C and C++ compilers; check how to invoke them --- 23,30 ---- # arising from the use of this software. # ! AC_INIT([mingw-get],[0.1-alpha-1],[http://mingw.org/reporting_bugs]) ! ! AC_SUBST([COPYRIGHT_HOLDER],["MinGW Project"]) ! AC_SUBST([YEARS_OF_ISSUE],["2009, 2010"]) # We need both C and C++ compilers; check how to invoke them *************** *** 41,45 **** # Create a makefile # ! AC_CONFIG_FILES([Makefile]) AC_OUTPUT # --- 44,48 ---- # Create a makefile # ! AC_CONFIG_FILES([version.c Makefile]) AC_OUTPUT # --- NEW FILE: version.c.in --- /* * @configure_input@ * * $Id: version.c.in,v 1.1 2010/01/08 17:44:20 keithmarshall Exp $ * */ const char *version_identification = "@PACKAGE_NAME@ version @PACKAGE_VERSION@\n" "Copyright (C) @YEARS_OF_ISSUE@, @COPYRIGHT_HOLDER@\n" "\n" "This is free software; see the product documentation, or source code,\n" "for copying and redistribution conditions. There is NO WARRANTY; not\n" "even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY\n" "PARTICULAR PURPOSE.\n\n"; /* $RCSfile: version.c.in,v $: end of file */ Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ChangeLog 17 Dec 2009 17:35:09 -0000 1.12 --- ChangeLog 8 Jan 2010 17:44:09 -0000 1.13 *************** *** 1,2 **** --- 1,23 ---- + 2010-01-08 Keith Marshall <kei...@us...> + + Add CLI version reporting option. + + * configure.ac: Update copyright notice for new year. + (COPYRIGHT_HOLDER): New AC_SUBST variable; define it. + (YEARS_OF_ISSUE): New AC_SUBST variable; define it. + (AC_CONFIG_FILES): Add `version.c'; source it from... + + * version.c.in: ...this new file. + + * Makefile.in: Update copyright notice for new year. + (mingw-get$(EXEEXT)): Add dependency on `version.$(OBJEXT)'. + (distclean): Add `version.c'. + + * configure: Regenerated. + + * src/clistub.c: Update copyright notice for new year. + (options): New array of `struct option'; define and use it as the + reference for `argv' parsing with `getopt_long_only()'. + 2009-12-17 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-01-08 17:44:36
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28267/src Modified Files: clistub.c Log Message: Add CLI version reporting option. Index: clistub.c =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/clistub.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** clistub.c 12 Nov 2009 22:33:26 -0000 1.2 --- clistub.c 8 Jan 2010 17:44:21 -0000 1.3 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * *************** *** 36,39 **** --- 36,40 ---- #include <libgen.h> #include <process.h> + #include <getopt.h> #define EXIT_FATAL EXIT_FAILURE + 1 *************** *** 155,164 **** } int main( int argc, char **argv ) { /* Establish the installation path for the mingw-get application... */ ! wchar_t *approot = AppPathNameW( NULL ); ! if( approot != NULL ) { /* ...and set up the APPROOT environment variable to refer to --- 156,208 ---- } + extern const char *version_identification; + int main( int argc, char **argv ) { + wchar_t *approot; /* where this application is installed */ + + if( argc > 1 ) + { + /* The user specified arguments on the command line... + * Interpret any which specify processing options for this application, + * (these are all specified in GNU `long only' style). + */ + struct option options[] = + { + /* Option Name Argument Category Store To Return Value + * ---------------------- ------------------ -------- ------------ + */ + { "version", no_argument, NULL, 'V' }, + + /* This list must be terminated by a null definition... + */ + { NULL, 0, NULL, 0 } + }; + + int opt, offset; + while( (opt = getopt_long_only( argc, argv, "V", options, &offset )) != -1 ) + switch( opt ) + { + case 'V': + /* This is a request to display the version of the application; + * emit the requisite informational message, and quit. + */ + printf( version_identification ); + return 0; + + default: + /* User specified an invalid or unsupported option... + */ + if( opt != '?' ) + fprintf( stderr, "%s: option '-%s' not yet supported\n", + basename( *argv ), options[offset].name + ); + return EXIT_FAILURE; + } + } + /* Establish the installation path for the mingw-get application... */ ! if( (approot = AppPathNameW( NULL )) != NULL ) { /* ...and set up the APPROOT environment variable to refer to |