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
|
5
|
6
(3) |
|
7
|
8
|
9
|
10
(2) |
11
|
12
|
13
|
|
14
|
15
|
16
(3) |
17
|
18
|
19
|
20
|
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
|
28
|
|
|
|
|
|
|
|
From: Keith M. <kei...@us...> - 2010-02-16 21:58:17
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24221 Modified Files: ChangeLog configure.ac Log Message: mingw-get-0.1-mingw32-alpha-1 released. Index: configure.ac =================================================================== RCS file: /cvsroot/mingw/mingw-get/configure.ac,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure.ac 6 Feb 2010 15:29:56 -0000 1.3 --- configure.ac 16 Feb 2010 21:58:06 -0000 1.4 *************** *** 23,27 **** # 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"]) --- 23,27 ---- # arising from the use of this software. # ! AC_INIT([mingw-get],[0.1-alpha-2],[http://mingw.org/reporting_bugs]) AC_SUBST([COPYRIGHT_HOLDER],["MinGW Project"]) Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ChangeLog 16 Feb 2010 20:50:11 -0000 1.25 --- ChangeLog 16 Feb 2010 21:57:47 -0000 1.26 *************** *** 1,4 **** --- 1,14 ---- 2010-02-16 Keith Marshall <kei...@us...> + Bump version for next release cycle. + + * configure.ac (AC_INIT): Bump version suffix to alpha-2. + + 2010-02-16 Keith Marshall <kei...@us...> + + mingw-get-0.1-mingw32-alpha-1 released. + + 2010-02-16 Keith Marshall <kei...@us...> + Prepare initial package release. |
|
From: Keith M. <kei...@us...> - 2010-02-16 20:51:52
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8888 Modified Files: ChangeLog Makefile.in Added Files: README Log Message: Prepare initial package release. --- NEW FILE: README --- Release Notes for mingw-get-0.1-mingw32-alpha-1 $Id: README,v 1.1 2010/02/16 20:51:07 keithmarshall Exp $ Preamble -------- This is the first alpha release of the next generation MinGW installer, mingw-get; it provides a more readily extensible, and more configurable alternative to the existing MinGW-5.1.x series of NSIS installers, for installing MinGW packages. mingw-get is free software. Permission is granted to copy, modify and redistribute it, 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 mingw-get 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 authors, or the MinGW Project, accept liability for any damages, however caused, arising from the use of this software. At the time of this release, mingw-get is still in the early stages of development; this release provides an opportunity for early adopters to evaluate the CLI capabilities of the installer component; please report bugs, (but please, not the known issues identified below), to the MinGW bug tracker: http://sourceforge.net/tracker/?group_id=2435&atid=102435 Installation ------------ To install mingw-get, visit the MinGW files repository at: http://sourceforge.net/projects/mingw/files and, from the "Automated MinGW Installer/mingw-get" folder, download your choice of either: mingw-get-0.1-mingw32-alpha-1-bin.zip or: mingw-get-0.1-mingw32-alpha-1-bin.tar.gz and unpack it into the directory in which you intend to host your MinGW installation, (the standard default of C:\MinGW [*] is recommended), then use your preferred method for assignment of environmet variables to add the appropriate directory, (default C:\MinGW\bin), to your PATH. [*] If you insist on adopting a different directory from the recommended default, you are *strongly* recommended to avoid any directory which has white space in its absolute path name; in particular, those who choose to ignore this advice, and install MinGW within "C:\Program Files", usually discover, to their cost, that certain tools do not work correctly. Configuration ------------- If you have installed mingw-get in the default location, you will find its primary configuration file at: C:\MinGW\var\lib\mingw-get\data\profile.xml (if you chose a different location, replace "C:\MinGW" with your chosen installation prefix directory path name). This is a liberally commented XML file, which you are free to modify as you see fit, to suit your own installation requirements. At the present time, the only entries you should consider changing are the path names specified by the "path" attribute associated with each of the "sysroot" elements within the first (only) "system-map" element. (These specify the prefix directory path names for your installation; you probably want to make the path for the "mingw32" subsystem to match your choice for your mingw-get installation, if you chose not to adopt the default, in which case you will probably also prefer an alternative choice for the MSYS subsystem, if you intend to install that). If you do choose to modify the configuration, you are advised to keep a backup copy of your modified version, since, particularly during the alpha phase of development, it may be necessary to overwrite your local version with an updated distributed version, then fold in your changes once more. Invocation ---------- Invoking mingw-get from the command line, without arguments, is intended to launch a GUI variant of the application, (but currently, this mode is not supported; if you try it, you *will* see only an error message). To invoke the CLI variant of mingw-get, the syntax is: mingw-get [-option ...] action [package ...] Currently supported options are: -version display the version banner, and exit Currently supported actions are: update synchronise the locally cached version of the distribution manifest with the version held at the repository. install package ... install the specified package(s), and any necessary prerequisites. upgrade package ... upgrade package(s) from the installed version to the newest version available, (if not already at the newest version). remove package ... uninstall package(s). Currently known packages are: mingwrt the mingw32 runtime libraries. w32api the MS-Windows API bindings for mingw32. binutils the GNU binary file utilities. gcc the GNU C Compiler (currently v3.4.5) g++ the C++ front-end for GCC-3.4.5 g77 the FORTRAN-77 front-end for GCC-3.4.5 ada the Ada front-end for GCC-3.4.5 java the java front-end for GCC-3.4.5 objc the Objective-C front-end for GCC-3.4.5 mingw32-make native MS-Win32 build of GNU make. Known Issues ------------ Please do not file bug reports, in respect of the following issues: 1) Cannot start in GUI mode; the error message you see, when you try, is expected behaviour, in current alpha releases. 2) "remove" action does not uninstall anything; the uninstaller function is currently a stub, so this is expected behaviour. 3) Package list needs updating, for more recent releases; we hope to address this progressively, in coming weeks. Please check the online release notes/announcements, and run "mingw-get update" periodically. 4) Need an action to list available/installed packages. 5) Additional features you would like to see added; we want to know your ideas, but please raise them for discussion on the mailing-list first. Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.in 6 Feb 2010 15:29:56 -0000 1.10 --- Makefile.in 16 Feb 2010 20:51:05 -0000 1.11 *************** *** 152,156 **** # when the release status qualifier is dropped from PACKAGE_VERSION. # ! SRCDIST_FILES = COPYING ChangeLog version.c.in \ configure.ac configure Makefile.in install-sh --- 152,157 ---- # when the release status qualifier is dropped from PACKAGE_VERSION. # ! LICENCE_FILES = README COPYING ! SRCDIST_FILES = $(LICENCE_FILES) ChangeLog version.c.in \ configure.ac configure Makefile.in install-sh *************** *** 164,168 **** dist: srcdist bindist ! bindist: all rm -rf staged $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip --- 165,169 ---- dist: srcdist bindist ! bindist: all licdist rm -rf staged $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip *************** *** 171,176 **** --- 172,186 ---- rm staged/bin/pkginfo$(EXEEXT) cd staged; tar chf - * | gzip -c > ../$(PACKAGE_DISTNAME)-bin.tar.gz + cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip * rm -rf staged + licdist: + rm -rf shared + $(mkinstalldirs) ./shared/doc/${PACKAGE_TARNAME} + cd ./shared/doc/${PACKAGE_TARNAME}; for file in $(LICENCE_FILES); \ + do $(LN_S) ${abs_top_srcdir}/$$file .; done + tar chf - shared | gzip -c > $(PACKAGE_DISTNAME)-lic.tar.gz + rm -rf shared + srcdist: pkginfo.c rm -rf ${PACKAGE_DISTROOT} && mkdir ${PACKAGE_DISTROOT} Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ChangeLog 10 Feb 2010 22:18:53 -0000 1.24 --- ChangeLog 16 Feb 2010 20:50:11 -0000 1.25 *************** *** 1,2 **** --- 1,16 ---- + 2010-02-16 Keith Marshall <kei...@us...> + + Prepare initial package release. + + * README: New file; use it to source release notes. + + * Makefile.in (SRCDIST_FILES): Use ... + (LICENCE_FILES): ...this new macro; define it. + (licdist): New build goal; implement it. + (bindist): Require it; add alternative `zip' format package. + + * src/profile (repository): Set default `package-index' name. + (system-map): Normalise spelling for default `sysroot' path names. + 2010-02-10 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-02-16 20:51:38
|
Update of /cvsroot/mingw/mingw-get/xml In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8888/xml Modified Files: profile.xml Log Message: Prepare initial package release. Index: profile.xml =================================================================== RCS file: /cvsroot/mingw/mingw-get/xml/profile.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** profile.xml 23 Nov 2009 20:44:25 -0000 1.1 --- profile.xml 16 Feb 2010 20:51:14 -0000 1.2 *************** *** 1,6 **** <?xml version="1.0" encoding="UTF-8" standalone="yes"?> - - <!-- profile.xml --> - <profile project="MinGW" application="mingw-get"> <!-- --- 1,3 ---- *************** *** 40,44 **** search feature becomes available, to enable master index search. --> ! <package-list catalogue="mingw-base" /> </repository> --- 37,41 ---- search feature becomes available, to enable master index search. --> ! <package-list catalogue="package-index" /> </repository> *************** *** 66,71 **** default, irrespective of its actual "id" attribute value. --> ! <sysroot subsystem="mingw32" path="c:/mingw" /> ! <sysroot subsystem="MSYS" path="c:/msys/1.0" /> </system-map> --- 63,68 ---- default, irrespective of its actual "id" attribute value. --> ! <sysroot subsystem="mingw32" path="c:/MinGW" /> ! <sysroot subsystem="MSYS" path="c:/MSYS/1.0" /> </system-map> |
|
From: Keith M. <kei...@us...> - 2010-02-10 22:19:07
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30583/src Modified Files: pkgkeys.c pkgkeys.h pkgproc.h tarproc.cpp Log Message: Add directory/file records in installation manifests. Index: pkgproc.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgproc.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgproc.h 2 Feb 2010 20:19:28 -0000 1.1 --- pkgproc.h 10 Feb 2010 22:18:59 -0000 1.2 *************** *** 54,57 **** --- 54,58 ---- pkgXmlNode *sysroot; const char *sysroot_path; + pkgXmlNode *installed; const char *tarname; const char *pkgfile; *************** *** 161,164 **** --- 162,166 ---- virtual int ProcessDirectory( const char* ); virtual int ProcessDataStream( const char* ); + virtual void UpdateInstallationManifest( const char*, const char* ); }; Index: pkgkeys.c =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgkeys.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pkgkeys.c 2 Feb 2010 20:19:28 -0000 1.3 --- pkgkeys.c 10 Feb 2010 22:18:59 -0000 1.4 *************** *** 30,36 **** --- 30,38 ---- const char *catalogue_key = "catalogue"; const char *component_key = "component"; + const char *dirname_key = "dir"; const char *download_key = "download"; const char *download_host_key = "download-host"; const char *eq_key = "eq"; + const char *filename_key = "file"; const char *ge_key = "ge"; const char *gt_key = "gt"; Index: tarproc.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/tarproc.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tarproc.cpp 6 Feb 2010 15:42:37 -0000 1.2 --- tarproc.cpp 10 Feb 2010 22:18:59 -0000 1.3 *************** *** 374,378 **** } - /* Here, we implement the methods for installing software from * packages which are distributed in the form of tar archives. --- 374,377 ---- *************** *** 402,414 **** if( (tarname != NULL) && (sysroot != NULL) ) { ! sysroot->SetAttribute( modified_key, yes_value ); ! pkgXmlNode *installed = new pkgXmlNode( installed_key ); installed->SetAttribute( tarname_key, tarname ); if( pkgfile != tarname ) { pkgXmlNode *download = new pkgXmlNode( download_key ); download->SetAttribute( tarname_key, pkgfile ); installed->AddChild( download ); } sysroot->AddChild( installed ); } --- 401,424 ---- if( (tarname != NULL) && (sysroot != NULL) ) { ! /* 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. + */ + sysroot->SetAttribute( modified_key, yes_value ); sysroot->AddChild( installed ); } *************** *** 417,426 **** int pkgTarArchiveInstaller::ProcessDirectory( const char *pathname ) { #if DEBUGLEVEL < 5 int status; ! if( (status = mkdir_recursive( pathname, 0755 )) != 0 ) dmh_notify( DMH_ERROR, "cannot create directory `%s'\n", pathname ); #else int status = 0; --- 427,455 ---- 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; *************** *** 435,438 **** --- 464,470 ---- 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 ) ); *************** *** 440,449 **** --- 472,492 ---- 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 ); *************** *** 451,455 **** --- 494,503 ---- } return status; + #else + /* Debugging stub... + * + * FIXME:maybe adapt for 'dry-run' or 'verbose' use. + */ dmh_printf( "FIXME:ProcessDataStream<stub>:not extracting: %s\n", *************** *** 460,462 **** --- 508,521 ---- } + 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 */ Index: pkgkeys.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgkeys.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pkgkeys.h 2 Feb 2010 20:19:28 -0000 1.3 --- pkgkeys.h 10 Feb 2010 22:18:59 -0000 1.4 *************** *** 41,47 **** --- 41,49 ---- EXTERN_C_DECL const char *catalogue_key; EXTERN_C_DECL const char *component_key; + EXTERN_C_DECL const char *dirname_key; EXTERN_C_DECL const char *download_key; EXTERN_C_DECL const char *download_host_key; EXTERN_C_DECL const char *eq_key; + EXTERN_C_DECL const char *filename_key; EXTERN_C_DECL const char *ge_key; EXTERN_C_DECL const char *gt_key; |
|
From: Keith M. <kei...@us...> - 2010-02-10 22:19:07
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30583 Modified Files: ChangeLog Log Message: Add directory/file records in installation manifests. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ChangeLog 6 Feb 2010 15:42:37 -0000 1.23 --- ChangeLog 10 Feb 2010 22:18:53 -0000 1.24 *************** *** 1,2 **** --- 1,22 ---- + 2010-02-10 Keith Marshall <kei...@us...> + + Add directory/file records in installation manifests. + + * src/pkgkeys.h (dirname_key, filename_key): New strings; declare... + * src/pkgkeys.c (dirname_key, filename_key): ...and implement them. + + * src/pkgproc.h (pkgArchiveProcessor::installed): New class member + variable; declare it. + (pkgTarArchiveInstaller::UpdateInstallationManifest): New method; + declare it. + + * src/tarproc.cpp: Miscellaneous comment updates. + (pkgTarArchiveInstaller): In constructor... + (pkgTarArchiveInstaller::installed): ...use new member variable... + (pkgArchiveProcessor::installed): ...inherited from this. + (pkgTarArchiveInstaller::UpdateInstallationManifest): Implement and... + (pkgTarArchiveInstaller::ProcessDataStream): ...use it. + (pkgTarArchiveInstaller::ProcessDirectory): Likewise. + 2010-02-06 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-02-06 15:42:45
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7105/src Modified Files: tarproc.cpp Log Message: Work around a deficiency in Microsoft's stat() implementation. Index: tarproc.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/tarproc.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tarproc.cpp 2 Feb 2010 20:19:28 -0000 1.1 --- tarproc.cpp 6 Feb 2010 15:42:37 -0000 1.2 *************** *** 239,242 **** --- 239,253 ---- * 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... */ status = ProcessDirectory( pathname ); |
|
From: Keith M. <kei...@us...> - 2010-02-06 15:42:45
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7105 Modified Files: ChangeLog Log Message: Work around a deficiency in Microsoft's stat() implementation. Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ChangeLog 6 Feb 2010 15:29:56 -0000 1.22 --- ChangeLog 6 Feb 2010 15:42:37 -0000 1.23 *************** *** 1,4 **** --- 1,11 ---- 2010-02-06 Keith Marshall <kei...@us...> + Work around a deficiency in Microsoft's stat() implementation. + + * src/tarproc.cpp (pkgTarArchiveProcessor::ProcessDirectory): Don't + pass a `pathname' argument with trailing slashes; strip them off. + + 2010-02-06 Keith Marshall <kei...@us...> + Add machinery for installation and packaging for distribution. |
|
From: Keith M. <kei...@us...> - 2010-02-06 15:30:05
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6242 Modified Files: ChangeLog Makefile.in configure.ac Added Files: install-sh Log Message: Add machinery for installation and packaging for distribution. Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.in 2 Feb 2010 20:19:22 -0000 1.9 --- Makefile.in 6 Feb 2010 15:29:56 -0000 1.10 *************** *** 2,6 **** # # $Id$ ! # # Written by Keith Marshall <kei...@us...> # Copyright (C) 2009, 2010, MinGW Project --- 2,9 ---- # # $Id$ ! ! PACKAGE_TARNAME = @PACKAGE_TARNAME@ ! PACKAGE_VERSION = @PACKAGE_VERSION@ ! # Written by Keith Marshall <kei...@us...> # Copyright (C) 2009, 2010, MinGW Project *************** *** 24,32 **** # srcdir = @srcdir@ ! ! VPATH = ${srcdir}/src ${srcdir}/src/pkginfo ${srcdir}/tinyxml DEBUGLEVEL = 0 CC = @CC@ CFLAGS = @CFLAGS@ --- 27,36 ---- # srcdir = @srcdir@ ! abs_top_srcdir = @abs_top_srcdir@ DEBUGLEVEL = 0 + VPATH = ${srcdir}/src ${srcdir}/src/pkginfo ${srcdir}/tinyxml + CC = @CC@ CFLAGS = @CFLAGS@ *************** *** 103,106 **** --- 107,194 ---- tinystr.$(OBJEXT): tinystr.h + # Installation tools and directory paths... + # + mkinstalldirs = @MKDIR_P@ + + prefix = @prefix@ + exec_prefix = @exec_prefix@ + localstatedir = @localstatedir@ + libexecdir = @libexecdir@ + bindir = @bindir@ + + PACKAGE_CONFIG_DIR = ${localstatedir}/lib/${PACKAGE_TARNAME}/data + + INSTALL = @INSTALL@ + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + + STRIP = @STRIP@ + LN_S = @LN_S@ + + # Installation rules... + # + installdirs: + $(mkinstalldirs) ${bindir} + $(mkinstalldirs) ${libexecdir}/${PACKAGE_TARNAME} + $(mkinstalldirs) ${PACKAGE_CONFIG_DIR} + + install: installdirs + $(INSTALL_PROGRAM) pkginfo$(EXEEXT) ${bindir} + $(INSTALL_PROGRAM) mingw-get$(EXEEXT) ${bindir} + $(INSTALL_DATA) mingw-get-0.dll ${libexecdir}/${PACKAGE_TARNAME} + $(INSTALL_DATA) ${srcdir}/xml/profile.xml ${PACKAGE_CONFIG_DIR} + + install-strip: install + $(STRIP) ${bindir}/pkginfo$(EXEEXT) + $(STRIP) ${bindir}/mingw-get$(EXEEXT) + $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/mingw-get-0.dll + + # Packaging and distribution... + # + # FIXME: the PACKAGE_DISTVERSION and PACKAGE_ROOTVERSION macro definitions + # and usage (below) will require modification, (most likely with help from + # configure), to accommodate inclusion of the `mingw32' subsystem qualifier, + # when the release status qualifier is dropped from PACKAGE_VERSION. + # + SRCDIST_FILES = COPYING ChangeLog version.c.in \ + configure.ac configure Makefile.in install-sh + + SRCDIST_SUBDIRS = src src/pkginfo tinyxml xml + + PACKAGE_DISTNAME = $(PACKAGE_TARNAME)-$(PACKAGE_DISTVERSION) + PACKAGE_DISTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9],-mingw32&,'` + PACKAGE_ROOTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9].*,,'` + PACKAGE_DISTROOT = $(PACKAGE_TARNAME)-$(PACKAGE_ROOTVERSION) + + dist: srcdist bindist + + bindist: all + rm -rf staged + $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip + cd staged; tar chf - bin/pkginfo$(EXEEXT) | gzip -c > \ + ../pkginfo-$(PACKAGE_DISTVERSION)-bin.tar.gz + rm staged/bin/pkginfo$(EXEEXT) + cd staged; tar chf - * | gzip -c > ../$(PACKAGE_DISTNAME)-bin.tar.gz + rm -rf staged + + srcdist: pkginfo.c + rm -rf ${PACKAGE_DISTROOT} && mkdir ${PACKAGE_DISTROOT} + cd ${PACKAGE_DISTROOT}; for file in $(SRCDIST_FILES); do \ + $(LN_S) ${abs_top_srcdir}/$$file .; done + for dir in $(SRCDIST_SUBDIRS); do \ + mkdir ${PACKAGE_DISTROOT}/$$dir && cd ${PACKAGE_DISTROOT}/$$dir; \ + for file in `cd ${abs_top_srcdir}/$$dir && echo *`; do \ + if test -f ${abs_top_srcdir}/$$dir/$$file; then \ + $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \ + fi; \ + done; \ + cd ${CURDIR}; done + cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/$^ . + tar chf - ${PACKAGE_DISTROOT} | gzip -c > ${PACKAGE_DISTNAME}-src.tar.gz + rm -rf ${PACKAGE_DISTROOT} + + # Workspace clean-up... + # clean: rm -f *.$(OBJEXT) *.dll pkginfo$(EXEEXT) mingw-get$(EXEEXT) *************** *** 109,111 **** --- 197,203 ---- rm -f config.* version.c Makefile + maintainer-clean: distclean + rm -f pkginfo.c *-$(PACKAGE_DISTVERSION)-*.tar.gz + rm -rf ${PACKAGE_DISTROOT} staged + # $RCSfile$: end of file --- NEW FILE: install-sh --- #!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: Index: configure.ac =================================================================== RCS file: /cvsroot/mingw/mingw-get/configure.ac,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure.ac 8 Jan 2010 17:44:20 -0000 1.2 --- configure.ac 6 Feb 2010 15:29:56 -0000 1.3 *************** *** 28,31 **** --- 28,36 ---- AC_SUBST([YEARS_OF_ISSUE],["2009, 2010"]) + # Override the normal UNIX-centric autoconf default prefix; + # substitute the MinGW standard in its place. + # + AC_PREFIX_DEFAULT([C:/MinGW]) + # We need both C and C++ compilers; check how to invoke them # *************** *** 42,46 **** AC_SUBST([ARFLAGS],[${ARFLAGS-rcs}]) ! # Create a makefile # AC_CONFIG_FILES([version.c Makefile]) --- 47,62 ---- AC_SUBST([ARFLAGS],[${ARFLAGS-rcs}]) ! # Identify tools required for product installation ! # ! AC_PROG_MKDIR_P ! AC_PROG_INSTALL ! AC_PROG_LN_S ! ! # As for the archive librarian, we need to ensure that the tool ! # for stripping binaries is compatible with the compiler ! # ! AC_CHECK_TOOL([STRIP],[strip],[strip]) ! ! # Establish the product version banner, and create a makefile # AC_CONFIG_FILES([version.c Makefile]) Index: ChangeLog =================================================================== RCS file: /cvsroot/mingw/mingw-get/ChangeLog,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ChangeLog 2 Feb 2010 20:18:58 -0000 1.21 --- ChangeLog 6 Feb 2010 15:29:56 -0000 1.22 *************** *** 1,2 **** --- 1,26 ---- + 2010-02-06 Keith Marshall <kei...@us...> + + Add machinery for installation and packaging for distribution. + + * install-sh: New file; source it from autoconf distribution. + + * configure.ac (AC_PREFIX_DEFAULT): Assign it as `C:/MinGW'. + (AC_PROG_MKDIR_P, AC_PROG_INSTALL, AC_PROG_LN_S): Invoke these. + (STRIP): New output variable; use AC_CHECK_TOOL to define it. + + * Makefile.in (abs_top_srcdir): Define to AC_SUBST value. + (PACKAGE_TARNAME, PACKAGE_VERSION): Define to AC_SUBST values. + (prefix, exec_prefix, bindir, libexecdir, localstatedir): Likewise. + (INSTALL, INSTALL_PROGRAM, INSTALL_SCRIPT, INSTALL_DATA): Likewise. + (STRIP): New macro; define it using AC_CHECK_TOOL substitution. + (mkinstalldirs): New macro; define it as AC_PROG_MKDIR_P result. + (LN_S): New macro; define it as AC_PROG_LN_S result. + (dist, srcdist, bindist): New build objectives; implement them. + (install, installdirs, install-strip, maintainer-clean): Likewise. + (SRCDIST_FILES, SRCDIST_SUBDIRS): New macros; define them. + (PACKAGE_DISTNAME, PACKAGE_DISTVERSION): Likewise. + (PACKAGE_DISTROOT, PACKAGE_ROOTVERSION): Likewise. + (PACKAGE_CONFIG_DIR): Likewise. + 2010-02-02 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-02-02 20:20:06
|
Update of /cvsroot/mingw/mingw-get In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23477 Modified Files: ChangeLog Makefile.in Log Message: Implement package installer for tar archives. Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/mingw-get/Makefile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.in 26 Jan 2010 21:07:16 -0000 1.8 --- Makefile.in 2 Feb 2010 20:19:22 -0000 1.9 *************** *** 53,57 **** 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) \ tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \ --- 53,57 ---- 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) \ *************** *** 78,81 **** --- 78,83 ---- 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 + tarproc.$(OBJEXT): pkgbase.h pkgproc.h pkginfo.h pkgkeys.h pkgstrm.h + tarproc.$(OBJEXT): 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.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ChangeLog 26 Jan 2010 21:07:13 -0000 1.20 --- ChangeLog 2 Feb 2010 20:18:58 -0000 1.21 *************** *** 1,2 **** --- 1,38 ---- + 2010-02-02 Keith Marshall <kei...@us...> + + Implement package installer for tar archives. + + * src/pkgexec.cpp (pkgXmlDocument::Execute): Replace existing + stub implementation of installer, using methods provided by... + * src/pkgproc.h, src/tarproc.cpp: ...these new files, with trap... + * src/pkgdeps.cpp (pkgXmlDocument::Schedule) [installed]: Add entry... + (pkgActionItem::Selection) [to_remove]: ...for this; use it to detect + `install' requests for packages which are aleady installed. + + * Makefile.in (CORE_DLL_OBJECTS): Add tarproc.$(OBJEXT); specify + dependencies as appropriate. + + * src/sysroot.cpp (pkgXmlDocument::LoadSystemMap): Don't commit + newly created `sysroot' mapping records to disk; defer to... + (pkgXmlDocument::UpdateSystemMap): ...this new method. + (sigpath): Make it a global variable, with file (static) scope. + + * src/climain.cpp (pkgXmlDocument::UpdateSystemMap): Invoke it. + + * src/pkgkeys.h (download_key, modified_key, source_key): New global + string variables; declare them, providing their implementations... + * src/pkgkeys.c (download_key, modified_key, source_key): ...here. + * src/pkgname.cpp (download_key, source_key): Use them. + + * src/pkginet.cpp (pkgActionItem::ArchivePath): Delete; replace... + * src/mkpath.c (pkgArchivePath): ...with this free standing function. + * src/mkpath.h (pkgArchivePath): Declare its prototype. + + * src/pkgbase.h (pkgActionItem::ArchivePath): Delete declaration. + (pkgXmlDocument): Add a default constructor; implement as `inline'. + (pkgXmlDocument::AddDeclaration): Use heap memory to allocate the new + declaration object, instead of `auto' variable, to avoid scope error. + (pkgXmlDocument::UpdateSystemMap): Declare it. + 2010-01-26 Keith Marshall <kei...@us...> |
|
From: Keith M. <kei...@us...> - 2010-02-02 20:19:36
|
Update of /cvsroot/mingw/mingw-get/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23477/src Modified Files: climain.cpp mkpath.c mkpath.h pkgbase.h pkgdeps.cpp pkgexec.cpp pkginet.cpp pkgkeys.c pkgkeys.h pkgname.cpp sysroot.cpp Added Files: pkgproc.h tarproc.cpp Log Message: Implement package installer for tar archives. Index: pkgkeys.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgkeys.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkgkeys.h 26 Jan 2010 21:07:18 -0000 1.2 --- pkgkeys.h 2 Feb 2010 20:19:28 -0000 1.3 *************** *** 41,44 **** --- 41,45 ---- EXTERN_C_DECL const char *catalogue_key; EXTERN_C_DECL const char *component_key; + EXTERN_C_DECL const char *download_key; EXTERN_C_DECL const char *download_host_key; EXTERN_C_DECL const char *eq_key; *************** *** 51,54 **** --- 52,56 ---- EXTERN_C_DECL const char *lt_key; EXTERN_C_DECL const char *mirror_key; + EXTERN_C_DECL const char *modified_key; EXTERN_C_DECL const char *name_key; EXTERN_C_DECL const char *package_key; *************** *** 60,63 **** --- 62,66 ---- EXTERN_C_DECL const char *repository_key; EXTERN_C_DECL const char *requires_key; + EXTERN_C_DECL const char *source_key; EXTERN_C_DECL const char *subsystem_key; EXTERN_C_DECL const char *sysmap_key; Index: pkgexec.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgexec.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pkgexec.cpp 26 Jan 2010 21:07:18 -0000 1.4 --- pkgexec.cpp 2 Feb 2010 20:19:28 -0000 1.5 *************** *** 32,35 **** --- 32,36 ---- #include "pkginfo.h" #include "pkgtask.h" + #include "pkgproc.h" EXTERN_C const char *action_name( unsigned long index ) *************** *** 387,391 **** * installer implementation. */ ! dmh_printf( " installing %s\n", current->Selection()->GetPropVal( tarname_key, "<unknown>" )); } --- 388,403 ---- * installer implementation. */ ! //dmh_printf( " installing %s\n", current->Selection()->GetPropVal( tarname_key, "<unknown>" )); ! if( current->Selection( to_remove ) == NULL ) ! { ! pkgTarArchiveInstaller package( current->Selection() ); ! if( package.IsOk() ) ! package.Process(); ! } ! else ! dmh_notify( DMH_ERROR, ! "package %s is already installed\n", ! current->Selection()->GetPropVal( tarname_key, "<unknown>" ) ! ); } Index: sysroot.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/sysroot.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sysroot.cpp 22 Jan 2010 17:11:48 -0000 1.1 --- sysroot.cpp 2 Feb 2010 20:19:28 -0000 1.2 *************** *** 112,115 **** --- 112,117 ---- } + static const char *sigpath = "%R" "var/lib/mingw-get/data/%F.xml"; + void pkgXmlDocument::LoadSystemMap() { *************** *** 193,197 **** */ int retry = 0; - const char *sigpath = "%R" "var/lib/mingw-get/data/%F.xml"; while( retry < 16 ) --- 195,198 ---- *************** *** 256,283 **** * 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; } --- 257,275 ---- * finding no existing mapping database for this sysroot... * The current hashed file name has not yet been assigned, ! * so create a new entry in the internal XML database, ! * marking it as "modified", so that it will be written ! * to disk, when the system map is updated. * * FIXME: perhaps we should not do this arbitrarily for * any non-default system root. */ ! pkgXmlNode *record = new pkgXmlNode( sysroot_key ); ! record->SetAttribute( modified_key, yes_value ); ! record->SetAttribute( id_key, sig ); ! record->SetAttribute( pathname_key, path ); ! dbase->AddChild( record ); ! /* Finally, force termination of the sysroot search. */ retry = 16; } *************** *** 320,323 **** --- 312,357 ---- } + void pkgXmlDocument::UpdateSystemMap() + { + /* Inspect all sysroot records in the current system map; + * save copies of any marked with the 'modified' attribute + * to the appropriate disk files. + */ + pkgXmlNode *entry = GetRoot()->FindFirstAssociate( sysroot_key ); + + while( entry != NULL ) + { + /* We found a sysroot record... + * evaluate and clear its 'modified' attribute... + */ + const char *modified = entry->GetPropVal( modified_key, no_value ); + entry->RemoveAttribute( modified_key ); + + if( (strcmp( modified, yes_value ) == 0) + && ((modified = entry->GetPropVal( id_key, NULL )) != NULL) ) + { + /* The 'modified' attribute for this record was set, + * and the 'id' attribute is valid; establish the path + * name for the file in which to save the record. + */ + char mapfile[mkpath( NULL, sigpath, modified, NULL )]; + mkpath( mapfile, sigpath, modified, NULL ); + + /* Create a copy of the sysroot record, as the content of + * a new freestanding XML document, and write it out to the + * nominated record file. + */ + pkgXmlDocument map; + map.AddDeclaration( "1.0", "UTF-8", yes_value ); + map.SetRoot( entry->Clone() ); + map.Save( mapfile ); + } + + /* Repeat for the next sysroot record, if any... + */ + entry = entry->FindNextAssociate( sysroot_key ); + } + } + pkgXmlNode* pkgXmlNode::GetSysRoot( const char *subsystem ) { Index: mkpath.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/mkpath.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkpath.h 16 Nov 2009 21:54:30 -0000 1.1 --- mkpath.h 2 Feb 2010 20:19:28 -0000 1.2 *************** *** 42,44 **** --- 42,46 ---- EXTERN_C int mkpath( char *, const char *, const char *, const char * ); + EXTERN_C const char *pkgArchivePath(); + #endif /* MKPATH_H: $RCSfile$: end of file */ Index: climain.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/climain.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** climain.cpp 26 Jan 2010 21:07:17 -0000 1.5 --- climain.cpp 2 Feb 2010 20:19:24 -0000 1.6 *************** *** 97,103 **** dbase.Schedule( (unsigned long)(action), *++argv ); ! /* ...and finally, execute all scheduled actions. */ dbase.ExecuteActions(); } --- 97,105 ---- dbase.Schedule( (unsigned long)(action), *++argv ); ! /* ...finally, execute all scheduled actions, and update the ! * system map accordingly. */ dbase.ExecuteActions(); + dbase.UpdateSystemMap(); } Index: pkgkeys.c =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgkeys.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkgkeys.c 26 Jan 2010 21:07:18 -0000 1.2 --- pkgkeys.c 2 Feb 2010 20:19:28 -0000 1.3 *************** *** 30,33 **** --- 30,34 ---- const char *catalogue_key = "catalogue"; const char *component_key = "component"; + const char *download_key = "download"; const char *download_host_key = "download-host"; const char *eq_key = "eq"; *************** *** 40,43 **** --- 41,45 ---- const char *lt_key = "lt"; const char *mirror_key = "mirror"; + const char *modified_key = "modified"; const char *name_key = "name"; const char *package_key = "package"; *************** *** 49,52 **** --- 51,55 ---- const char *repository_key = "repository"; const char *requires_key = "requires"; + const char *source_key = "source"; const char *subsystem_key = "subsystem"; const char *sysmap_key = "system-map"; --- NEW FILE: tarproc.cpp --- /* * tarproc.cpp * * $Id: tarproc.cpp,v 1.1 2010/02/02 20:19:28 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2009, 2010, MinGW Project * * * Implementation of package archive processing methods, for reading * and extracting content from 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 <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include "dmh.h" #include "mkpath.h" #include "pkginfo.h" #include "pkgkeys.h" #include "pkgproc.h" pkgTarArchiveProcessor::pkgTarArchiveProcessor( pkgXmlNode *pkg ) { /* Constructor to associate a package tar archive with its * nominated sysroot and respective installation directory path, * and prepare it for processing, using an appropriate streaming * decompression filter; (choice of filter is based on archive * file name extension; file names are restricted to the * POSIX Portable Character Set). * * First, we anticipate an invalid initialisation state... */ sysroot = NULL; sysroot_path = NULL; stream = NULL; /* The 'pkg' XML database entry must be non-NULL, must * represent a package release, and must specify a canonical * 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 * to identify and locate the sysroot record with which this * package is to be associated... */ pkgSpecs lookup( pkgfile = tarname ); if( (sysroot = pkg->GetSysRoot( lookup.GetSubSystemName() )) != NULL ) { /* Having located the requisite sysroot record, we may * retrieve its specified installation path prefix... */ const char *prefix; if( (prefix = sysroot->GetPropVal( pathname_key, NULL )) != NULL ) { /* ...and incorporate it into a formatting template * for use in deriving the full path names for files * which are installed from this package. */ 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 ); } } /* Some older packages don't use the canonical tarname * for the archive file name; identify the real file name * associated with such packages... */ pkgfile = pkg->ArchiveName(); /* Finally, initialise the data stream which we will use * for reading the package content. */ const char *archive_path_template = pkgArchivePath(); char archive_path_name[mkpath( NULL, archive_path_template, pkgfile, NULL )]; mkpath( archive_path_name, archive_path_template, pkgfile, NULL ); stream = pkgOpenArchiveStream( archive_path_name ); } } 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; } int pkgTarArchiveProcessor::ProcessLinkedEntity( const char *pathname ) { /* FIXME: Win32 links need special handling; for hard links, we * may be able to create them directly, with >= Win2K and NTFS; * for symlinks on *all* Win32 variants, and for hard links on * FAT32 or Win9x, we need to make physical copies of the source * file, at the link target location. * * For now, we simply ignore links. */ dmh_printf( "FIXME:ProcessLinkedEntity<stub>:Ignoring link: %s --> %s\n", pathname, header.field.linkname ); return 0; } static uint64_t compute_octval( const char *p, size_t len ) # define octval( FIELD ) compute_octval( FIELD, sizeof( FIELD ) ) { /* Helper to convert the ASCII representation of octal values, * (as recorded within tar archive header fields), to their actual * numeric values, ignoring leading or trailing garbage. */ uint64_t value = 0LL; while( (len > 0) && ((*p < '0') || (*p > '7')) ) { /* Step over leading garbage. */ ++p; --len; } while( (len > 0) && (*p >= '0') && (*p < '8') ) { /* Accumulate octal digits; (each represents exactly three * bits in the accumulated value), until we either exhaust * the width of the field, or we encounter trailing junk. */ value = (value << 3) + *p++ - '0'; --len; } return value; } int pkgTarArchiveProcessor::GetArchiveEntry() { /* Read header for next available entry in the tar archive; * check for end-of-archive mark, (all zero header); verify * checksum for active entry. */ char *buf = header.aggregate; size_t count = stream->Read( buf, sizeof( header ) ); if( count < sizeof( header ) ) { /* Failed to read a complete header; return error code. */ return -1; } while( count-- ) /* * Outer loop checks for an all zero header... */ if( *buf++ != '\0' ) { /* Any non-zero byte transfers control to an inner loop, * to rescan the entire header, accumulating its checksum... */ uint64_t sum = 0; for( buf = header.aggregate, count = sizeof( header ); count--; ++buf ) { if( (buf < header.field.chksum) || (buf >= header.field.typeflag) ) /* * ...counting the actual binary value of each byte, * in all but the checksum field itself... */ sum += *buf; else /* ...while treating each byte within the checksum field as * having an effective value equivalent to ASCII <space>. */ sum += 0x20; } /* After computing the checksum for a non-zero header, * verify it against the value recorded in the checksum field; * return +1 for a successful match, or -2 for failure. */ return (sum == octval( header.field.chksum )) ? 1 : -2; } /* If we get to here, then the inner loop was never entered; * the outer loop has completed, confirming an all zero header; * return zero, to indicate end of archive. */ return 0; } int pkgTarArchiveProcessor::Process() { /* Generic method for reading tar archives, and extracting their * content; loops over each archive entry in turn... */ while( GetArchiveEntry() > 0 ) { /* Found an archive entry; map it to an equivalent file system * path name, within the designated sysroot hierarchy. */ char *prefix = *header.field.prefix ? header.field.prefix : NULL; char pathname[mkpath( NULL, sysroot_path, header.field.name, prefix )]; mkpath( pathname, sysroot_path, header.field.name, prefix ); /* Direct further processing to the appropriate handler; (this * is specific to the archive entry classification)... */ switch( *header.field.typeflag ) { int status; case TAR_ENTITY_TYPE_DIRECTORY: /* * We may need to take some action in respect of directories; * e.g. we may need to create a directory, or even a sequence * of directories, to establish a location within the sysroot * hierarchy... * */ status = ProcessDirectory( pathname ); break; case TAR_ENTITY_TYPE_LINK: case TAR_ENTITY_TYPE_SYMLINK: /* * Links ultimately represent file system entities in * our sysroot hierarchy, but we need special processing * to handle them correctly... * */ status = ProcessLinkedEntity( pathname ); break; case TAR_ENTITY_TYPE_FILE: case TAR_ENTITY_TYPE_ALTFILE: /* * These represent regular files; the file content is * embedded within the archive stream, so we need to be * prepared to read or copy it, as appropriate... * */ ProcessDataStream( pathname ); break; default: /* FIXME: we make no provision for handling any other * type of archive entry; we should provide some more * robust error handling, but for now we simply emit * a diagnostic, and return an error condition code... * */ dmh_notify( DMH_ERROR, "unexpected archive entry classification: type %d\n", (int)(*header.field.typeflag) ); return -1; } } /* If we didn't bail out before getting to here, then the archive * was processed successfully; return the success code. */ return 0; } int pkgTarArchiveProcessor::ProcessEntityData( int fd ) { /* Generic method for reading past the data associated with * a specific header within a tar archive; if given a negative * value for `fd', it will simply skip over the data, otherwise * `fd' is assumed to represent a descriptor for an opened file * stream, to which the data will be copied (extracted). */ int status = 0; /* Initialise a counter for the length of the data content, and * specify the default size for the transfer buffer in which to * process it; make the initial size of the transfer buffer 16 * times the header size. */ uint64_t bytes_to_copy = octval( header.field.size ); size_t block_size = sizeof( header ) << 4; /* While we still have unread data, and no processing error... */ while( (bytes_to_copy > 0) && (status == 0) ) { /* Adjust the requested size for the transfer buffer, shrinking * it by 50% at each step, until it is smaller than the remaining * data length, but never smaller than the header record length. */ while( (bytes_to_copy < block_size) && (block_size > sizeof( header )) ) block_size >>= 1; /* Allocate a transfer buffer of the requested size, and populate * it, by reading data from the archive; (since the transfer buffer * is never smaller than the header length, this will also capture * any additional padding bytes, which may be required to keep the * data length equal to an exact multiple of the header length). */ char buffer[block_size]; if( stream->Read( buffer, block_size ) < (int)(block_size) ) /* * Failure to fully populate the transfer buffer, (i.e. a short * read), indicates a corrupt archive; bail out immediately. */ return -1; /* When the number of actual data bytes expected is fewer than the * total number of bytes in the transfer buffer... */ if( bytes_to_copy < block_size ) /* * ...then we have reached the end of the data for the current * archived entity; adjust the block size to reflect the number * of actual data bytes present in the transfer buffer... */ block_size = bytes_to_copy; /* With the number of actual data bytes present now accurately * reflected by the block size, we save that data to the stream * specified for archive extraction, (if any). */ if( (fd >= 0) && (write( fd, buffer, block_size ) != (int)(block_size)) ) /* * An extraction error occurred; set the status code to * indicate failure. */ status = -2; /* Adjust the count of remaining unprocessed data bytes, and begin * a new processing cycle, to capture any which may be present. */ bytes_to_copy -= block_size; } /* Finally, when all data for the current archive entry has been * processed, we return to the caller with an appropriate completion * status code. */ return status; } /* 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) ) { sysroot->SetAttribute( modified_key, yes_value ); pkgXmlNode *installed = new pkgXmlNode( installed_key ); installed->SetAttribute( tarname_key, tarname ); if( pkgfile != tarname ) { pkgXmlNode *download = new pkgXmlNode( download_key ); download->SetAttribute( tarname_key, pkgfile ); installed->AddChild( download ); } sysroot->AddChild( installed ); } } int pkgTarArchiveInstaller::ProcessDirectory( const char *pathname ) { #if DEBUGLEVEL < 5 int status; if( (status = mkdir_recursive( pathname, 0755 )) != 0 ) dmh_notify( DMH_ERROR, "cannot create directory `%s'\n", pathname ); #else int status = 0; dmh_printf( "FIXME:ProcessDirectory<stub>:not executing: mkdir -p %s\n", pathname ); #endif return status; } int pkgTarArchiveInstaller::ProcessDataStream( const char *pathname ) { #if DEBUGLEVEL < 5 int fd = set_output_stream( pathname, octval( header.field.mode ) ); int status = ProcessEntityData( fd ); if( fd >= 0 ) { close( fd ); if( status == 0 ) commit_saved_entity( pathname, octval( header.field.mtime ) ); else { unlink( pathname ); dmh_notify( DMH_ERROR, "%s: extraction failed\n", pathname ); } } return status; #else dmh_printf( "FIXME:ProcessDataStream<stub>:not extracting: %s\n", pathname ); return ProcessEntityData( -1 ); #endif } /* $RCSfile: tarproc.cpp,v $: end of file */ Index: mkpath.c =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/mkpath.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkpath.c 16 Nov 2009 21:54:30 -0000 1.1 --- mkpath.c 2 Feb 2010 20:19:28 -0000 1.2 *************** *** 67,70 **** --- 67,78 ---- #endif + const char *pkgArchivePath() + { + /* Specify where downloaded packages are cached, + * within the local file system. + */ + return "%R" "var/cache/mingw-get/packages" "%/M/%F"; + } + int mkpath( char *buf, const char *fmt, const char *file, const char *modifier ) { Index: pkgname.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgname.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkgname.cpp 16 Jan 2010 20:49:57 -0000 1.2 --- pkgname.cpp 2 Feb 2010 20:19:28 -0000 1.3 *************** *** 108,112 **** * "source" element specifying a "tarname" property. */ ! return pkgArchiveName( this, "source", 0 ); } --- 108,112 ---- * "source" element specifying a "tarname" property. */ ! return pkgArchiveName( this, source_key, 0 ); } *************** *** 125,129 **** * unresolved to either of these, returns NULL. */ ! return pkgArchiveName( this, "download", 1 ); } --- 125,129 ---- * unresolved to either of these, returns NULL. */ ! return pkgArchiveName( this, download_key, 1 ); } Index: pkginet.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkginet.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pkginet.cpp 26 Jan 2010 21:07:18 -0000 1.5 --- pkginet.cpp 2 Feb 2010 20:19:28 -0000 1.6 *************** *** 96,107 **** static pkgInternetAgent pkgDownloadAgent; - const char *pkgActionItem::ArchivePath() - { - /* Specify where downloaded packages are cached, - * within the local file system. - */ - return "%R" "var/cache/mingw-get/packages" "%/M/%F"; - } - class pkgInternetStreamingAgent { --- 96,99 ---- *************** *** 290,294 **** */ const char *package_name = current->Selection()->ArchiveName(); ! pkgInternetStreamingAgent download( package_name, current->ArchivePath() ); /* Check if the required archive is already available locally... --- 282,286 ---- */ const char *package_name = current->Selection()->ArchiveName(); ! pkgInternetStreamingAgent download( package_name, pkgArchivePath() ); /* Check if the required archive is already available locally... --- NEW FILE: pkgproc.h --- #ifndef PKGPROC_H /* * pkgproc.h * * $Id: pkgproc.h,v 1.1 2010/02/02 20:19:28 keithmarshall Exp $ * * Written by Keith Marshall <kei...@us...> * Copyright (C) 2009, 2010, MinGW Project * * * Specifications for the internal architecture of package archives, * and the public interface for the package archive processing routines, * used to implement the package installer and uninstaller. * * * 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 PKGPROC_H 1 #include "pkgbase.h" #include "pkgstrm.h" class pkgArchiveProcessor { /* A minimal generic abstract base class, from which we derive * processing tools for handling arbitrary package architectures. */ public: pkgArchiveProcessor(){} virtual ~pkgArchiveProcessor(){} virtual bool IsOk() = 0; virtual int Process() = 0; protected: /* Pointers to the sysroot management records and installation * path template for a managed package; note that 'tarname' does * not explicitly refer only to tar archives; it is simply the * canonical name of the archive file, as recorded in the XML * 'tarname' property of the package identifier record. */ pkgXmlNode *sysroot; const char *sysroot_path; const char *tarname; const char *pkgfile; }; /* Our standard package format specifies the use of tar archives; * the following specialisation of pkgArchiveProcessor provides the * tools we need for processing such archives. * */ union tar_archive_header { /* Layout specification for the tar archive header records, * one of which is associated with each individual data entity * stored within a tar archive. */ char aggregate[512]; /* aggregate size is always 512 bytes */ struct tar_header_field_layout { char name[100]; /* archive entry path name */ char mode[8]; /* unix access mode for archive entry */ char uid[8]; /* user id of archive entry's owner */ char gid[8]; /* group id of archive entry's owner */ char size[12]; /* size of archive entry in bytes */ char mtime[12]; /* last modification time of entry */ char chksum[8]; /* checksum for this header block */ char typeflag[1]; /* type of this archive entry */ char linkname[100]; /* if a link, name of linked file */ char magic[6]; /* `magic' signature for the archive */ char version[2]; /* specification conformance code */ char uname[32]; /* user name of archive entry's owner */ char gname[32]; /* group name of entry's owner */ char devmajor[8]; /* device entity major number */ char devminor[8]; /* device entity minor number */ char prefix[155]; /* prefix to extend "name" field */ } field; }; /* Type descriptors, as used in the `typeflag' field of the above * tar archive header records; (note: this is not a comprehensive * list, but covers all of, and more than, our requirements). */ #define TAR_ENTITY_TYPE_FILE '0' #define TAR_ENTITY_TYPE_LINK '1' #define TAR_ENTITY_TYPE_SYMLINK '2' #define TAR_ENTITY_TYPE_CHRDEV '3' #define TAR_ENTITY_TYPE_BLKDEV '4' #define TAR_ENTITY_TYPE_DIRECTORY '5' /* Some older style tar archives may use '\0' as an alternative to '0', * to identify an archive entry representing a regular file. */ #define TAR_ENTITY_TYPE_ALTFILE '\0' class pkgTarArchiveProcessor : public pkgArchiveProcessor { /* An abstract base class, from which various tar archive * processing tools, (including installers and uninstallers), * are derived; this class implements the generic methods, * which are shared by all such tools. */ public: /* Constructor and destructor... */ pkgTarArchiveProcessor( pkgXmlNode* ); virtual ~pkgTarArchiveProcessor(); inline bool IsOk(){ return stream->IsReady(); } virtual int Process(); protected: /* Class data... */ pkgArchiveStream *stream; union tar_archive_header header; /* Internal archive processing methods... * These are divided into two categories: those for which the * abstract base class furnishes a generic implementation... */ virtual int GetArchiveEntry(); virtual int ProcessEntityData( int ); /* ...those for which each specialisation is expected to * furnish its own task specific implementation... */ virtual int ProcessDirectory( const char* ) = 0; virtual int ProcessDataStream( const char* ) = 0; /* ...and those which would normally be specialised, but * for which we currently provide a generic stub... */ virtual int ProcessLinkedEntity( const char* ); }; class pkgTarArchiveInstaller : public pkgTarArchiveProcessor { public: /* Constructor and destructor... */ pkgTarArchiveInstaller( pkgXmlNode* ); virtual ~pkgTarArchiveInstaller(){} private: /* Specialised implementations of the archive processing methods... */ virtual int ProcessDirectory( const char* ); virtual int ProcessDataStream( const char* ); }; class pkgTarArchiveUninstaller : public pkgTarArchiveProcessor { public: /* Constructor and destructor... */ pkgTarArchiveUninstaller( pkgXmlNode* ); virtual ~pkgTarArchiveUninstaller(){}; private: /* Specialised implementations of the archive processing methods... */ virtual int ProcessDirectory( const char* ); virtual int ProcessDataStream( const char* ); }; #endif /* PKGPROC_H: $RCSfile: pkgproc.h,v $: end of file */ Index: pkgbase.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgbase.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pkgbase.h 26 Jan 2010 21:07:18 -0000 1.4 --- pkgbase.h 2 Feb 2010 20:19:28 -0000 1.5 *************** *** 216,223 **** } - /* Method specifying where downloaded packages are stored. - */ - const char* ArchivePath(); - /* Method for processing all scheduled actions. */ --- 216,219 ---- *************** *** 233,236 **** --- 229,233 ---- /* Constructors... */ + inline pkgXmlDocument(){} inline pkgXmlDocument( const char* name ) { *************** *** 267,272 **** * this is a convenience method for setting up a new XML database. */ ! TiXmlDeclaration decl( version, encoding, standalone ); ! LinkEndChild( &decl ); } inline void SetRoot( TiXmlNode* root ) --- 264,268 ---- * this is a convenience method for setting up a new XML database. */ ! LinkEndChild( new TiXmlDeclaration( version, encoding, standalone ) ); } inline void SetRoot( TiXmlNode* root ) *************** *** 311,314 **** --- 307,315 ---- void LoadSystemMap(); + /* Complementary method, to update the saved sysroot data associated + * with the active system map. + */ + void UpdateSystemMap(); + /* Method to locate the XML database entry for a named package. */ Index: pkgdeps.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkgdeps.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkgdeps.cpp 26 Jan 2010 21:08:30 -0000 1.1 --- pkgdeps.cpp 2 Feb 2010 20:19:28 -0000 1.2 *************** *** 299,303 **** * which is currently installed... */ ! installed = release; if( latest.SelectIfMostRecentFit( release ) == release ) --- 299,303 ---- * which is currently installed... */ ! latest.SelectPackage( installed = release, to_remove ); if( latest.SelectIfMostRecentFit( release ) == release ) |