From 14f22fa3b84a6807ac7958c646237c994814028f Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Sun, 13 Feb 2011 21:23:58 +0000 Subject: [PATCH] Merge from mingw-get-0.1-mingw32-alpha-5 bug-fix branch. --- ChangeLog | 50 ++++++++++++++++++++++++++++++++++++++++++++++++- Makefile.in | 42 ++++++++++++++++++++++++++++------------- README | 8 ++++++++ configure.ac | 2 +- src/clistub.c | 7 ++++--- src/guimain.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/pkgdeps.cpp | 12 +++++++++--- src/pkgexec.cpp | 6 ++++-- src/pkgtask.h | 8 ++++---- 9 files changed, 166 insertions(+), 27 deletions(-) create mode 100644 src/guimain.cpp diff --git a/ChangeLog b/ChangeLog index aa30e0c..7189bd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,51 @@ +2011-02-13 Keith Marshall + + Merge from mingw-get-0.1-mingw32-alpha-5 bug-fix branch. + + * src/pkgdeps.cpp (pkgXmlDocument::ResolveDependencies): Promote + "install" action on new prerequisites, where a previously uninstalled + package is required to satisfy any "upgrade" dependency. + + * src/pkgexec.cpp (pkgActionList::Execute): Don't make misleading + claims concerning package removal. + + * src/pkgtask.h (STRICTLY_GT, STRICTLY_LT, ACTION_PRIMARY): Add one + level of parentheses around defining expressions. + +2011-02-10 Keith Marshall + + Publish mingw-get-0.0-mingw32-alpha-5.1 bug-fix release. + + * README: Updated to reflect changes. + +2011-02-08 Keith Marshall + + Improve diagnostics for failed GUI invocation. + + * src/guimain.cpp: New file; currently delivers only a diagnostic + stub, provided by Sze Howe Koh , to + pop-up a message block explaining why GUI mode cannot be invoked. + + * Makefile.in (GUI_LDFLAGS): New macro; it is required by... + (gui$EXEEXT): ...this new build rule; add to prerequisites of... + (all): ...this [default] build rule; redefine this in terms of... + (BIN_PROGRAMS, LIBEXEC_PROGRAMS, LIBEXEC_DATA): ...these new macros; + define them, and also use them as loop iterator objectives for... + (install, install_strip): ...these; also schedule them... + (clean): ...for removal by this. + + * src/clistub.c (Copyright): Add new year. + (main): Amend error message, if gui$EXEEXT doesn't start; make it + more intelligible to normal users. + +2011-02-07 Keith Marshall + + Correct omissions from packaged source tarball. + + * Makefile.in (Copyright): Add new year. + (SRCDIST_FILES): Add aclocal.m4 + (SRCDIST_SUBDIRS): Add m4 + 2011-01-05 Keith Marshall Reduce path names to base names, in some diagnostic message contexts. @@ -84,7 +132,7 @@ mingw-get-0.1-mingw32-alpha-5 released. - * configure.ac: Bump version to 0.1-alpha-5. + * configure.ac (AC_INIT): Bump version to 0.1-alpha-5. * README: Update release notes accordingly. * All files (r0-1-alpha-5): Tag assigned. diff --git a/Makefile.in b/Makefile.in index 7425257..47d01a7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,7 +6,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ # Written by Keith Marshall -# Copyright (C) 2009, 2010, MinGW Project +# Copyright (C) 2009, 2010, 2011, MinGW Project # # # Makefile template for mingw-get @@ -63,7 +63,11 @@ CORE_DLL_OBJECTS = climain.$(OBJEXT) pkgshow.$(OBJEXT) \ tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) -all: pkginfo$(EXEEXT) mingw-get$(EXEEXT) mingw-get-0.dll lastrites$(EXEEXT) +BIN_PROGRAMS = pkginfo$(EXEEXT) mingw-get$(EXEEXT) +LIBEXEC_PROGRAMS = gui$(EXEEXT) lastrites$(EXEEXT) +LIBEXEC_DATA = mingw-get-0.dll + +all: $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA) pkginfo$(EXEEXT): driver.$(OBJEXT) pkginfo.$(OBJEXT) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+ @@ -71,6 +75,11 @@ pkginfo$(EXEEXT): driver.$(OBJEXT) pkginfo.$(OBJEXT) mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT) $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+ +GUI_LDFLAGS = -mwindows $(LDFLAGS) + +gui$(EXEEXT): guimain.$(OBJEXT) + $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+ + lastrites$(EXEEXT): rites.$(OBJEXT) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+ @@ -118,28 +127,35 @@ installdirs: $(mkinstalldirs) ${PACKAGE_CONFIG_DIR} install: installdirs install-profile - $(INSTALL_PROGRAM) pkginfo$(EXEEXT) ${bindir} - $(INSTALL_PROGRAM) mingw-get$(EXEEXT) ${bindir} - $(INSTALL_PROGRAM) lastrites$(EXEEXT) ${libexecdir}/${PACKAGE_TARNAME} - $(INSTALL_DATA) mingw-get-0.dll ${libexecdir}/${PACKAGE_TARNAME} + for image in $(BIN_PROGRAMS); do \ + $(INSTALL_PROGRAM) $$image ${bindir}; \ + done + for image in $(LIBEXEC_PROGRAMS); do \ + $(INSTALL_PROGRAM) $$image ${libexecdir}/${PACKAGE_TARNAME}; \ + done + for image in $(LIBEXEC_DATA); do \ + $(INSTALL_DATA) $$image ${libexecdir}/${PACKAGE_TARNAME}; \ + done install-profile: $(INSTALL_DATA) ${srcdir}/xml/profile.xml \ ${PACKAGE_CONFIG_DIR}/defaults.xml install-strip: install - $(STRIP) ${bindir}/pkginfo$(EXEEXT) - $(STRIP) ${bindir}/mingw-get$(EXEEXT) - $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/lastrites$(EXEEXT) - $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/mingw-get-0.dll + for image in $(BIN_PROGRAMS); do \ + $(STRIP) ${bindir}/$$image; \ + done + for image in $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA); do \ + $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/$$image; \ + done # Packaging and distribution... # LICENCE_FILES = README COPYING SRCDIST_FILES = $(LICENCE_FILES) ChangeLog \ - configure.ac configure Makefile.in version.c.in + aclocal.m4 configure.ac configure Makefile.in version.c.in -SRCDIST_SUBDIRS = build-aux src src/pkginfo tinyxml xml +SRCDIST_SUBDIRS = build-aux m4 src src/pkginfo tinyxml xml # The names of distributed pacakge archive files incorporate version # information, derived from PACKAGE_VERSION; this is decomposed, so that @@ -197,7 +213,7 @@ srcdist: pkginfo.c # Workspace clean-up... # clean: - rm -f *.$(OBJEXT) *.d *.dll pkginfo$(EXEEXT) mingw-get$(EXEEXT) + rm -f *.$(OBJEXT) *.d *.dll $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS) distclean: clean rm -f config.* version.c Makefile diff --git a/README b/README index 3514599..e5a889e 100644 --- a/README +++ b/README @@ -28,6 +28,12 @@ User Visible Changes for mingw-get-0.1-mingw32-alpha-5 way), only when performing an explicit upgrade of the mingw-get-bin package itself. +- The follow-up release, designated as mingw-get-0.1-mingw32-alpha-5.1, + is a bug-fix release to correct a critical defect in the resolution of + dependencies, when performing an upgrade operation. It also provides + more meaningful diagnostics when mingw-get is invoked without arguments, + and corrects some omissions from the source tarball. + =============================================== @@ -64,8 +70,10 @@ User Visible Changes for mingw-get-0.1-mingw32-alpha-4 - Add --help|-h option + =============================================== + Release Notes for mingw-get-0.1-mingw32-alpha-3 Preamble diff --git a/configure.ac b/configure.ac index f99cb5b..d5128d7 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # $Id$ # # Written by Keith Marshall -# Copyright (C) 2009, 2010, MinGW Project +# Copyright (C) 2009, 2010, 2011, MinGW Project # # # Configuration script for mingw-get diff --git a/src/clistub.c b/src/clistub.c index 913429e..e818551 100644 --- a/src/clistub.c +++ b/src/clistub.c @@ -4,7 +4,7 @@ * $Id$ * * Written by Keith Marshall - * Copyright (C) 2009, 2010, MinGW Project + * Copyright (C) 2009, 2010, 2011, MinGW Project * * * Initiation stub for command line invocation of mingw-get @@ -302,8 +302,9 @@ int main( int argc, char **argv ) /* If we get to here, then the GUI could not be started... * Issue a diagnostic message, before abnormal termination. */ - fprintf( stderr, "%s: %S: unable to start application; status = %d\n", - progname, MINGW_GET_GUI, status + fprintf( stderr, + "%s: %S: unable to start GUI; helper program not installed\n", + progname, MINGW_GET_GUI ); return EXIT_FATAL; } diff --git a/src/guimain.cpp b/src/guimain.cpp new file mode 100644 index 0000000..7d90b02 --- /dev/null +++ b/src/guimain.cpp @@ -0,0 +1,58 @@ +/* + * guimain.cpp + * + * $Id$ + * + * Written by Keith Marshall + * Derived from stub by Sze Howe Koh + * Copyright (C) 2011, MinGW Project + * + * + * Implementation of the GUI main program function, which is invoked + * by the command line start-up stub when invoked without arguments. + * Alternatively, it may be invoked directly from a desktop shortcut, + * a launch bar shortcut or a menu entry. In any of these cases, it + * causes mingw-get to run as a GUI process. + * + * + * 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 + +int APIENTRY WinMain +( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) +{ + /* FIXME: this implementation is a stub, adapted from sample code + * provided by Sze Howe Koh . It + * does no more than display a message box indicating that GUI mode + * is not yet supported, and directing users to use the CLI version + * instead. Ultimately, this will be replaced by a functional GUI + * implementation. + */ + MessageBox( NULL, + "The GUI for mingw-get is not yet available.\n" + "Please use the command line version; for instructions,\n" + "invoke\n\n" + + " mingw-get --help\n\n" + + "at your preferred CLI prompt.", + "Feature Unavailable", + MB_ICONWARNING + ); + return 0; +} + +/* $RCSfile$: end of file */ diff --git a/src/pkgdeps.cpp b/src/pkgdeps.cpp index 242abe5..3e577ca 100644 --- a/src/pkgdeps.cpp +++ b/src/pkgdeps.cpp @@ -167,6 +167,7 @@ const char *pkgXmlNode::GetContainerAttribute( const char *key, const char *sub void pkgXmlDocument::ResolveDependencies( pkgXmlNode* package, pkgActionItem* rank ) +# define promote( request, action ) (((request) & (~ACTION_MASK)) | action ) { /* For the specified "package", (nominally a "release"), identify its * prerequisites, (as specified by "requires" tags), and schedule actions @@ -291,14 +292,19 @@ pkgXmlDocument::ResolveDependencies( pkgXmlNode* package, pkgActionItem* rank ) rank = Schedule( fallback, wanted, rank ); } - else if( (request & ACTION_MASK) == ACTION_INSTALL ) + else if( ((request & ACTION_MASK) == ACTION_INSTALL) /* * The required package is not installed... - * When performing an installation, we must schedule it + * When performing an installation, ... + */ + || ((request & (ACTION_PRIMARY | ACTION_INSTALL)) == ACTION_INSTALL) ) + /* + * or when this is a new requirement of a package + * which is being upgraded, then we must schedule it * for installation now; (we may simply ignore it, if * we are performing a removal). */ - rank = Schedule( request, wanted, rank ); + rank = Schedule( promote( request, ACTION_INSTALL ), wanted, rank ); /* Regardless of the action scheduled, we must recursively * consider further dependencies of the resolved prerequisite; diff --git a/src/pkgexec.cpp b/src/pkgexec.cpp index 992df6d..57dcfd2 100644 --- a/src/pkgexec.cpp +++ b/src/pkgexec.cpp @@ -4,7 +4,7 @@ * $Id$ * * Written by Keith Marshall - * Copyright (C) 2009, 2010, MinGW Project + * Copyright (C) 2009, 2010, 2011, MinGW Project * * * Implementation of package management task scheduler and executive. @@ -401,7 +401,9 @@ void pkgActionItem::Execute() * manifest structure has been specified and implemented. */ if( current->Selection( to_remove ) != NULL ) - dmh_printf( " removing %s\n", current->Selection( to_remove )->GetPropVal( tarname_key, value_unknown )); + dmh_printf( " FIXME:pkgRemove:not removing %s\n", + current->Selection( to_remove )->GetPropVal( tarname_key, value_unknown ) + ); } if( (current->flags & ACTION_INSTALL) == ACTION_INSTALL ) diff --git a/src/pkgtask.h b/src/pkgtask.h index 489491f..7671c4b 100644 --- a/src/pkgtask.h +++ b/src/pkgtask.h @@ -5,7 +5,7 @@ * $Id$ * * Written by Keith Marshall - * Copyright (C) 2009, 2010, MinGW Project + * Copyright (C) 2009, 2010, 2011, MinGW Project * * * This header provides manifest definitions for the action codes, @@ -54,10 +54,10 @@ enum #define ACTION_SHOW (unsigned long)(action_show) #define ACTION_UPDATE (unsigned long)(action_update) -#define STRICTLY_GT ACTION_MASK + 1 -#define STRICTLY_LT STRICTLY_GT << 1 +#define STRICTLY_GT (ACTION_MASK + 1) +#define STRICTLY_LT (STRICTLY_GT << 1) -#define ACTION_PRIMARY STRICTLY_LT << 1 +#define ACTION_PRIMARY (STRICTLY_LT << 1) #ifndef EXTERN_C # ifdef __cplusplus -- 2.11.0