OSDN Git Service

Merge from mingw-get-0.1-mingw32-alpha-5 bug-fix branch.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Sun, 13 Feb 2011 21:23:58 +0000 (21:23 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Sun, 13 Feb 2011 21:23:58 +0000 (21:23 +0000)
ChangeLog
Makefile.in
README
configure.ac
src/clistub.c
src/guimain.cpp [new file with mode: 0644]
src/pkgdeps.cpp
src/pkgexec.cpp
src/pkgtask.h

index aa30e0c..7189bd0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,51 @@
+2011-02-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       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  <keithmarshall@users.sourceforge.net>
+
+       Publish mingw-get-0.0-mingw32-alpha-5.1 bug-fix release.
+
+       * README: Updated to reflect changes.
+
+2011-02-08  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Improve diagnostics for failed GUI invocation.
+
+       * src/guimain.cpp: New file; currently delivers only a diagnostic
+       stub, provided by Sze Howe Koh <axfangli@users.sourceforge.net>, 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  <keithmarshall@users.sourceforge.net>
+
+       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  <keithmarshall@users.sourceforge.net>
 
        Reduce path names to base names, in some diagnostic message contexts.
 
        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.
 
index 7425257..47d01a7 100644 (file)
@@ -6,7 +6,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 
 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# 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 (file)
--- 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
index f99cb5b..d5128d7 100644 (file)
@@ -3,7 +3,7 @@
 # $Id$
 #
 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2009, 2010, MinGW Project
+# Copyright (C) 2009, 2010, 2011, MinGW Project
 #
 #
 # Configuration script for mingw-get
index 913429e..e818551 100644 (file)
@@ -4,7 +4,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * 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 (file)
index 0000000..7d90b02
--- /dev/null
@@ -0,0 +1,58 @@
+/*\r
+ * guimain.cpp\r
+ *\r
+ * $Id$\r
+ *\r
+ * Written by Keith Marshall <keithmarshall@users.sourceforge.net>\r
+ * Derived from stub by Sze Howe Koh <axfangli@users.sourceforge.net>\r
+ * Copyright (C) 2011, MinGW Project\r
+ *\r
+ *\r
+ * Implementation of the GUI main program function, which is invoked\r
+ * by the command line start-up stub when invoked without arguments.\r
+ * Alternatively, it may be invoked directly from a desktop shortcut,\r
+ * a launch bar shortcut or a menu entry.  In any of these cases, it\r
+ * causes mingw-get to run as a GUI process.\r
+ *\r
+ *\r
+ * This is free software.  Permission is granted to copy, modify and\r
+ * redistribute this software, under the provisions of the GNU General\r
+ * Public License, Version 3, (or, at your option, any later version),\r
+ * as published by the Free Software Foundation; see the file COPYING\r
+ * for licensing details.\r
+ *\r
+ * Note, in particular, that this software is provided "as is", in the\r
+ * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not\r
+ * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY\r
+ * PARTICULAR PURPOSE.  Under no circumstances will the author, or the\r
+ * MinGW Project, accept liability for any damages, however caused,\r
+ * arising from the use of this software.\r
+ *\r
+ */\r
+#include <windows.h>\r
+\r
+int APIENTRY WinMain\r
+( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )\r
+{\r
+  /* FIXME: this implementation is a stub, adapted from sample code\r
+   * provided by Sze Howe Koh <axfangli@users.sourceforge.net>.  It\r
+   * does no more than display a message box indicating that GUI mode\r
+   * is not yet supported, and directing users to use the CLI version\r
+   * instead.  Ultimately, this will be replaced by a functional GUI\r
+   * implementation.\r
+   */\r
+  MessageBox( NULL,\r
+      "The GUI for mingw-get is not yet available.\n"\r
+      "Please use the command line version; for instructions,\n"\r
+      "invoke\n\n"\r
+\r
+      "  mingw-get --help\n\n"\r
+\r
+      "at your preferred CLI prompt.",\r
+      "Feature Unavailable",\r
+      MB_ICONWARNING\r
+    );\r
+  return 0;\r
+}\r
+\r
+/* $RCSfile$: end of file */\r
index 242abe5..3e577ca 100644 (file)
@@ -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;
index 992df6d..57dcfd2 100644 (file)
@@ -4,7 +4,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * 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<stub>:not removing %s\n",
+             current->Selection( to_remove )->GetPropVal( tarname_key, value_unknown )
+           );
       }
 
       if( (current->flags & ACTION_INSTALL) == ACTION_INSTALL )
index 489491f..7671c4b 100644 (file)
@@ -5,7 +5,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * 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