Show
Ignore:
Timestamp:
07/03/08 23:43:01 (2 months ago)
Author:
Christophe Mutricy <xtophe@videolan.org>
git-committer:
Christophe Mutricy <xtophe@videolan.org> 1215121381 +0100
git-parent:

[d7f15579247a59841041b92b8c92746357feb47d]

git-author:
Christophe Mutricy <xtophe@videolan.org> 1215111757 +0100
Message:

Allow binary maintainer to pass a custom string

Soo that we avoid plugin cache problem between binary version.

This patch was first thought for Debian but considering it is usefull
for all distros and for VideoLAN own win32 and MacOSX builds, I
think it has its place in the master tree.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/cache.c

    re21ba63 r223bc64  
    179179    } 
    180180 
     181#ifdef DISTRO_VERSION 
     182    /* Check for distribution specific version */ 
     183    char p_distrostring[sizeof( DISTRO_VERSION )]; 
     184    i_size = sizeof( DISTRO_VERSION ) - 1; 
     185    i_read = fread( p_distrostring, 1, i_size, file ); 
     186    if( i_read != i_size || 
     187        memcmp( p_distrostring, DISTRO_VERSION, i_size ) ) 
     188    { 
     189        msg_Warn( p_this, "This doesn't look like a valid plugins cache" ); 
     190        fclose( file ); 
     191        return; 
     192    } 
     193#endif 
     194 
    181195    /* Check Sub-version number */ 
    182196    i_read = fread( &i_marker, 1, sizeof(i_marker), file ); 
     
    497511    if (fputs ("cache "COPYRIGHT_MESSAGE, file) == EOF) 
    498512        goto error; 
    499  
     513#ifdef DISTRO_VERSION 
     514    /* Allow binary maintaner to pass a string to detect new binary version*/ 
     515    if (fputs( DISTRO_VERSION, file ) == EOF) 
     516        goto error; 
     517#endif 
    500518    /* Sub-version number (to avoid breakage in the dev version when cache 
    501519     * structure changes) */