+2011-05-18 Keith Marshall <keithmarshall@users.sourceforge.net>
+
+ Augment known development status keywords and accept CMS labels.
+
+ * src/pkginfo/pkginfo.l (CMS_KEYWORDS): Define new provisional list;
+ add transitional state scanner rule and code to interpret them.
+ (STATUS_KEYWORDS): Add "pre" and "rc" to existing list; modify scanner
+ code to maintain consistency with CMS_KEYWORDS processing; also extend
+ this coding strategy to other rules.
+
+ * src/pkginfo/driver.c (spec): Strip initial '$' token from displayed
+ field values; (we expect it only for a CMS_KEYWORDS field value).
+
+ * src/pkgreqs.cpp (pkgSpecs::GetTarName): Remove any initial '$' token
+ from PACKAGE_RELEASE_STATUS field, when performing reverse of tarname
+ decomposition transformation.
+
+2011-05-18 Keith Marshall <keithmarshall@users.sourceforge.net>
+
+ Correct omission from 2011-02-18 commit.
+
+ * src/tarproc.cpp (Copyright Notice): Add 2011 as year of release.
+
2011-05-14 Keith Marshall <keithmarshall@users.sourceforge.net>
mingw-get-0.2-mingw32-alpha-4 released.
* $Id$
*
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2009, 2010, MinGW Project
+ * Copyright (C) 2009, 2010, 2011, MinGW Project
*
*
* A simple lexical analyser for decomposing package archive names into their
*
* <system-name> ::= !("0".."9"|"-"|"."){!("-"|".")}
*
- * <status> ::= ("alpha"|"beta"|"stable")[[-<build-id>]]
+ * <status> ::= ("alpha"|"beta"|"pre"|"rc"|"stable")[[-<build-id>]]
*
* <component-id> ::= <component-class>[["-"<component-version>]]
*
* <compression-type> is expected to take one of the nominal values from the
* set "bz2"|"gz"|"lzma"; however, this is similarly not enforced.
*
+ * In addition to the list of keywords identified above, <status> may be
+ * assigned any of a nominal set of CMS identifiers, (see the definition of
+ * CMS_KEYWORDS in the code below); in such cases, a "$" token is prefixed
+ * to the effective <status> value, resulting in a ranking precedence lower
+ * than that of "alpha".
+ *
* Additionally, "?" is used as a sentinel, and is not permitted *anywhere*
* in <archive-name>; (possibly something like ASCII <ETX> would be a more
- * useful choice for this purpose.
+ * useful choice for this purpose).
*
*
* This is free software. Permission is granted to copy, modify and
%x TRANS FINAL
-STATUS_KEYWORDS (alpha|beta|stable)
+STATUS_KEYWORDS (alpha|beta|pre|rc|stable)
+CMS_KEYWORDS (bzr|cms|cvs|darcs|git|hg|mono|scm|svn|vcs)
#include "pkginfo.h"
#define YY_DECL int yylex( int start, pkginfo_t signature, char *name )
* Identify a following package development <status> descriptor;
* revert to INITIAL state, to continue the <archive-name> scan.
*/
- BEGIN INITIAL;
+ BEGIN INITIAL; yyless( 0 );
if( index < PACKAGE_RELEASE_STATUS )
{
/* and, when the <status> descriptor is appropriately placed,
* set up `signature' storage to capture it, adjusting phase to
* detect a following <build-id>, (representing a release id).
*/
- name[mark] = '\0';
- signature[index = PACKAGE_RELEASE_STATUS] = name + mark + 1;
+ name[mark++] = '\0';
+ signature[index = PACKAGE_RELEASE_STATUS] = name + mark;
phase = 1;
}
/* otherwise we simply ignore a misplaced <status> descriptor,
* but in either case, we continue the scan at the start of the
* apparent <status> descriptor, which has been detected.
*/
- ++mark;
- yyless( 0 );
+ else ++mark;
+ }
+
+<TRANS>{CMS_KEYWORDS}- {
+ /*
+ * Transitional case rule...
+ * Designate a following CMS label as a <status> descriptor;
+ * revert to INITIAL state, to continue the <archive-name> scan.
+ */
+ BEGIN INITIAL; yyless( 0 );
+ if( index < PACKAGE_RELEASE_STATUS )
+ {
+ /* and, when the <status> descriptor is appropriately placed,
+ * set up `signature' storage to capture it, adjusting phase to
+ * detect a following <build-id>, (representing a release id).
+ */
+ int tail;
+ name[mark++] = '\0';
+ signature[index = PACKAGE_RELEASE_STATUS] = name + mark;
+ for( tail = mark + strlen( name + mark ) + 1; tail > mark; --tail )
+ name[tail] = name[tail - 1];
+ unput( name[mark] = '$' );
+ phase = 1;
+ }
+ /* otherwise we simply ignore a misplaced <status> descriptor,
+ * but in either case, we continue the scan at the start of the
+ * apparent <status> descriptor, which has been detected.
+ */
+ else ++mark;
}
<TRANS>([%&*]|[^-0-9.][^-.]+)(-[0-9][^-.]*){0,1}(\.[^-.]+){1,2}\? {
* terminate the preceding name element, and set up the
* `signature' table to capture the version number.
*/
- name[mark] = '\0';
- signature[++index] = name + mark + 1;
+ name[mark++] = '\0';
+ signature[++index] = name + mark;
}
/* For any other numeric element class,
* simply advance the position marker, and leave the content
* to be retrieved by a general (INITIAL) case rule.
*/
- ++mark;
+ else ++mark;
yyless( 0 );
}
/* When processing a <version> or <build-id> element,
* terminate it.
*/
- name[mark] = '\0';
+ name[mark++] = '\0';
if( phase < 2 )
/*
* ...and if we haven't reached a <build-id>, then
* (which should be <subsystem-name>),
* and reset phase accordingly.
*/
- signature[++index] = name + mark + 1;
+ signature[++index] = name + mark;
phase = 0;
}
/* Update element marker, and leave content to be scanned
* on return to the INITIAL state.
*/
- ++mark;
+ else ++mark;
yyless( 0 );
}
void *get_pkginfo( const char *name, pkginfo_t signature )
{
- if( (*signature = malloc( strlen( name ) + 2)) != NULL )
+ if( (*signature = malloc( strlen( name ) + 3)) != NULL )
{
int start = PACKAGE_NAME;
sprintf( *signature, "%s?", name );