[zypp-commit] r7525 - /trunk/sat-solver/testsuite/deptestomatic.c
Author: coolo Date: Sun Oct 14 14:09:00 2007 New Revision: 7525 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7525&view=rev Log: take the filename as name for a channel Modified: trunk/sat-solver/testsuite/deptestomatic.c Modified: trunk/sat-solver/testsuite/deptestomatic.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/testsuite/deptestomatic.c?rev=7525&r1=7524&r2=7525&view=diff ============================================================================== --- trunk/sat-solver/testsuite/deptestomatic.c (original) +++ trunk/sat-solver/testsuite/deptestomatic.c Sun Oct 14 14:09:00 2007 @@ -617,37 +617,46 @@ } break; - case STATE_CHANNEL: { /* read channel */ - const char *name = attrval( atts, "name" ); - const char *file = attrval( atts, "file" ); - if (file && name) { - char path[PATH_MAX]; - strncpy(path, pd->directory, sizeof(path)); - strncat(path, file, sizeof(path)); - - Source *source = add_source( pd, name, path ); - if (source) { - pd->nchannels++; - pd->channels = (struct _channelmap *)realloc( pd->channels, pd->nchannels * sizeof( struct _channelmap ) ); - if (pd->channels == NULL) { - err( "OOM!" ); - abort(); - } - struct _channelmap *cmap = pd->channels + (pd->nchannels-1); - cmap->name = str2id( pool, name, 1 ); - cmap->source = source; - } - else { - err( "Can't add <channel> %s", name ); - exit( 1 ); - } + case STATE_CHANNEL: /* read channel */ + { + const char *name = attrval( atts, "name" ); + const char *file = attrval( atts, "file" ); + if (file) + { + char path[PATH_MAX]; + strncpy(path, pd->directory, sizeof(path)); + strncat(path, file, sizeof(path)); + if (!name) + name = file; + + Source *source = add_source( pd, name, path ); + if (source) + { + pd->nchannels++; + pd->channels = (struct _channelmap *)realloc( pd->channels, pd->nchannels * sizeof( struct _channelmap ) ); + if (pd->channels == NULL) + { + err( "OOM!" ); + abort(); + } + struct _channelmap *cmap = pd->channels + (pd->nchannels-1); + cmap->name = str2id( pool, name, 1 ); + cmap->source = source; + } + else + { + err( "Can't add <channel> %s", name ); + exit( 1 ); + } + + } + else + { + err( "<channel> incomplete" ); + exit( 1 ); + } } - else { - err( "<channel> incomplete" ); - exit( 1 ); - } - } break; case STATE_SYSTEM: /* system file */ -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
coolo@svn.opensuse.org