- if( b_os && b_arch )
- {
- if( strcmp( psz_eltname, "version" ) == 0 )
- {
- if( !strcmp( psz_name, "major" ) )
- tmp_release.psz_major = STRDUP( psz_value );
- else if( !strcmp( psz_name, "minor" ) )
- tmp_release.psz_minor = STRDUP( psz_value );
- else if( !strcmp( psz_name, "revision" ) )
- tmp_release.psz_revision = STRDUP( psz_value );
- else if( !strcmp( psz_name, "extra" ) )
- tmp_release.psz_extra = STRDUP( psz_value );
- else if( !strcmp( psz_name, "svn" ) )
- tmp_release.psz_svn_revision =
- STRDUP( psz_value );
- else if( !strcmp( psz_name, "version" ) )
- {
- if( !strcmp( psz_value, "unstable" ) )
- tmp_release.i_type =
- UPDATE_RELEASE_TYPE_UNSTABLE;
- else if( !strcmp( psz_value, "testing" ) )
- tmp_release.i_type =
- UPDATE_RELEASE_TYPE_TESTING;
- else
- tmp_release.i_type =
- UPDATE_RELEASE_TYPE_STABLE;
- }
- }
- else if( !strcmp( psz_eltname, "file" ) )
- {
- if( !strcmp( psz_name, "type" ) )
- {
- if( !strcmp( psz_value, "info" ) )
- tmp_file.i_type = UPDATE_FILE_TYPE_INFO;
- else if( !strcmp( psz_value, "source" ) )
- tmp_file.i_type = UPDATE_FILE_TYPE_SOURCE;
- else if( !strcmp( psz_value, "binary" ) )
- tmp_file.i_type = UPDATE_FILE_TYPE_BINARY;
- else if( !strcmp( psz_value, "plugin" ) )
- tmp_file.i_type = UPDATE_FILE_TYPE_PLUGIN;
- else
- tmp_file.i_type = UPDATE_FILE_TYPE_UNDEF;
- }
- else if( !strcmp( psz_name, "md5" ) )
- tmp_file.psz_md5 = STRDUP( psz_value );
- else if( !strcmp( psz_name, "size" ) )
- tmp_file.l_size = atol( psz_value );
- else if( !strcmp( psz_name, "url" ) )
- tmp_file.psz_url = STRDUP( psz_value );
- }
- }
- if( !strcmp( psz_name, "name" )
- && ( !strcmp( psz_value, UPDATE_VLC_OS )
- || !strcmp( psz_value, "*" ) )
- && !strcmp( psz_eltname, "os" ) )
- {
- b_os = VLC_TRUE;
- }
- if( b_os && !strcmp( psz_name, "name" )
- && ( !strcmp( psz_value, UPDATE_VLC_ARCH )
- || !strcmp( psz_value, "*" ) )
- && !strcmp( psz_eltname, "arch" ) )
- {
- b_arch = VLC_TRUE;
- }
- FREENULL( psz_name );
- FREENULL( psz_value );
- }
- if( ( b_os && b_arch && strcmp( psz_eltname, "arch" ) ) )
- {
- if( !strcmp( psz_eltname, "version" ) )
- {
- int i;
- /* look for a previous occurrence of this release */
- for( i = 0; i < p_update->i_releases; i++ )
- {
- p_release = p_update->p_releases + i;
- if( CompareReleases( p_release, &tmp_release )
- == UPDATE_RELEASE_STATUS_EQUAL )
- {
- break;
- }
- }
- /* if this is the first time that we see this release,
- * append it to the list of releases */
- if( i == p_update->i_releases )
- {
- tmp_release.i_status =
- CompareReleaseToCurrent( &tmp_release );
- p_update->p_releases =
- (struct update_release_t *)realloc( p_update->p_releases,
- (++(p_update->i_releases))*sizeof( struct update_release_t ) );
- p_update->p_releases[ p_update->i_releases - 1 ] =
- tmp_release;
- p_release =
- p_update->p_releases + p_update->i_releases - 1;
- tmp_release.psz_major = NULL;
- tmp_release.psz_minor = NULL;
- tmp_release.psz_revision = NULL;
- tmp_release.psz_extra = NULL;
- tmp_release.psz_svn_revision = NULL;
- tmp_release.i_type = UPDATE_RELEASE_TYPE_STABLE;
- tmp_release.i_status = 0;
- tmp_release.p_files = NULL;
- tmp_release.i_files = 0;
- }
- else
- {
- FREENULL( tmp_release.psz_major );
- FREENULL( tmp_release.psz_minor );
- FREENULL( tmp_release.psz_revision );
- FREENULL( tmp_release.psz_extra );
- FREENULL( tmp_release.psz_svn_revision );
- tmp_release.i_type = UPDATE_RELEASE_TYPE_STABLE;
- FREENULL( tmp_release.p_files );
- tmp_release.i_files = 0;
- }
- }
- else if( !strcmp( psz_eltname, "file" ) )
- {
- /* append file to p_release's file list */
- if( p_release == NULL )
- {
- goto error;
- }
- p_release->p_files =
- (struct update_file_t *)realloc( p_release->p_files,
- (++(p_release->i_files))*sizeof( struct update_file_t ) );
- p_release->p_files[ p_release->i_files - 1 ] = tmp_file;
- tmp_file.i_type = UPDATE_FILE_TYPE_UNDEF;
- tmp_file.psz_md5 = NULL;
- tmp_file.l_size = 0;
- tmp_file.psz_url = NULL;
- tmp_file.psz_description = NULL;
- }
- }
- FREENULL( psz_eltname );
- break;