Changeset 223bc6472936d8761b4397a20496e914b5cb5982

Show
Ignore:
Timestamp:
03/07/08 23:43:01 (3 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
  • configure.ac

    rd7f1557 r223bc64  
    8080AC_C_INLINE 
    8181AC_C_RESTRICT 
     82 
     83dnl Allow binary package maintainer to pass a custom string to avoid  
     84dnl cache problem 
     85AC_ARG_WITH(binary-version,  
     86    AS_HELP_STRING([--with-binary-version=STRING], 
     87         [To avoid plugins cache problem between binary version]),[],[]) 
     88AS_IF([test -n "${with_binary_version}"],[ 
     89      AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"], 
     90             [Binary specific version]) 
     91      ]) 
     92 
    8293 
    8394dnl 
  • 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) */