From: Keith M. <kei...@us...> - 2011-05-18 18:34:53
|
Update of /cvsroot/mingw/mingw-get/src/pkginfo In directory vz-cvs-4.sog:/tmp/cvs-serv26425/src/pkginfo Modified Files: driver.c pkginfo.l Log Message: Augment known development status keywords and accept CMS labels. Index: pkginfo.l =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkginfo/pkginfo.l,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pkginfo.l 5 May 2010 20:34:17 -0000 1.2 --- pkginfo.l 18 May 2011 18:34:51 -0000 1.3 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2010, 2011, MinGW Project * * *************** *** 34,38 **** * <system-name> ::= !("0".."9"|"-"|"."){!("-"|".")} * ! * <status> ::= ("alpha"|"beta"|"stable")[[-<build-id>]] * * <component-id> ::= <component-class>[["-"<component-version>]] --- 34,38 ---- * <system-name> ::= !("0".."9"|"-"|"."){!("-"|".")} * ! * <status> ::= ("alpha"|"beta"|"pre"|"rc"|"stable")[[-<build-id>]] * * <component-id> ::= <component-class>[["-"<component-version>]] *************** *** 52,58 **** * set "bz2"|"gz"|"lzma"; however, this is similarly not enforced. * * 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. * * --- 52,64 ---- * 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). * * *************** *** 77,81 **** %x TRANS FINAL ! STATUS_KEYWORDS (alpha|beta|stable) #include "pkginfo.h" --- 83,88 ---- %x TRANS FINAL ! STATUS_KEYWORDS (alpha|beta|pre|rc|stable) ! CMS_KEYWORDS (bzr|cms|cvs|darcs|git|hg|mono|scm|svn|vcs) #include "pkginfo.h" *************** *** 122,126 **** * revert to INITIAL state, to continue the <archive-name> scan. */ ! BEGIN INITIAL; if( index < PACKAGE_RELEASE_STATUS ) { --- 129,133 ---- * revert to INITIAL state, to continue the <archive-name> scan. */ ! BEGIN INITIAL; yyless( 0 ); if( index < PACKAGE_RELEASE_STATUS ) { *************** *** 129,134 **** * detect a following <build-id>, (representing a release id). */ ! name[mark] = '\0'; ! signature[index = PACKAGE_RELEASE_STATUS] = name + mark + 1; phase = 1; } --- 136,141 ---- * detect a following <build-id>, (representing a release id). */ ! name[mark++] = '\0'; ! signature[index = PACKAGE_RELEASE_STATUS] = name + mark; phase = 1; } *************** *** 137,142 **** * apparent <status> descriptor, which has been detected. */ ! ++mark; ! yyless( 0 ); } --- 144,176 ---- * apparent <status> descriptor, which has been detected. */ ! 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; } *************** *** 168,173 **** * `signature' table to capture the version number. */ ! name[mark] = '\0'; ! signature[++index] = name + mark + 1; } /* For any other numeric element class, --- 202,207 ---- * `signature' table to capture the version number. */ ! name[mark++] = '\0'; ! signature[++index] = name + mark; } /* For any other numeric element class, *************** *** 175,179 **** * to be retrieved by a general (INITIAL) case rule. */ ! ++mark; yyless( 0 ); } --- 209,213 ---- * to be retrieved by a general (INITIAL) case rule. */ ! else ++mark; yyless( 0 ); } *************** *** 191,195 **** * terminate it. */ ! name[mark] = '\0'; if( phase < 2 ) /* --- 225,229 ---- * terminate it. */ ! name[mark++] = '\0'; if( phase < 2 ) /* *************** *** 203,207 **** * and reset phase accordingly. */ ! signature[++index] = name + mark + 1; phase = 0; } --- 237,241 ---- * and reset phase accordingly. */ ! signature[++index] = name + mark; phase = 0; } *************** *** 209,213 **** * on return to the INITIAL state. */ ! ++mark; yyless( 0 ); } --- 243,247 ---- * on return to the INITIAL state. */ ! else ++mark; yyless( 0 ); } *************** *** 269,273 **** void *get_pkginfo( const char *name, pkginfo_t signature ) { ! if( (*signature = malloc( strlen( name ) + 2)) != NULL ) { int start = PACKAGE_NAME; --- 303,307 ---- void *get_pkginfo( const char *name, pkginfo_t signature ) { ! if( (*signature = malloc( strlen( name ) + 3)) != NULL ) { int start = PACKAGE_NAME; Index: driver.c =================================================================== RCS file: /cvsroot/mingw/mingw-get/src/pkginfo/driver.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** driver.c 12 Nov 2009 22:33:26 -0000 1.2 --- driver.c 18 May 2011 18:34:51 -0000 1.3 *************** *** 5,9 **** * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, MinGW Project * * --- 5,9 ---- * * Written by Keith Marshall <kei...@us...> ! * Copyright (C) 2009, 2011, MinGW Project * * *************** *** 49,53 **** if( tag == NULL ) return unspecified; ! return tag; } --- 49,53 ---- if( tag == NULL ) return unspecified; ! return (*tag == '$') ? ++tag : tag; } |