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
(2) |
3
|
|
4
(2) |
5
|
6
|
7
|
8
|
9
|
10
|
|
11
|
12
|
13
(2) |
14
|
15
(2) |
16
|
17
(6) |
|
18
(1) |
19
|
20
|
21
|
22
|
23
|
24
|
|
25
|
26
|
27
|
28
|
29
(2) |
30
(3) |
|
|
From: Keith M. <kei...@us...> - 2010-04-30 20:26:41
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv5337/src Removed Files: tarinst.cpp Log Message: Revert 2010-04-04 refactoring of tarproc.cpp and tarinst.cpp --- tarinst.cpp DELETED --- |
|
From: Keith M. <kei...@us...> - 2010-04-30 20:25:24
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv4661/src Modified Files: tarproc.cpp Log Message: Revert 2010-04-04 refactoring of tarproc.cpp and tarinst.cpp Index: tarproc.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/tarproc.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tarproc.cpp 4 Apr 2010 15:25:36 -0000 1.5 --- tarproc.cpp 30 Apr 2010 20:25:06 -0000 1.6 *************** *** 9,13 **** * * Implementation of package archive processing methods, for reading ! * and extracting content from tar archives. * * --- 9,15 ---- * * Implementation of package archive processing methods, for reading ! * and extracting content from tar archives; provides implementations ! * for each of the pkgTarArchiveProcessor and pkgTarArchiveInstaller ! * classes. * * *************** *** 42,45 **** --- 44,53 ---- #include "pkgproc.h" + /******************* + * + * Class Implementation: pkgTarArchiveProcessor + * + */ + pkgTarArchiveProcessor::pkgTarArchiveProcessor( pkgXmlNode *pkg ) { *************** *** 380,382 **** --- 388,529 ---- } + + /******************* + * + * Class Implementation: pkgTarArchiveInstaller + * + */ + #include <utime.h> + + static int commit_saved_entity( const char *pathname, time_t mtime ) + { + /* Helper to set the access and modification times for a file, + * after extraction from an archive, to match the specified "mtime"; + * (typically "mtime" is as recorded within the archive). + */ + struct utimbuf timestamp; + + timestamp.actime = timestamp.modtime = mtime; + return utime( pathname, ×tamp ); + } + + pkgTarArchiveInstaller:: + pkgTarArchiveInstaller( pkgXmlNode *pkg ):pkgTarArchiveProcessor( pkg ) + { + /* Constructor: having successfully set up the pkgTarArchiveProcessor + * base class, we attach a pkgManifest to track the installation. + */ + if( (tarname != NULL) && (sysroot != NULL) && stream->IsReady() ) + installed = new pkgManifest( package_key, tarname ); + } + + int pkgTarArchiveInstaller::Process() + { + /* Specialisation of the base class Process() method. + */ + int status; + /* First, process the archive as for the base class... + */ + if( (status = pkgTarArchiveProcessor::Process()) == 0 ) + { + /* ...then, on successful completion... + * + * Update the package installation manifest, to record + * the installation in the current sysroot... + */ + installed->BindSysRoot( sysroot, package_key ); + pkgRegister( sysroot, origin, tarname, pkgfile ); + } + return status; + } + + int pkgTarArchiveInstaller::ProcessDirectory( const char *pathname ) + { + /* Create the directory infrastructure required to support + * a specific package installation. + */ + #if DEBUGLEVEL < 5 + int status; + + if( (status = mkdir_recursive( pathname, 0755 )) == 0 ) + /* + * Either the specified directory already exists, + * or we just successfully created it; attach a reference + * in the installation manifest for the current package. + */ + installed->AddEntry( dirname_key, pathname + sysroot_len ); + + else + /* A required subdirectory could not be created; + * diagnose this failure. + */ + dmh_notify( DMH_ERROR, "cannot create directory `%s'\n", pathname ); + + #else + /* Debugging stub... + * + * FIXME:maybe adapt for 'dry-run' or 'verbose' use. + */ + int status = 0; + + dmh_printf( + "FIXME:ProcessDirectory<stub>:not executing: mkdir -p %s\n", + pathname + ); + # if DEBUGLEVEL > 8 + installed->AddEntry( dirname_key, pathname + sysroot_len ); + # endif + #endif + return status; + } + + int pkgTarArchiveInstaller::ProcessDataStream( const char *pathname ) + { + /* Extract file data from the archive, and copy it to the + * associated target file stream, if any. + */ + #if DEBUGLEVEL < 5 + int fd = set_output_stream( pathname, octval( header.field.mode ) ); + int status = ProcessEntityData( fd ); + if( fd >= 0 ) + { + /* File stream was written; close it... + */ + close( fd ); + if( status == 0 ) + { + /* ...and on successful completion, commit it and + * record it in the installation database. + */ + commit_saved_entity( pathname, octval( header.field.mtime ) ); + installed->AddEntry( filename_key, pathname + sysroot_len ); + } + + else + { + /* The target file was not successfully and completely + * written; discard it, and diagnose failure. + */ + unlink( pathname ); + dmh_notify( DMH_ERROR, "%s: extraction failed\n", pathname ); + } + } + return status; + + #else + /* Debugging stub... + * + * FIXME:maybe adapt for 'dry-run' or 'verbose' use. + */ + dmh_printf( + "FIXME:ProcessDataStream<stub>:not extracting: %s\n", + pathname + ); + # if DEBUGLEVEL > 8 + installed->AddEntry( filename_key, pathname + sysroot_len ); + # endif + return ProcessEntityData( -1 ); + #endif + } + /* $RCSfile$: end of file */ |
|
From: Keith M. <kei...@us...> - 2010-04-30 20:25:15
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv4661 Modified Files: ChangeLog Makefile.in Log Message: Revert 2010-04-04 refactoring of tarproc.cpp and tarinst.cpp Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile.in 4 Apr 2010 15:22:07 -0000 1.13 --- Makefile.in 30 Apr 2010 20:25:06 -0000 1.14 *************** *** 57,62 **** pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) pkgdeps.$(OBJEXT) \ - mkpath.$(OBJEXT) pkginst.$(OBJEXT) tarinst.$(OBJEXT) tarproc.$(OBJEXT) \ xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) dmh.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) --- 57,62 ---- pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) pkgdeps.$(OBJEXT) \ xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) dmh.$(OBJEXT) \ + mkpath.$(OBJEXT) pkginst.$(OBJEXT) tarproc.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ChangeLog 29 Apr 2010 17:13:15 -0000 1.41 --- ChangeLog 30 Apr 2010 20:25:06 -0000 1.42 *************** *** 1,2 **** --- 1,11 ---- + 2010-04-30 Keith Marshall <kei...@us...> + + Revert 2010-04-04 refactoring of tarproc.cpp and tarinst.cpp + + * src/tarinst.cpp: File removed; its content merged into... + * src/tarproc.cpp: ...this; it cannot be cleanly separated out. + + * Makefile.in (tarinst.$OBJEXT): Remove reference. + 2010-04-29 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-04-29 17:13:23
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv23506 Modified Files: ChangeLog Log Message: Handle "*" wildcard matches in package and subsystem version strings. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** ChangeLog 18 Apr 2010 09:09:58 -0000 1.40 --- ChangeLog 29 Apr 2010 17:13:15 -0000 1.41 *************** *** 1,2 **** --- 1,23 ---- + 2010-04-29 Keith Marshall <kei...@us...> + + Handle "*" wildcard matches in package and subsystem version strings. + + * src/vercmp.h (pkgVersionInfo::version_string): New private member + variable; it stores a pointer to a dynamically allocated local copy of + the invariant `version' argument, to facilitate correct parsing. + (pkgVersionInfo::build_string): Likewise; it provides similar handling + for the invariant `build' argument. + (pkgVersionInfo::Free): New private inline method; it provides a NULL + pointer safe wrapper, calling the C library `free()' function, (since + some implementations are believed to be unsafe); it is used by... + (pkgVersionInfo::~pkgVersionInfo): ...this new inline destructor, to + release the memory allocated by the constructor, for `version_string' + and `build_string'. + + * src/vercmp.cpp (pkgVersionInfo::pkgVersionInfo): Allocate memory for + `version_string' and `build_string', as required; populate it. + Explicitly handle "*" as a `match anything' wildcard... + (pkgVersionInfo::Compare): ...matching it as `equal' to everything. + 2010-04-18 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-04-29 17:13:23
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv23506/src Modified Files: vercmp.cpp vercmp.h Log Message: Handle "*" wildcard matches in package and subsystem version strings. Index: vercmp.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/vercmp.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vercmp.cpp 26 Jan 2010 21:07:18 -0000 1.2 --- vercmp.cpp 29 Apr 2010 17:13:15 -0000 1.3 *************** *** 27,38 **** */ #include "vercmp.h" pkgVersionInfo::pkgVersionInfo( const char* version, const char* build ) { /* Constructor... ! * Decompose given version number string, storing components ! * within the specified class structure. */ ! const char *p = version ? version : ""; /* Walking over all version number constituent elements... --- 27,44 ---- */ #include "vercmp.h" + #include <string.h> pkgVersionInfo::pkgVersionInfo( const char* version, const char* build ) { /* Constructor... ! * Decompose given version number and build serial number strings, ! * storing components within the specified class structure. ! * ! * Note that the strings to be parsed are invariant, (and it is ! * necessary that they be so), but we need to create modifiable ! * copies to facilitate decomposition... */ ! char *wildcard = build_string = NULL; ! char *p = version_string = strdup( version ? version : "" ); /* Walking over all version number constituent elements... *************** *** 50,90 **** * ...select second argument for parsing. */ ! p = build; ! /* When parsing a numeric argument... */ while( (*p >= '0') && ((*p - '0') < 10) ) ! /* ! * ...accumulate its ultimate value. */ value = *p++ - '0' + 10 * value; ! /* Store it, and note presence of any suffix. */ version_elements[index].value = value; version_elements[index].suffix = p; ! /* Skip forward to next element field delimiter. */ while( *p && (*p != '.') && (*p != '-') ) ! ++p; if( (*p == '-') || ((*p == '\0') && (build != NULL)) ) /* ! * If we hit the end of the version number, * before we filled out all of its possible elements, ! * then zero the remainder, before we progress to ! * capture the build serial number. */ while( index < VERSION_PATCHLEVEL ) { version_elements[++index].value = 0L; ! version_elements[index].suffix = p; } /* Step over any delimiter, which demarcates the current ! * version number or build serial number element field. */ ! if( *p ) ++p; } } --- 56,121 ---- * ...select second argument for parsing. */ ! p = build_string = strdup( build ); ! /* When parsing an explicitly specified numeric argument... */ while( (*p >= '0') && ((*p - '0') < 10) ) ! { ! /* ...accumulate its ultimate value, and clear any prior ! * "wildcard" matching request which may have been carried ! * forward from the preceding field specification. */ value = *p++ - '0' + 10 * value; + wildcard = NULL; + } ! /* Store it, note the presence of any suffix, and establish ! * the control state for a possible "wildcard" match. */ version_elements[index].value = value; version_elements[index].suffix = p; + if( (value == 0L) && (*p == '*') ) + wildcard = p++; ! /* Skip forward to next element field delimiter, clearing any ! * active "wildcard" matching request, if the "suffix" doesn't ! * represent a pure "wildcard" designator. */ while( *p && (*p != '.') && (*p != '-') ) ! if( *p++ != '*' ) wildcard = NULL; + /* Evaluate the current field delimiter, to identify the type + * of the following field (if any)... + */ if( (*p == '-') || ((*p == '\0') && (build != NULL)) ) /* ! * ...and, if we hit the end of the version number, * before we filled out all of its possible elements, ! * then zero the remainder, (while preserving "wildcard" ! * matching state), before we progress to capture the ! * build serial number. */ while( index < VERSION_PATCHLEVEL ) { version_elements[++index].value = 0L; ! version_elements[index].suffix = wildcard ? wildcard : p; } + /* If "wildcard" matching is in the active state, by the time + * we get to here, then it may have been activated for this field, + * or it may have been passed forward from a preceding field... + */ + if( wildcard ) + /* + * ...we don't know which applies, so we unconditionally adjust + * the "suffix" pointer, to ensure that the state is recorded. + */ + version_elements[index].suffix = wildcard; + /* Step over any delimiter, which demarcates the current ! * version number or build serial number element field, while ! * ensuring that the decomposed field is properly terminated. */ ! if( *p ) *p++ = '\0'; } } *************** *** 96,101 **** * <0L, 0L or >0L for less than, equal to or greater than rhs respectively. */ ! long cmp = version_elements[index].value - rhs.version_elements[index].value; ! if( cmp == 0L ) { /* The specified element values are identically equal; --- 127,150 ---- * <0L, 0L or >0L for less than, equal to or greater than rhs respectively. */ ! long cmpval; ! if( (cmpval = rhs.version_elements[index].value) == 0L ) ! { ! /* In the special case where the reference value is zero... ! */ ! const char *p = rhs.version_elements[index].suffix; ! if( (p != NULL) && (p[0] == '*') && (p[1] == '\0') ) ! { ! /* ...and where it has an explicit suffix which is identically ! * equal to the string "*", then it represents a "wildcard" match, ! * which unconditionally matches everything as "equal". ! */ ! return 0L; ! } ! } ! ! /* When we didn't match a "wildcard"... ! * we fall through to here, and proceed with a normal comparison. ! */ ! if( (cmpval = version_elements[index].value - cmpval) == 0L ) { /* The specified element values are identically equal; *************** *** 126,133 **** * mismatched characters, representing delimiters as NUL. */ ! cmp = (*p && (*p != '.') && (*p != '-')) ? (long)(*p) : 0L; ! cmp -= (*r && (*r != '.') && (*r != '-')) ? (long)(*r) : 0L; } ! return cmp; } --- 175,182 ---- * mismatched characters, representing delimiters as NUL. */ ! cmpval = (*p && (*p != '.') && (*p != '-')) ? (long)(*p) : 0L; ! cmpval -= (*r && (*r != '.') && (*r != '-')) ? (long)(*r) : 0L; } ! return cmpval; } Index: vercmp.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/vercmp.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** vercmp.h 16 Nov 2009 21:54:30 -0000 1.1 --- vercmp.h 29 Apr 2010 17:13:15 -0000 1.2 *************** *** 76,79 **** --- 76,80 ---- */ pkgVersionInfo( const char* version = "", const char* build = NULL ); + inline ~pkgVersionInfo(){ Free( version_string ); Free( build_string ); } /* Package version comparison operators. *************** *** 89,92 **** --- 90,94 ---- /* The decomposed version/serial number elements. */ + char *version_string, *build_string; struct version_t version_elements[VERSION_ELEMENT_COUNT]; *************** *** 94,97 **** --- 96,100 ---- */ long Compare( const pkgVersionInfo&, int ); + inline void Free( void *mem ){ if( mem != NULL ) free( mem ); } }; |
|
From: Keith M. <kei...@us...> - 2010-04-18 09:10:09
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv12417 Modified Files: ChangeLog aclocal.m4 configure.ac Log Message: Correct omission from configure script prerequisite checks. Index: aclocal.m4 =================================================================== RCS file: /cvsroot/mingw/mingw-get/aclocal.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** aclocal.m4 17 Apr 2010 22:18:08 -0000 1.1 --- aclocal.m4 18 Apr 2010 09:09:58 -0000 1.2 *************** *** 23,27 **** # arising from the use of this software. # ! m4_include([m4/missing.m4]) # # $RCSfile$: end of file --- 23,37 ---- # arising from the use of this software. # ! m4_include([m4/missing.m4]) ! ! # MINGW_AC_OUTPUT ! # --------------- ! # A wrapper for AC_OUTPUT itself, to ensure that missing prerequisite ! # checks are completed, before the final output stage. ! # ! AC_DEFUN([MINGW_AC_OUTPUT], ! [AC_REQUIRE([_MINGW_AC_ABORT_IF_MISSING_PREREQ])dnl ! AC_OUTPUT($@)dnl ! ])# MINGW_AC_OUTPUT # # $RCSfile$: end of file Index: configure.ac =================================================================== RCS file: /cvsroot/mingw/mingw-get/configure.ac,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** configure.ac 17 Apr 2010 22:18:08 -0000 1.5 --- configure.ac 18 Apr 2010 09:09:58 -0000 1.6 *************** *** 45,53 **** # zlib, libbz2 and liblzma are available # ! AC_CHECK_HEADER([zlib.h],,MINGW_AC_ASSERT_MISSING([zlib], [libz-1.2.3-1-mingw32-dev.tar.gz])) ! AC_CHECK_HEADER([bzlib.h],,MINGW_AC_ASSERT_MISSING([libbz2], [bzip2-1.0.5-2-mingw32-dev.tar.gz])) ! AC_CHECK_HEADER([lzma.h],,MINGW_AC_ASSERT_MISSING([liblzma], [liblzma-4.999.9beta_20091209-3-mingw32-dev.tar.bz2])) --- 45,53 ---- # zlib, libbz2 and liblzma are available # ! AC_CHECK_HEADER([zlib.h],,MINGW_AC_ASSERT_MISSING([zlib-dev], [libz-1.2.3-1-mingw32-dev.tar.gz])) ! AC_CHECK_HEADER([bzlib.h],,MINGW_AC_ASSERT_MISSING([libbz2-dev], [bzip2-1.0.5-2-mingw32-dev.tar.gz])) ! AC_CHECK_HEADER([lzma.h],,MINGW_AC_ASSERT_MISSING([liblzma-dev], [liblzma-4.999.9beta_20091209-3-mingw32-dev.tar.bz2])) *************** *** 71,75 **** # AC_CONFIG_FILES([version.c Makefile]) ! AC_OUTPUT # # $RCSfile$: end of file --- 71,75 ---- # AC_CONFIG_FILES([version.c Makefile]) ! MINGW_AC_OUTPUT # # $RCSfile$: end of file Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ChangeLog 17 Apr 2010 22:18:08 -0000 1.39 --- ChangeLog 18 Apr 2010 09:09:58 -0000 1.40 *************** *** 1,2 **** --- 1,14 ---- + 2010-04-18 Keith Marshall <kei...@us...> + + Correct omission from configure script prerequisite checks. + + * aclocal.m4 (MINGW_AC_OUTPUT): New macro; it wraps AC_OUTPUT itself, + adding a trap to force an abort if any preceding prerequisite check + was handled by MINGW_AC_ASSERT_MISSING. + + * configure.ac: Qualify package component types, in prerequisite + checks handled by MINGW_AC_ASSERT_MISSING; invoke MINGW_AC_OUTPUT + in place of AC_OUTPUT. + 2010-04-17 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-04-17 22:18:16
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15927 Modified Files: ChangeLog configure.ac Added Files: aclocal.m4 Log Message: Add configure script checks for prerequisite library headers. --- NEW FILE: aclocal.m4 --- # aclocal.m4 -*- autoconf -*- vim: filetype=config # # $Id: aclocal.m4,v 1.1 2010/04/17 22:18:08 keithmarshall Exp $ # # Written by Keith Marshall <kei...@us...> # Copyright (C) 2009, 2010, MinGW Project # # # Configuration script for mingw-get # # # 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. # m4_include([m4/missing.m4]) # # $RCSfile: aclocal.m4,v $: end of file Index: configure.ac =================================================================== RCS file: /cvsroot/mingw/mingw-get/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** configure.ac 16 Feb 2010 21:58:06 -0000 1.4 --- configure.ac 17 Apr 2010 22:18:08 -0000 1.5 *************** *** 42,45 **** --- 42,55 ---- AC_PROG_LEX + # Ensure that (at least the headers for) prerequisite libraries, + # zlib, libbz2 and liblzma are available + # + AC_CHECK_HEADER([zlib.h],,MINGW_AC_ASSERT_MISSING([zlib], + [libz-1.2.3-1-mingw32-dev.tar.gz])) + AC_CHECK_HEADER([bzlib.h],,MINGW_AC_ASSERT_MISSING([libbz2], + [bzip2-1.0.5-2-mingw32-dev.tar.gz])) + AC_CHECK_HEADER([lzma.h],,MINGW_AC_ASSERT_MISSING([liblzma], + [liblzma-4.999.9beta_20091209-3-mingw32-dev.tar.bz2])) + # Set up the archive librarian, to match our compiler settings # Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ChangeLog 17 Apr 2010 12:43:04 -0000 1.38 --- ChangeLog 17 Apr 2010 22:18:08 -0000 1.39 *************** *** 1,4 **** --- 1,16 ---- 2010-04-17 Keith Marshall <kei...@us...> + Add configure script checks for prerequisite library headers. + (Thanks to Cesar Strauss for proposing a rudimentary implementation). + + * aclocal.m4: New file; it does no more than include... + * m4/missing.m4: ...this; new file incorporated from build-aux module. + + * configure.ac: Add AC_CHECK_HEADER assertions for... + (zlib.h, bzlib.h, lzma.h): ...these; invoke MINGW_AC_ASSERT_MISSING in + respect of each failing assertion. + + 2010-04-17 Keith Marshall <kei...@us...> + Case-insensitive subsystem name matching revisited. |
|
From: Keith M. <kei...@us...> - 2010-04-17 21:01:26
|
Update of /cvsroot/mingw/build-aux In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32281 Added Files: ChangeLog README Log Message: Initialise MinGW/build-aux CVS module. --- NEW FILE: README --- $Id: README,v 1.1 2010/04/17 21:01:17 keithmarshall Exp $ This README relates to the MinGW/build-aux CVS module. The MinGW/build-aux module is not intended for free-standing use. Rather, it serves as a collection point for general purpose code components, which are intended to facilitate the development of build systems for other modules; as such, individual components selected from build-aux may be incorporated into other modules by means of appropriate mapping entries in the CVS modules database. Developers wishing to deploy modules from MinGW/build-aux into their own MinGW hosted project should consult the administrator, to ensure that the appropriate references are established within the CVS modules database. Changes to MinGW/build-aux component modules may be initiated from any sandbox of any module which incorporates the affected component. When making any such change, developers are requested to please ensure that the ChangeLog within MinGW/build-aux itself is appropriately updated. -- Keith Marshall, 2010-04-16 --- NEW FILE: ChangeLog --- 2010-04-16 Keith Marshall <kei...@us...> Initialise MinGW/build-aux CVS module. * build-aux: New CVS module. * README ChangeLog: New files. * m4: New directory; add it. * m4/missing.m4: New file. * CVSROOT/modules (modules): New self-referencing module; define it. (missing.m4): New module reference to build-aux/m4/missing.m4; it will incorporate m4/missing.m4 into any module embedding it. |
|
From: Keith M. <kei...@us...> - 2010-04-17 21:01:25
|
Update of /cvsroot/mingw/build-aux/m4 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32281/m4 Added Files: missing.m4 Log Message: Initialise MinGW/build-aux CVS module. --- NEW FILE: missing.m4 --- ## missing.m4 -*- autoconf -*- vim: filetype=config ## ## $Id: missing.m4,v 1.1 2010/04/17 21:01:17 keithmarshall Exp $ ## ## Written by Keith Marshall <kei...@us...> ## Copyright (C) 2010, MinGW Project ## ## ## Autoconf macros to gracefully abort configure, on identified ## non-availability of specified build prerequisites. ## ## ## This is free software. Permission is hereby granted to copy ## and redistribute this software, either as is or in modified form, ## subject only to the restrictions that the original author's notice ## of copyright and disclaimers of warranty and of liability shall be ## preserved without change in EVERY copy, and that modified copies ## shall be clearly identified as such. ## ## This software is provided "as is", in the hope that it may prove ## useful, but there is NO WARRANTY OF ANY KIND; not even an implied ## WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR A 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. # MINGW_AC_ASSERT_MISSING( PACKAGE, [TARNAME] ) # --------------------------------------------- # Add PACKAGE to the list of prerequisite packages which are # identified as missing from the build system; this will then # be included in the diagnostic message which will be displayed, # if MINGW_AC_ABORT_IF_MISSING_PREREQ is subsequently invoked. # # If TARNAME is also specified, then it too will be included # in the message, as a recommended package to be installed in # order to satisfy the prerequisite. # AC_DEFUN([MINGW_AC_ASSERT_MISSING], [test -n "${mingw_ac_missing_list}" && { mingw_ac_missing_plural=s mingw_ac_missing_appear=; } mingw_ac_missing_list="${mingw_ac_missing_list} $1" test -n "$2" && { test -n "${mingw_ac_missing_providers}" && { mingw_ac_missing_providers_plural=s; } mingw_ac_missing_providers="${mingw_ac_missing_providers} $2"; } ])# MINGW_AC_ASSERT_MISSING # MINGW_AC_ABORT_IF_MISSING_PREREQ # -------------------------------- # Invoked unconditionally after any MINGW_AC_ASSERT_MISSING request, # and prior to AC_OUTPUT, causes configure to abort with a diagnostic # message if any missing prerequisite has been identified. # AC_DEFUN([_MINGW_AC_ABORT_IF_MISSING_PREREQ], [test -n "$mingw_ac_missing_list" && { _MINGW_AC_SUGGEST_PROVIDERS AC_MSG_ERROR([missing prerequisite${mingw_ac_missing_plural}: The following prerequisite package${mingw_ac_missing_plural} dnl appear${mingw_ac_missing_appear-s} to be missing from your system:-- ${mingw_ac_missing_list}]); } ])# MINGW_AC_ABORT_IF_MISSING_PREREQ # _MINGW_AC_SUGGEST_PROVIDERS # --------------------------- # Helper macro, invoked only by MINGW_AC_ABORT_IF_MISSING_PREREQ; # it causes any TARNAME references from MINGW_AC_ASSERT_MISSING to # be itemised in the diagnostic output. # AC_DEFUN([_MINGW_AC_SUGGEST_PROVIDERS], [test -n "${mingw_ac_missing_providers}" && { test -z "${mingw_ac_missing_providers_plural}" \ && mingw_ac_newer="a newer" \ || mingw_ac_newer=newer mingw_ac_missing_list="${mingw_ac_missing_list} To continue building ${PACKAGE_TARNAME}, you should install the following or ${mingw_ac_newer} version${mingw_ac_missing_providers_plural} of:-- ${mingw_ac_missing_providers} and run configure again. "; } ])# _MINGW_AC_SUGGEST_PROVIDERS # $RCSfile: missing.m4,v $: end of file |
|
From: Keith M. <kei...@us...> - 2010-04-17 20:59:01
|
Update of /cvsroot/mingw/build-aux/m4 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv31821/m4 Log Message: Directory /cvsroot/mingw/build-aux/m4 added to the repository |
|
From: Keith M. <kei...@us...> - 2010-04-17 12:43:15
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv3538 Modified Files: ChangeLog Log Message: Case-insensitive subsystem name matching revisited. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ChangeLog 15 Apr 2010 20:17:34 -0000 1.37 --- ChangeLog 17 Apr 2010 12:43:04 -0000 1.38 *************** *** 1,2 **** --- 1,10 ---- + 2010-04-17 Keith Marshall <kei...@us...> + + Case-insensitive subsystem name matching revisited. + + * src/pkgfind.cpp (pkgXmlDocument::FindPackageByName): Use... + (subsystem_strcmp): ...this to match subsystem names, instead of... + (match_if_explicit): ...this. + 2010-04-15 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-04-17 12:43:12
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv3538/src Modified Files: pkgfind.cpp Log Message: Case-insensitive subsystem name matching revisited. Index: pkgfind.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgfind.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pkgfind.cpp 1 Mar 2010 22:09:04 -0000 1.3 --- pkgfind.cpp 17 Apr 2010 12:43:05 -0000 1.4 *************** *** 46,50 **** */ if( dir->IsElementOfType( package_collection_key ) ! && match_if_explicit( subsystem, dir->GetPropVal( subsystem_key, NULL )) ) { /* ...inspect the content of each... --- 46,50 ---- */ if( dir->IsElementOfType( package_collection_key ) ! && subsystem_strcmp( subsystem, dir->GetPropVal( subsystem_key, NULL )) ) { /* ...inspect the content of each... |
|
From: Keith M. <kei...@us...> - 2010-04-15 20:17:42
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25636 Modified Files: ChangeLog Log Message: Enable recursive processing of repository package lists. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ChangeLog 4 Apr 2010 15:22:07 -0000 1.36 --- ChangeLog 15 Apr 2010 20:17:34 -0000 1.37 *************** *** 1,2 **** --- 1,13 ---- + 2010-04-15 Keith Marshall <kei...@us...> + + Enable recursive processing of repository package lists. + + * src/pkgbase.h (pkgXmlDocument::SyncRepository): Make it public. + + * src/pkgbind.cpp (pkgRepository): New locally defined and implemented + class; it facilitates recursive loading and parsing of package lists, + replacing much of the original non-recursive functionality within... + (pkgXmlDocument::BindRepositories): ...this; use it. + 2010-04-04 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-04-15 20:17:42
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25636/src Modified Files: pkgbase.h pkgbind.cpp Log Message: Enable recursive processing of repository package lists. Index: pkgbase.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgbase.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pkgbase.h 2 Apr 2010 08:38:04 -0000 1.7 --- pkgbase.h 15 Apr 2010 20:17:34 -0000 1.8 *************** *** 327,330 **** --- 327,331 ---- pkgActionItem* actions; + public: /* Method to synchronise the state of the local package manifest * with the master copy held on the distribution server. *************** *** 332,336 **** void SyncRepository( const char*, pkgXmlNode* ); - public: /* Method to merge content from repository-specific package lists * into the central XML package database. --- 333,336 ---- Index: pkgbind.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgbind.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pkgbind.cpp 16 Jan 2010 20:49:50 -0000 1.3 --- pkgbind.cpp 15 Apr 2010 20:17:34 -0000 1.4 *************** *** 34,37 **** --- 34,160 ---- #include "pkgkeys.h" + class pkgRepository + { + /* A locally defined class to facilitate recursive retrieval + * of package lists, from any specified repository. + */ + public: + pkgRepository( pkgXmlDocument*, pkgXmlNode*, pkgXmlNode*, bool ); + ~pkgRepository(){}; + + void GetPackageList( const char* ); + void GetPackageList( pkgXmlNode* ); + + private: + pkgXmlNode *dbase; + pkgXmlNode *repository; + pkgXmlDocument *owner; + bool force_update; + }; + + pkgRepository::pkgRepository + /* + * Constructor... + */ + ( pkgXmlDocument *client, pkgXmlNode *db, pkgXmlNode *ref, bool mode ): + owner( client ), dbase( db ), repository( ref ), force_update( mode ){} + + void pkgRepository::GetPackageList( const char *dname ) + { + /* Helper to retrieve and recursively process a named package list. + * + * FIXME: having made this recursively process multiple catalogues, + * potentially from multiple independent repositories, we may have + * introduced potential for catalogue name clashes; we need to add + * name hashing in the local catalogue cache, to avoid conflicts. + */ + if( dname != NULL ) + { + const char *dfile; + if( (dfile = xmlfile( dname )) != NULL ) + { + /* Check for a locally cached copy of the "package-list" file... + */ + if( force_update || (access( dfile, F_OK ) != 0) ) + /* + * When performing an "update", or if no local copy is available... + * Force a "sync", to fetch a copy from the public host. + */ + owner->SyncRepository( dname, repository ); + + /* We SHOULD now have a locally cached copy of the package-list; + * attempt to merge it into the active profile database... + */ + pkgXmlDocument merge( dfile ); + if( merge.IsOk() ) + { + /* We successfully loaded the XML catalogue; refer to its + * root element... + */ + dmh_printf( "Load catalogue: %s\n", merge.Value() ); + pkgXmlNode *catalogue, *pkglist; + if( (catalogue = merge.GetRoot()) != NULL ) + { + /* ...read it, selecting each of the "package-collection" + * records contained within it... + */ + pkglist = catalogue->FindFirstAssociate( package_collection_key ); + while( pkglist != NULL ) + { + /* ...and append a copy of each to the active profile... + */ + dbase->LinkEndChild( pkglist->Clone() ); + + /* Move on to the next "package-collection" (if any) + * within the current catalogue... + */ + pkglist = pkglist->FindNextAssociate( package_collection_key ); + } + + /* Recursively incorporate any additional package lists, + * which may be specified within the current catalogue... + */ + GetPackageList( catalogue->FindFirstAssociate( package_list_key ) ); + } + } + else + dmh_notify( DMH_WARNING, "Load catalogue: FAILED: %s\n", dfile ); + + /* However we handled it, the XML file's path name in "dfile" was + * allocated on the heap; we lose its reference on termination of + * this loop, so we must free it to avoid a memory leak. + */ + free( (void *)(dfile) ); + } + } + } + + void pkgRepository::GetPackageList( pkgXmlNode *catalogue ) + { + /* Helper method to retrieve a set of package list specifications + * from a "package-list" catalogue; after processing the specified + * "catalogue" it iterates over any sibling XML elements which are + * also designated as being of the "package-list" type. + * + * Note: we assume that the passed catalogue element actually + * DOES represent a "package-list" element; we do not check this, + * because the class declaration is not exposed externally to this + * translation unit, and we only ever call this from within the + * unit, when we have a "package-list" element to process. + */ + while( catalogue != NULL ) + { + /* Evaluate each identified "package-list" catalogue in turn... + */ + GetPackageList( catalogue->GetPropVal( catalogue_key, NULL ) ); + + /* A repository may comprise an arbitrary collection of software + * catalogues; move on, to process the next catalogue (if any) in + * the current repository collection. + */ + catalogue = catalogue->FindNextAssociate( package_list_key ); + } + } + pkgXmlNode *pkgXmlDocument::BindRepositories( bool force_update ) { *************** *** 56,129 **** { /* For each "repository" specified, identify its "catalogues"... - * - * FIXME: this requires the "package-lists" to be individually - * specified within the locally defined "repository" elements; - * it should allow for deduction of these, from a specifically - * named "repository-index" file identified via the repository - * 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) ) ! { ! /* Check for a locally cached copy of the "package-list" file... ! */ ! if( force_update || (access( dfile, F_OK ) != 0) ) ! /* ! * When performing an "update", or if no local copy is available... ! * Force a "sync", to fetch a copy from the public host. ! */ ! SyncRepository( dname, repository ); ! ! /* We SHOULD now have a locally cached copy of the package-list; ! * attempt to merge it into the active profile database... ! */ ! pkgXmlDocument merge( dfile ); ! if( merge.IsOk() ) ! { ! /* We successfully loaded the XML catalogue; refer to its ! * root element... ! */ ! dmh_printf( "Bind repository: %s\n", merge.Value() ); ! pkgXmlNode *pkglist; ! if( (pkglist = merge.GetRoot()) != NULL ) ! { ! /* ...read it, selecting each of the "package-collection" ! * records contained within it... ! */ ! pkglist = pkglist->FindFirstAssociate( package_collection_key ); ! while( pkglist != NULL ) ! { ! /* ...and append a copy of each to the active profile... ! */ ! dbase->LinkEndChild( pkglist->Clone() ); ! ! /* Move on to the next "package-collection" (if any) ! * within the current catalogue... ! */ ! pkglist = pkglist->FindNextAssociate( package_collection_key ); ! } ! } ! } ! else ! dmh_notify( DMH_WARNING, "Bind repository: FAILED: %s\n", dfile ); ! ! /* However we handled it, the XML file's path name in "dfile" was ! * allocated on the heap; we lose its reference on termination of ! * this loop, so we must free it to avoid a memory leak. ! */ ! free( (void *)(dfile) ); ! } ! /* A repository may comprise an arbitrary collection of software ! * catalogues; move on, to process the next catalogue (if any) in ! * the current repository collection. */ ! catalogue = catalogue->FindNextAssociate( package_list_key ); ! } /* Similarly, a complete distribution may draw from an arbitrary set --- 179,198 ---- { /* For each "repository" specified, identify its "catalogues"... */ + pkgRepository client( this, dbase, repository, force_update ); pkgXmlNode *catalogue = repository->FindFirstAssociate( package_list_key ); ! if( catalogue == NULL ) ! /* ! * This repository specification doesn't identify any named ! * package list, so try the default, (which is named to match ! * the XML key name for the "package-list" element)... */ ! client.GetPackageList( package_list_key ); ! else ! /* At least one package list catalogue is specified; load it, ! * and any others which are explicitly identified... */ ! client.GetPackageList( catalogue ); /* Similarly, a complete distribution may draw from an arbitrary set |
|
From: Keith M. <kei...@us...> - 2010-04-13 18:35:05
|
Update of /cvsroot/mingw/doc/chm/gnu/cvsdoc In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20784/chm/gnu/cvsdoc Added Files: .cvsignore Makefile checksums Log Message: Rename chm/gnu/cvs directory as chm/gnu/cvsdoc to avoid case-insensitive clash with CVS on Win32. --- NEW FILE: .cvsignore --- cookies download work --- NEW FILE: checksums --- b0b5e955c0d83b694c7835dc3e6f0b7d download/cvs-1.11.5.tar.gz --- NEW FILE: Makefile --- GARNAME = cvs GARVERSION = 1.11.5 MASTER_SITES = ftp://ftp.gnu.org/pub/non-gnu/$(GARNAME)/ DISTFILES = $(GARNAME)-$(GARVERSION).tar.gz BOOKS = $(WORKSRC)/doc/cvs.texinfo include ../../gar.mk |
|
From: Keith M. <kei...@us...> - 2010-04-13 18:13:35
|
Update of /cvsroot/mingw/doc/chm/gnu/cvsdoc In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11782/cvsdoc Log Message: Directory /cvsroot/mingw/doc/chm/gnu/cvsdoc added to the repository |
|
From: Keith M. <kei...@us...> - 2010-04-04 15:25:45
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv8618 Modified Files: pkgexec.cpp pkgkeys.c pkgkeys.h pkgproc.h tarproc.cpp Added Files: pkginst.cpp tarinst.cpp Log Message: Implement installer function; use per-package file manifests. Index: pkgkeys.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgkeys.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pkgkeys.h 2 Mar 2010 22:33:24 -0000 1.6 --- pkgkeys.h 4 Apr 2010 15:25:36 -0000 1.7 *************** *** 54,57 **** --- 54,58 ---- EXTERN_C_DECL const char *le_key; EXTERN_C_DECL const char *lt_key; + EXTERN_C_DECL const char *manifest_key; EXTERN_C_DECL const char *mirror_key; EXTERN_C_DECL const char *modified_key; *************** *** 62,65 **** --- 63,67 ---- EXTERN_C_DECL const char *pathname_key; EXTERN_C_DECL const char *profile_key; + EXTERN_C_DECL const char *reference_key; EXTERN_C_DECL const char *release_key; EXTERN_C_DECL const char *repository_key; Index: pkgexec.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgexec.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pkgexec.cpp 2 Mar 2010 22:33:18 -0000 1.6 --- pkgexec.cpp 4 Apr 2010 15:25:36 -0000 1.7 *************** *** 381,408 **** 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>" )); ! if( current->Selection( to_remove ) == NULL ) ! { ! pkgXmlNode *pkg = current->Selection(); ! if( ! match_if_explicit( pkg->ArchiveName(), value_none ) ) ! { ! pkgTarArchiveInstaller package( pkg ); ! if( package.IsOk() ) ! package.Process(); ! } ! } ! else ! dmh_notify( DMH_ERROR, ! "package %s is already installed\n", ! current->Selection()->GetPropVal( tarname_key, "<unknown>" ) ! ); ! } /* Proceed to next package with scheduled actions. --- 381,389 ---- if( (current->flags & ACTION_INSTALL) == ACTION_INSTALL ) ! /* ! * The selected package has been marked for installation, either explicitly, * or implicitly to complete a package upgrade. */ ! pkgInstall( current ); /* Proceed to next package with scheduled actions. Index: pkgkeys.c =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgkeys.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pkgkeys.c 2 Mar 2010 22:33:24 -0000 1.6 --- pkgkeys.c 4 Apr 2010 15:25:36 -0000 1.7 *************** *** 43,46 **** --- 43,47 ---- const char *le_key = "le"; const char *lt_key = "lt"; + const char *manifest_key = "manifest"; const char *mirror_key = "mirror"; const char *modified_key = "modified"; *************** *** 51,54 **** --- 52,56 ---- const char *pathname_key = "path"; const char *profile_key = "profile"; + const char *reference_key = "references"; const char *release_key = "release"; const char *repository_key = "repository"; Index: tarproc.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/tarproc.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tarproc.cpp 2 Mar 2010 21:07:00 -0000 1.4 --- tarproc.cpp 4 Apr 2010 15:25:36 -0000 1.5 *************** *** 53,58 **** --- 53,61 ---- * First, we anticipate an invalid initialisation state... */ + sysroot_len = 0; + sysroot = NULL; sysroot_path = NULL; + installed = NULL; stream = NULL; *************** *** 61,66 **** * tarname to identify the package... */ ! if( (pkg != NULL) && pkg->IsElementOfType( release_key ) ! && ((tarname = pkg->GetPropVal( tarname_key, NULL )) != NULL) ) { /* When these pre-conditions are satisfied, we may proceed --- 64,69 ---- * tarname to identify the package... */ ! if( ((origin = pkg) != NULL) && pkg->IsElementOfType( release_key ) ! && ((tarname = pkg->GetPropVal( tarname_key, NULL )) != NULL) ) { /* When these pre-conditions are satisfied, we may proceed *************** *** 83,87 **** const char *template_format = "%F%%/M/%%F"; char template_text[mkpath( NULL, template_format, prefix, NULL )]; ! mkpath( template_text, template_format, prefix, NULL ); sysroot_path = strdup( template_text ); } --- 86,90 ---- const char *template_format = "%F%%/M/%%F"; char template_text[mkpath( NULL, template_format, prefix, NULL )]; ! sysroot_len = mkpath( template_text, template_format, prefix, NULL ) - 6; sysroot_path = strdup( template_text ); } *************** *** 105,113 **** pkgTarArchiveProcessor::~pkgTarArchiveProcessor() { ! /* Destructor must release the heap memory allocated in the ! * constructor, (by strdup), clean up the decompression filter ! * state, and close the archive data stream. */ free( (void *)(sysroot_path) ); delete stream; } --- 108,118 ---- pkgTarArchiveProcessor::~pkgTarArchiveProcessor() { ! /* Destructor must release the heap memory allocated in ! * the constructor, (by strdup and pkgManifest), clean up ! * the decompression filter state, and close the archive ! * data stream. */ free( (void *)(sysroot_path) ); + delete installed; delete stream; } *************** *** 238,251 **** * of directories, to establish a location within the sysroot * hierarchy... - * - * Note: Microsoft's implementation of stat() appears to choke - * on directory path names with trailing slashes; thus, before - * we invoke the directory processing routine, (which may need - * to call stat(), to check if the specified directory already - * exists), we remove any such trailing slashes. */ ! char *p = pathname + sizeof( pathname ) - 1; ! while( (p > pathname) && ((*--p == '/') || (*p == '\\')) ) ! *p = '\0'; /* We are now ready to process the directory path name entry... --- 243,257 ---- * of directories, to establish a location within the sysroot * hierarchy... */ ! { /* Note: Microsoft's implementation of stat() appears to choke ! * on directory path names with trailing slashes; thus, before ! * we invoke the directory processing routine, (which may need ! * to call stat(), to check if the specified directory already ! * exists), we remove any such trailing slashes. ! */ ! char *p = pathname + sizeof( pathname ) - 1; ! while( (p > pathname) && ((*--p == '/') || (*p == '\\')) ) ! *p = '\0'; ! } /* We are now ready to process the directory path name entry... *************** *** 374,526 **** } - /* Here, we implement the methods for installing software from - * packages which are distributed in the form of tar archives. - * - */ - #include <utime.h> - - static int commit_saved_entity( const char *pathname, time_t mtime ) - { - /* Helper to set the access and modification times for a file, - * after extraction from an archive, to match the specified "mtime"; - * (typically "mtime" is as recorded within the archive). - */ - struct utimbuf timestamp; - - timestamp.actime = timestamp.modtime = mtime; - return utime( pathname, ×tamp ); - } - - pkgTarArchiveInstaller:: - pkgTarArchiveInstaller( pkgXmlNode *pkg ):pkgTarArchiveProcessor( pkg ) - { - /* Constructor: having set up the pkgTarArchiveProcessor base class, - * we add a package installation record to the sysroot entry in the - * XML database, and mark that sysroot entry as 'modified'. - */ - if( (tarname != NULL) && (sysroot != NULL) && stream->IsReady() ) - { - /* The installation record must identify, as a minimum, - * the canonical name of the package being installed. - */ - installed = new pkgXmlNode( installed_key ); - installed->SetAttribute( tarname_key, tarname ); - if( pkgfile != tarname ) - { - /* If the real package tarball name isn't identically - * the same as the canonical name, we record the real - * file name too. - */ - pkgXmlNode *download = new pkgXmlNode( download_key ); - download->SetAttribute( tarname_key, pkgfile ); - installed->AddChild( download ); - } - - /* Set the 'modified' flag for, and attach the installation - * record to, the relevant sysroot record. - * - * FIXME: We should defer this until AFTER the archive has - * been successfully processed, (in the destructor, perhaps?), - * cleaning up, and not updating the installation manifest, - * in the event of an archive processing failure. - */ - sysroot->SetAttribute( modified_key, yes_value ); - sysroot->AddChild( installed ); - } - } - - int pkgTarArchiveInstaller::ProcessDirectory( const char *pathname ) - { - /* Create the directory infrastructure required to support - * a specific package installation. - */ - #if DEBUGLEVEL < 5 - int status; - - if( (status = mkdir_recursive( pathname, 0755 )) == 0 ) - /* - * Either the specified directory already exists, - * or we just successfully created it; attach a reference - * in the installation manifest for the current package. - */ - UpdateInstallationManifest( dirname_key, pathname ); - - else - /* A required subdirectory could not be created; - * diagnose this failure. - */ - dmh_notify( DMH_ERROR, "cannot create directory `%s'\n", pathname ); - - #else - /* Debugging stub... - * - * FIXME:maybe adapt for 'dry-run' or 'verbose' use. - */ - int status = 0; - - dmh_printf( - "FIXME:ProcessDirectory<stub>:not executing: mkdir -p %s\n", - pathname - ); - #endif - return status; - } - - int pkgTarArchiveInstaller::ProcessDataStream( const char *pathname ) - { - /* Extract file data from the archive, and copy it to the - * associated target file stream, if any. - */ - #if DEBUGLEVEL < 5 - int fd = set_output_stream( pathname, octval( header.field.mode ) ); - int status = ProcessEntityData( fd ); - if( fd >= 0 ) - { - /* File stream was written; close it... - */ - close( fd ); - if( status == 0 ) - { - /* ...and on successful completion, commit it and - * record it in the installation database. - */ - commit_saved_entity( pathname, octval( header.field.mtime ) ); - UpdateInstallationManifest( filename_key, pathname ); - } - - else - { - /* The target file was not successfully and completely - * written; discard it, and diagnose failure. - */ - unlink( pathname ); - dmh_notify( DMH_ERROR, "%s: extraction failed\n", pathname ); - } - } - return status; - - #else - /* Debugging stub... - * - * FIXME:maybe adapt for 'dry-run' or 'verbose' use. - */ - dmh_printf( - "FIXME:ProcessDataStream<stub>:not extracting: %s\n", - pathname - ); - return ProcessEntityData( -1 ); - #endif - } - - void pkgTarArchiveInstaller:: - UpdateInstallationManifest( const char *key, const char *pathname ) - { - /* Write installation database records for directory - * and file entities created during archive extraction. - */ - pkgXmlNode *dir = new pkgXmlNode( key ); - dir->SetAttribute( pathname_key, pathname ); - installed->AddChild( dir ); - } - /* $RCSfile$: end of file */ --- 380,382 ---- --- NEW FILE: pkginst.cpp --- /* * pkginst.cpp * * $Id: pkginst.cpp,v 1.1 2010/04/04 15:25:36 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2010, MinGW Project * * * Implementation of the primary package installation and package * manifest recording methods. * * * 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 <unistd.h> #include "dmh.h" #include "pkginfo.h" #include "pkgkeys.h" #include "pkgproc.h" EXTERN_C const char *hashed_name( int, const char *, const char * ); pkgManifest::pkgManifest( const char *tag, const char *tarname ) { /* Construct an in-memory image for processing a package manifest. * * We begin by initialising this pair of reference pointers, * assuming that this manifest may become invalid... */ manifest = NULL; inventory = NULL; /* Then we check that a package tarname has been provided... */ if( tarname != NULL ) { /* ...in which case, we proceed to set up the reference data... */ int retry = 0; while( retry < 16 ) { /* Generate a hashed signature for the package manifest * 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. */ pkgXmlDocument *chkfile; const char *signame = hashed_name( retry++, manifest_key, tarname ); const char *sigfile = xmlfile( signame, NULL ); /* Check for an existing file associated with the hash value... */ if( (chkfile = new pkgXmlDocument( sigfile ))->IsOk() ) { /* ...such a file does exist, but we must still check * that it relates to the specified package... */ 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, *rel; const char *pkg_id, *pkg_tarname; if( ((root = chkfile->GetRoot()) != NULL) && ((root->IsElementOfType( tag ))) && ((pkg_id = root->GetPropVal( id_key, NULL )) != NULL) && ((strcmp( pkg_id, signame ) == 0)) && ((rel = root->FindFirstAssociate( release_key )) != NULL) && ((pkg_tarname = rel->GetPropVal( tarname_key, NULL )) != NULL) && ((pkg_strcmp( pkg_tarname, tarname ))) ) { /* This is the manifest file we require... * assign it for return, and force an early exit * from the retry loop. */ manifest = chkfile; 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 manifest for the specified package; * immediately assign the current (unused) manifest name, * and initialise its root element... */ pkgXmlNode *root = new pkgXmlNode( tag ); (manifest = chkfile)->AddDeclaration( "1.0", "UTF-8", value_yes ); root->SetAttribute( id_key, signame ); manifest->SetRoot( root ); /* ...a container, to be filled later, for recording the * data associated with the specific release of the package * to which this manifest will refer... */ pkgXmlNode *ref = new pkgXmlNode( release_key ); ref->SetAttribute( tarname_key, tarname ); root->AddChild( ref ); /* ...a further container, in which to record the sysroot * associations for installed instances of this package... */ ref = new pkgXmlNode( reference_key ); root->AddChild( ref ); /* ...and one in which to accumulate the content manifest. */ inventory = new pkgXmlNode( manifest_key ); root->AddChild( inventory ); /* Finally, having constructed a skeletal manifest, * force an immediate exit from the retry loop... */ retry = 16; } /* Before abandoning our references to the current hash * signature, and the path name for the associated XML file, * free the memory allocated for them. */ free( (void *)(sigfile) ); free( (void *)(signame) ); /* If we have not yet exhausted all possible hashed file names... */ if( retry < 16 ) /* * ...free the heap memory allocated for the current (unsuitable) * association, so making its "chkfile" reference pointer available * for the next trial, without incurring a memory leak. */ delete chkfile; } } } void pkgManifest::BindSysRoot( pkgXmlNode *sysroot, const char *reference_tag ) { /* Identify the package associated with the current manifest as * having been installed within the specified sysroot, by tagging * with a manifest reference to the sysroot identification key. */ const char *id; if( ((id = sysroot->GetPropVal( id_key, NULL )) != NULL) && (*id != '\0') ) { /* The specified sysroot has a non-NULL, non-blank key; * check for a prior reference to the same key, within the * "references" section of the manifest... */ pkgXmlNode *map, *ref; if( ((ref = manifest->GetRoot()) != NULL) && ((ref->IsElementOfType( reference_tag ))) && ((map = ref->FindFirstAssociate( reference_key )) == NULL) ) { /* This manifest doesn't yet have a "references" section; * create and add one now... */ map = new pkgXmlNode( reference_key ); ref->AddChild( map ); } /* Examine any existing sysroot references within this manifest... */ ref = map->FindFirstAssociate( sysroot_key ); while( (ref != NULL) && (strcmp( id, ref->GetPropVal( id_key, id )) != 0) ) /* * ...progressing to the next reference, if any, until... */ ref = ref->FindNextAssociate( sysroot_key ); /* ...we either matched the required sysroot key, or we * ran out of existing references, without finding a match. */ if( ref == NULL ) { /* When no existing reference was found, add one. */ ref = new pkgXmlNode( sysroot_key ); ref->SetAttribute( id_key, id ); map->AddChild( ref ); } } } void pkgManifest::AddEntry( const char *key, const char *pathname ) { /* Method invoked by package installers, to add file or directory * entries to the tracked inventory of package content. * * Tracking is enabled only if the manifest structure is valid, * AND an inventory table has been allocated... */ if( (this != NULL) && (inventory != NULL) ) { /* ...in which case we allocate a new tracking record, with * "dir" or "file" reference key as appropriate, fill it out * with the associated path name attribute, and insert it in * the inventory table. */ pkgXmlNode *entry = new pkgXmlNode( key ); entry->SetAttribute( pathname_key, pathname ); inventory->AddChild( entry ); } } pkgManifest::~pkgManifest() { /* Destructor for package manifest images; it releases * the memory used while processing a manifest, after first * committing the image to disk storage, or deleting such * a disk image as appropriate. */ pkgXmlNode *ref; const char *sigfile; /* First confirm that an identification signature has been * assigned for this manifest... */ if( ((manifest != NULL)) && ((ref = manifest->GetRoot()) != NULL) && ((sigfile = ref->GetPropVal( id_key, NULL )) != NULL) ) { /* ...and map this to a file system reference path name. */ sigfile = xmlfile( sigfile ); /* Check if any current installation, as identified by * its sysroot key, refers to this manifest... */ if( ((ref = ref->FindFirstAssociate( reference_key )) != NULL) && ((ref = ref->FindFirstAssociate( sysroot_key )) != NULL) ) /* * ...and if so, commit this manifest to disk... */ manifest->Save( sigfile ); else /* ...otherwise, this manifest is defunct, so * delete any current disk copy. */ unlink( sigfile ); /* Release the memory used to identify the path name for * the on-disk copy of this manifest... */ free( (void *)(sigfile) ); } /* ...and finally, expunge its in-memory image. */ delete manifest; } static void record_dependencies( pkgXmlNode *origin, pkgXmlNode *list ) { /* Helper function to record dependency call-outs for the package * which is specified by the XML descriptor reference at "origin", * (which should nominally represent a "release" specification for * the package); the call-out references are collected in the XML * container referenced by "list". */ if( (origin != NULL) && (list != NULL) ) { /* Assume "origin" and "list" represent appropriate XML objects... */ if( ! origin->IsElementOfType( package_key ) ) /* * ...and walk back through the "origin" tree, until we locate * the top level node in the "package" specification. */ record_dependencies( origin->GetParent(), list ); /* As we unwind this recursive walk back search, we copy all * "requires" elements, at each intervening level, from the top * "package" node until we return to the original "release"... */ pkgXmlNode *dep = origin->FindFirstAssociate( requires_key ); while( dep != NULL ) { /* ...each as a simple clone within the "list" container, * (and all at a single level within the "list")... */ list->AddChild( dep->Clone() ); /* ...repeating for all specified "requires" elements * at each level. */ dep = dep->FindNextAssociate( requires_key ); } } } EXTERN_C void pkgRegister ( pkgXmlNode *sysroot, pkgXmlNode *origin, const char *tarname, const char *pkgfile ) { /* Search the installation records for the current sysroot... */ const char *pkg_tarname = NULL; pkgXmlNode *ref = sysroot->FindFirstAssociate( installed_key ); while( (ref != NULL) && ((pkg_tarname = ref->GetPropVal( tarname_key, NULL )) != NULL) && ! (pkg_strcmp( tarname, pkg_tarname )) ) /* * ...continuing until we either run out of installation records, * or we find an already existing reference to this package. */ ref = ref->FindNextAssociate( installed_key ); /* When we didn't find an appropriate existing installation record, * we instantiate a new one... */ if( (ref == NULL) && ((ref = new pkgXmlNode( installed_key )) != NULL) ) { /* Fill out its "tarname" attribution... */ ref->SetAttribute( tarname_key, tarname ); if( pkgfile != tarname ) { /* When the real package tarball name isn't identically * the same as the canonical name, then we record the real * file name too. */ pkgXmlNode *dl = new pkgXmlNode( download_key ); dl->SetAttribute( tarname_key, pkgfile ); ref->AddChild( dl ); } /* Record dependency call-outs for the installed package. */ record_dependencies( origin, ref ); /* Set the 'modified' flag for, and attach the installation * record to, the relevant sysroot record. */ sysroot->SetAttribute( modified_key, value_yes ); sysroot->AddChild( ref ); } } EXTERN_C void pkgInstall( pkgActionItem *current ) { /* Common handler for all package installation tasks... */ pkgXmlNode *pkg; if( (pkg = current->Selection()) != NULL ) { /* The current action item has a valid package association... */ if( current->Selection( to_remove ) == NULL ) { /* The selected package has either not yet been installed, * or any prior installation has been removed in preparation * for re-installation or upgrade. */ const char *pkgfile, *tarname; if( match_if_explicit( pkgfile = pkg->ArchiveName(), value_none ) && ((tarname = pkg->GetPropVal( tarname_key, NULL )) != NULL) ) { /* In this case, the selected package has no associated archive, * (i.e. it is a "virtual" package); provided we can identify an * associated "sysroot"... */ pkgXmlNode *sysroot; pkgSpecs lookup( tarname ); if( (sysroot = pkg->GetSysRoot( lookup.GetSubSystemName() )) != NULL ) /* * ...the installation process becomes a simple matter of * recording the state of this virtual package as "installed", * in the sysroot manifest, and itemising its prerequisites. */ pkgRegister( sysroot, pkg, tarname, pkgfile ); } else { /* Here we have a "real" (physical) package to install; * for the time being, we assume it is packaged in our * standard "tar" archive format. */ pkgTarArchiveInstaller install( pkg ); if( install.IsOk() ) install.Process(); } } else /* There is a prior installation of the selected package, which * prevents us from proceeding; diagnose and otherwise ignore... */ dmh_notify( DMH_ERROR, "package %s is already installed\n", current->Selection()->GetPropVal( tarname_key, "<unknown>" ) ); } } /* $RCSfile: pkginst.cpp,v $: end of file */ --- NEW FILE: tarinst.cpp --- /* * tarinst.cpp * * $Id: tarinst.cpp,v 1.1 2010/04/04 15:25:36 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2009, 2010, MinGW Project * * * Implementation of package installer methods for installation of * packages which are distributed in the form of tar archives. * * * 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 <unistd.h> #include <utime.h> #include "dmh.h" //#include "pkginfo.h" #include "pkgkeys.h" #include "pkgproc.h" static int commit_saved_entity( const char *pathname, time_t mtime ) { /* Helper to set the access and modification times for a file, * after extraction from an archive, to match the specified "mtime"; * (typically "mtime" is as recorded within the archive). */ struct utimbuf timestamp; timestamp.actime = timestamp.modtime = mtime; return utime( pathname, ×tamp ); } pkgTarArchiveInstaller:: pkgTarArchiveInstaller( pkgXmlNode *pkg ):pkgTarArchiveProcessor( pkg ) { /* Constructor: having successfully set up the pkgTarArchiveProcessor * base class, we attach a pkgManifest to track the installation. */ if( (tarname != NULL) && (sysroot != NULL) && stream->IsReady() ) installed = new pkgManifest( package_key, tarname ); } int pkgTarArchiveInstaller::Process() { /* Specialisation of the base class Process() method. */ int status; /* First, process the archive as for the base class... */ if( (status = pkgTarArchiveProcessor::Process()) == 0 ) { /* ...then, on successful completion... * * Update the package installation manifest, to record * the installation in the current sysroot... */ installed->BindSysRoot( sysroot, package_key ); pkgRegister( sysroot, origin, tarname, pkgfile ); } return status; } int pkgTarArchiveInstaller::ProcessDirectory( const char *pathname ) { /* Create the directory infrastructure required to support * a specific package installation. */ #if DEBUGLEVEL < 5 int status; if( (status = mkdir_recursive( pathname, 0755 )) == 0 ) /* * Either the specified directory already exists, * or we just successfully created it; attach a reference * in the installation manifest for the current package. */ installed->AddEntry( dirname_key, pathname + sysroot_len ); else /* A required subdirectory could not be created; * diagnose this failure. */ dmh_notify( DMH_ERROR, "cannot create directory `%s'\n", pathname ); #else /* Debugging stub... * * FIXME:maybe adapt for 'dry-run' or 'verbose' use. */ int status = 0; dmh_printf( "FIXME:ProcessDirectory<stub>:not executing: mkdir -p %s\n", pathname ); # if DEBUGLEVEL > 8 installed->AddEntry( dirname_key, pathname + sysroot_len ); # endif #endif return status; } int pkgTarArchiveInstaller::ProcessDataStream( const char *pathname ) { /* Extract file data from the archive, and copy it to the * associated target file stream, if any. */ #if DEBUGLEVEL < 5 int fd = set_output_stream( pathname, octval( header.field.mode ) ); int status = ProcessEntityData( fd ); if( fd >= 0 ) { /* File stream was written; close it... */ close( fd ); if( status == 0 ) { /* ...and on successful completion, commit it and * record it in the installation database. */ commit_saved_entity( pathname, octval( header.field.mtime ) ); installed->AddEntry( filename_key, pathname + sysroot_len ); } else { /* The target file was not successfully and completely * written; discard it, and diagnose failure. */ unlink( pathname ); dmh_notify( DMH_ERROR, "%s: extraction failed\n", pathname ); } } return status; #else /* Debugging stub... * * FIXME:maybe adapt for 'dry-run' or 'verbose' use. */ dmh_printf( "FIXME:ProcessDataStream<stub>:not extracting: %s\n", pathname ); # if DEBUGLEVEL > 8 installed->AddEntry( filename_key, pathname + sysroot_len ); # endif return ProcessEntityData( -1 ); #endif } /* $RCSfile: tarinst.cpp,v $: end of file */ Index: pkgproc.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgproc.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkgproc.h 10 Feb 2010 22:18:59 -0000 1.2 --- pkgproc.h 4 Apr 2010 15:25:36 -0000 1.3 *************** *** 33,36 **** --- 33,57 ---- #include "pkgstrm.h" + EXTERN_C void pkgInstall( pkgActionItem* ); + EXTERN_C void pkgRegister( pkgXmlNode*, pkgXmlNode*, const char*, const char* ); + + class pkgManifest + { + /* A wrapper around the XML document class, with specialised methods + * for management of the package installation manifest. + */ + public: + pkgManifest( const char*, const char* ); + ~pkgManifest(); + + void AddEntry( const char*, const char* ); + void BindSysRoot( pkgXmlNode*, const char* ); + void DetachSysRoot( pkgXmlNode* ); + + private: + pkgXmlDocument *manifest; + pkgXmlNode *inventory; + }; + class pkgArchiveProcessor { *************** *** 46,49 **** --- 67,72 ---- protected: + int sysroot_len; + /* Pointers to the sysroot management records and installation * path template for a managed package; note that 'tarname' does *************** *** 52,60 **** * 'tarname' property of the package identifier record. */ ! pkgXmlNode *sysroot; ! const char *sysroot_path; ! pkgXmlNode *installed; ! const char *tarname; ! const char *pkgfile; }; --- 75,84 ---- * 'tarname' property of the package identifier record. */ ! pkgXmlNode *origin; ! pkgXmlNode *sysroot; ! const char *sysroot_path; ! pkgManifest *installed; ! const char *tarname; ! const char *pkgfile; }; *************** *** 157,160 **** --- 181,186 ---- virtual ~pkgTarArchiveInstaller(){} + virtual int Process(); + private: /* Specialised implementations of the archive processing methods... *************** *** 162,166 **** virtual int ProcessDirectory( const char* ); virtual int ProcessDataStream( const char* ); - virtual void UpdateInstallationManifest( const char*, const char* ); }; --- 188,191 ---- |
|
From: Keith M. <kei...@us...> - 2010-04-04 15:22:16
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv8122 Modified Files: ChangeLog Makefile.in Log Message: Implement installer function; use per-package file manifests. Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile.in 23 Mar 2010 19:04:55 -0000 1.12 --- Makefile.in 4 Apr 2010 15:22:07 -0000 1.13 *************** *** 57,64 **** pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) pkgdeps.$(OBJEXT) \ ! mkpath.$(OBJEXT) tarproc.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ ! tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \ ! vercmp.$(OBJEXT) dmh.$(OBJEXT) all: pkginfo$(EXEEXT) mingw-get$(EXEEXT) mingw-get-0.dll --- 57,64 ---- pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \ sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) pkgdeps.$(OBJEXT) \ ! mkpath.$(OBJEXT) pkginst.$(OBJEXT) tarinst.$(OBJEXT) tarproc.$(OBJEXT) \ ! xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) dmh.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ ! tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) all: pkginfo$(EXEEXT) mingw-get$(EXEEXT) mingw-get-0.dll Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ChangeLog 2 Apr 2010 08:38:04 -0000 1.35 --- ChangeLog 4 Apr 2010 15:22:07 -0000 1.36 *************** *** 1,2 **** --- 1,55 ---- + 2010-04-04 Keith Marshall <kei...@us...> + + Implement installer function; use per-package file manifests. + + * src/pkgproc.h (pkgManifest): New class; declare it. + (pkgArchiveProcessor::origin): New protected member variable. + (pkgArchiveProcessor::sysroot_len): New protected member variable. + (pkgArchiveProcessor::installed): Type changed to `pkgManifest *'. + (pkgTarArchiveInstaller::Process): Declare specialisation hook. + (pkgTarArchiveInstaller::UpdateInstallationManifest): Disused member + function; remove redundant declaration from class definition. + (pkgInstall): New generalised installation function; declare it. + (pkgRegister): New function; declare it. + + * src/pkginst.cpp: New file. + (pkgManifest, pkgInstall, pkgRegister): Implement them. + + * src/pkgexec.cpp (pkgActionItem::Execute): Use `pkgInstall' in place + of stub formerly provided here. + + * src/pkgkeys.h (manifest_key, reference_key): New keys; declare them. + * src/pkgkeys.c (manifest_key, reference_key): Implement them. + + * src/tarproc.cpp: Code refactored. + (pkgTarArchiveProcessor::sysroot_len): Initialise it. + (pkgTarArchiveProcessor::origin): Initialise it. + (pkgTarArchiveProcessor::installed): Initialise; associate it with a + pkgManifest class entity, and populate this as appropriate. + (pkgTarArchiveProcessor::~pkgTarArchiveProcessor): Add explicit clean + up of linked `pkgManifest *' entity referenced by `installed'. + (pkgTarArchiveProcessor::Process) [TAR_ENTITY_TYPE_DIRECTORY]: Add + braces to demarcate localised inner scope of string scan for removal + of trailing directory name separators; (thanks to Cesar Strauss for + reporting invalid local pointer declaration error in GCC >= 4.4). + (pkgTarArchiveInstaller::UpdateInstallationManifest): Deleted. + (pkgTarArchiveInstaller::pkgTarArchiveInstaller): Factor out. + (pkgTarArchiveInstaller::ProcessDirectory): Likewise. + (pkgTarArchiveInstaller::ProcessDataStream): Likewise. + (commit_saved_entity): Likewise. + + * src/tarinst.cpp: New file; it implements... + (pkgTarArchiveInstaller::Process): ...this new specialisation + of the original pkgTarArchiveProcessor::Process method... + (pkgTarArchiveInstaller::pkgTarArchiveInstaller): ...and this + refactored code, abstracted from src/tarproc.cpp and modified to + use the pkgManifest class for installation tracking. + (pkgTarArchiveInstaller::ProcessDirectory): Likewise. + (pkgTarArchiveInstaller::ProcessDataStream): Likewise. + (commit_saved_entity): Relocated from src/tarproc.cpp. + + * Makefile.in (CORE_DLL_OBJECTS): Add... + (pkginst.OBJEXT, tarinst.OBJEXT): ...these new object files. + 2010-03-31 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-04-02 08:38:12
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv6793 Modified Files: ChangeLog Log Message: Guard against NULL pointer dereferences in tinyxml code. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ChangeLog 30 Mar 2010 20:29:26 -0000 1.34 --- ChangeLog 2 Apr 2010 08:38:04 -0000 1.35 *************** *** 1,2 **** --- 1,14 ---- + 2010-03-31 Keith Marshall <kei...@us...> + + Guard against NULL pointer dereferences in tinyxml code. + + * src/pkgbase.h (pkgXmlNode::GetName): Verify `this' pointer is + non-NULL, before invoking the underlying tinyxml method. + (pkgXmlNode::GetParent, pkgXmlNode::GetChildren): Likewise. + (pkgXmlNode::GetNext, pkgXmlNode::GetPropVal): Likewise. + (pkgXmlNode::AddChild, pkgXmlNode::DeleteChild): Likewise. + (pkgXmlNode::GetDocumentRoot): Likewise. + (pkgXmlNode::IsElementOfType): Likewise. + 2010-03-28 Cesar Strauss <ces...@gm...> |
|
From: Keith M. <kei...@us...> - 2010-04-02 08:38:12
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv6793/src Modified Files: pkgbase.h Log Message: Guard against NULL pointer dereferences in tinyxml code. Index: pkgbase.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgbase.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pkgbase.h 22 Mar 2010 19:39:06 -0000 1.6 --- pkgbase.h 2 Apr 2010 08:38:04 -0000 1.7 *************** *** 85,88 **** --- 85,92 ---- /* Accessors... + * + * Note that tinyxml is generally careless about checking for + * possible dereferencing of NULL pointers; thus, many of these + * wrappers include appropriate checks, to prevent this. */ inline const char* GetName() *************** *** 91,95 **** * tinyxml calls this the element "value"... */ ! return Value(); } inline pkgXmlNode* GetParent() --- 95,99 ---- * tinyxml calls this the element "value"... */ ! return this ? Value() : NULL; } inline pkgXmlNode* GetParent() *************** *** 98,102 **** * Parent() method. */ ! return (pkgXmlNode*)(Parent()); } inline pkgXmlNode* GetChildren() --- 102,106 ---- * Parent() method. */ ! return this ? (pkgXmlNode*)(Parent()) : NULL; } inline pkgXmlNode* GetChildren() *************** *** 106,110 **** * FirstChild() method in tinyxml's arsenal. */ ! return (pkgXmlNode*)(FirstChild()); } inline pkgXmlNode* GetNext() --- 110,114 ---- * FirstChild() method in tinyxml's arsenal. */ ! return this ? (pkgXmlNode*)(FirstChild()) : NULL; } inline pkgXmlNode* GetNext() *************** *** 114,118 **** * it is equivalent to tinyxml's NextSibling(). */ ! return (pkgXmlNode*)(NextSibling()); } inline const char* GetPropVal( const char* name, const char* subst ) --- 118,122 ---- * it is equivalent to tinyxml's NextSibling(). */ ! return this ? (pkgXmlNode*)(NextSibling()) : NULL; } inline const char* GetPropVal( const char* name, const char* subst ) *************** *** 122,126 **** * but it may be trivially emulated, using the Attribute() method. */ ! const char* retval = Attribute( name ); return retval ? retval : subst; } --- 126,130 ---- * but it may be trivially emulated, using the Attribute() method. */ ! const char* retval = this ? Attribute( name ) : subst; return retval ? retval : subst; } *************** *** 130,134 **** * equivalent to tinyxml's LinkEndChild() method. */ ! return (pkgXmlNode*)(LinkEndChild( child )); } inline bool DeleteChild( pkgXmlNode *child ) --- 134,138 ---- * equivalent to tinyxml's LinkEndChild() method. */ ! return this ? (pkgXmlNode*)(LinkEndChild( child )) : NULL; } inline bool DeleteChild( pkgXmlNode *child ) *************** *** 139,143 **** * would use RemoveChild followed by `delete child'. */ ! return RemoveChild( child ); } --- 143,147 ---- * would use RemoveChild followed by `delete child'. */ ! return this ? RemoveChild( child ) : false; } *************** *** 148,152 **** /* Convenience method to retrieve a pointer to the document root. */ ! return (pkgXmlNode*)(GetDocument()->RootElement()); } inline bool IsElementOfType( const char* tagname ) --- 152,156 ---- /* Convenience method to retrieve a pointer to the document root. */ ! return this ? (pkgXmlNode*)(GetDocument()->RootElement()) : NULL; } inline bool IsElementOfType( const char* tagname ) *************** *** 155,159 **** * with the specified "tagname". */ ! return strcmp( GetName(), tagname ) == 0; } --- 159,163 ---- * with the specified "tagname". */ ! return this ? strcmp( GetName(), tagname ) == 0 : false; } *************** *** 181,184 **** --- 185,189 ---- enum { to_remove = 0, to_install, selection_types }; + class pkgActionItem { |