summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-02-07 23:22:33 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-02-07 23:22:33 +0000
commitfb2fe7b925efb93f26cb38e35acd15e248cd60b4 (patch)
tree88b50a280c9b7a95febfb3593a8d8aecd61226ed
parent18d851ea42a33a78d2e9b3687311ee5e3ea228af (diff)
parent167035abe222bad88269d296f9d819365a6c6007 (diff)
downloadxine-lib-fb2fe7b925efb93f26cb38e35acd15e248cd60b4.tar.gz
xine-lib-fb2fe7b925efb93f26cb38e35acd15e248cd60b4.tar.bz2
Merge; mark 1.1.11.
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac30
-rw-r--r--src/xine-engine/load_plugins.c78
3 files changed, 70 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index c9161619d..6cab98cc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+xine-lib (1.1.11) unreleased
+ * Reworked the plugin directory naming so that external plugins don't have
+ to be rebuilt for every release. We now use a naming scheme based on the
+ API/ABI versioning, checking older directories - with this release, the
+ plugin directory name is 1.19, and if this gets bumped to 1.20 in a
+ future release, 1.19 will still be available for external plugins.
+ (Any directories not 1.* won't be looked in.)
+
xine-lib (1.1.10.1) 2008-02-07
* Security fixes:
- Array index vulnerability which may allow remote attackers to execute
diff --git a/configure.ac b/configure.ac
index 6ba204361..45f262159 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,9 +16,9 @@ dnl XINE_SUB += 1; XINE_PATCH = ''; continue with XINE_LT_* values below
dnl
XINE_MAJOR=1
XINE_MINOR=1
-XINE_SUB=10
+XINE_SUB=11
dnl XINE_PATCH should be left empty or set to ".1" or ".2" or something similar
-XINE_PATCH=.1
+XINE_PATCH=
dnl if test $XINE_SUB -eq 0 ; then
dnl XINE_SUBPART="";
@@ -78,6 +78,9 @@ AC_SUBST(XINE_LT_CURRENT)
AC_SUBST(XINE_LT_REVISION)
AC_SUBST(XINE_LT_AGE)
+AC_DEFINE_UNQUOTED(XINE_LT_CURRENT, $XINE_LT_CURRENT, [xine interface version number])
+AC_DEFINE_UNQUOTED(XINE_LT_AGE, $XINE_LT_AGE, [xine interface version age])
+
SPEC_VERSION=$XINE_MAJOR.$XINE_MINOR${XINE_SUBPART}$XINE_PRE
TAR_NAME="xine-lib-"$SPEC_VERSION
dnl TAR_NAME="xine-lib-"$XINE_MAJOR-$XINE_PRE
@@ -2399,38 +2402,45 @@ AC_SUBST(xinelibdir)
AC_SUBST(xinedatadir)
AC_SUBST(pkgconfigdir)
-XINE_PLUGINDIR="\${xinelibdir}/plugins/$XINE_MAJOR.$XINE_MINOR.$XINE_SUB"
+XINE_PLUGINROOT="\${xinelibdir}/plugins/$(($XINE_LT_CURRENT-$XINE_LT_AGE))"
+XINE_PLUGINDIR="$XINE_PLUGINROOT.$XINE_LT_AGE"
XINE_FONTDIR="\${xinedatadir}/libxine$XINE_MAJOR/fonts"
XINE_LOCALEDIR='${datadir}/locale'
-XINE_REL_PLUGINDIR="`makeexpand "$XINE_PLUGINDIR"`"
-XINE_REL_PLUGINDIR="`makeexpand "$XINE_REL_PLUGINDIR" | sed -e "s,^${prefix}/,,"`"
+XINE_REL_PLUGINROOT="`makeexpand "$XINE_PLUGINROOT"`"
+XINE_REL_PLUGINROOT="`makeexpand "$XINE_REL_PLUGINROOT" | sed -e "s,^${prefix}/,,"`"
+XINE_REL_PLUGINDIR="$XINE_REL_PLUGINROOT.$XINE_LT_AGE"
XINE_REL_FONTDIR="`makeexpand "$XINE_FONTDIR" | sed -e "s,^${prefix}/,,"`"
XINE_REL_LOCALEDIR="`makeexpand "$XINE_LOCALEDIR" | sed -e "s,^${prefix}/,,"`"
XINE_PKGCONFIG_DIR="`makeexpand "$pkgconfigdir"`"
if test "x$SYS" = "xmingw32" -o "x$SYS" = "xcygwin"; then
dnl polish paths (MinGW runtime accepts both \ and / anyway)
- XINE_REL_PLUGINDIR="`echo "$XINE_REL_PLUGINDIR" | sed -e 's/\\//\\\\\\\\/g'`"
+ XINE_REL_PLUGINROOT="`echo "$XINE_REL_PLUGINROOT" | sed -e 's/\\//\\\\\\\\/g'`"
+ XINE_REL_PLUGINDIR="$XINE_REL_PLUGINROOT.$XINE_LT_AGE"
XINE_REL_FONTDIR="`echo "$XINE_REL_FONTDIR" | sed -e 's/\\//\\\\\\\\/g'`"
XINE_REL_LOCALEDIR="`echo "$XINE_REL_LOCALEDIR" | sed -e 's/\\//\\\\\\\\/g'`"
dnl prefix in xine-config
XINE_CONFIG_PREFIX="\$(cd \$(dirname \$0)/..; pwd)"
dnl installation directories (in xine-config)
- XINE_PLUGINPATH="$XINE_CONFIG_PREFIX/$XINE_REL_PLUGINDIR"
+ XINE_PLUGINROOTPATH="$XINE_CONFIG_PREFIX/$XINE_REL_PLUGINROOT"
+ XINE_PLUGINPATH="$XINE_PLUGINROOTPATH.$XINE_LT_AGE"
XINE_FONTPATH="$XINE_CONFIG_PREFIX/$XINE_REL_FONTDIR"
XINE_LOCALEPATH="$XINE_CONFIG_PREFIX/$XINE_REL_LOCALEDIR"
dnl runtime directories
- AC_DEFINE(XINE_PLUGINDIR,[xine_get_plugindir()],[Define this to plugins directory location])
+ AC_DEFINE(XINE_PLUGINROOT,[xine_get_pluginroot()],[Define this to general plugins directory location])
+ AC_DEFINE(XINE_PLUGINDIR,[xine_get_plugindir()],[Define this to specific plugins directory location])
AC_DEFINE(XINE_FONTDIR,[xine_get_fontdir()],[Define this to osd fonts dir location])
AC_DEFINE(XINE_LOCALEDIR,[xine_get_localedir()],[Path where catalog files will be.])
else
dnl prefix in xine-config
XINE_CONFIG_PREFIX="`makeexpand "${prefix}"`"
dnl directories from xine-config and runtime directories
- XINE_PLUGINPATH="`makeexpand "$XINE_PLUGINDIR"`"
+ XINE_PLUGINROOTPATH="`makeexpand "$XINE_PLUGINROOT"`"
+ XINE_PLUGINPATH="$XINE_PLUGINROOTPATH.$XINE_LT_AGE"
XINE_FONTPATH="`makeexpand "$XINE_FONTDIR"`"
XINE_LOCALEPATH="`makeexpand "$XINE_LOCALEDIR"`"
dnl defining runtime directories
- AC_DEFINE_UNQUOTED(XINE_PLUGINDIR,"$XINE_PLUGINPATH",[Define this to plugins directory location])
+ AC_DEFINE_UNQUOTED(XINE_PLUGINROOT,"$XINE_PLUGINROOTPATH",[Define this to general plugins directory location])
+ AC_DEFINE_UNQUOTED(XINE_PLUGINDIR,"$XINE_PLUGINPATH",[Define this to specific plugins directory location])
AC_DEFINE_UNQUOTED(XINE_FONTDIR,"$XINE_FONTPATH",[Define this to osd fonts dir location])
AC_DEFINE_UNQUOTED(XINE_LOCALEDIR, "$XINE_LOCALEPATH",[Path where catalog files will be.])
fi
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 71cb19d3b..0188fb01d 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -1119,14 +1119,24 @@ static void load_cached_catalog (xine_t *this) {
}
+/* helper function for _x_scan_plugins */
+static void push_if_dir (xine_list_t *plugindirs, void *path)
+{
+ struct stat st;
+ if (!stat (path, &st) && S_ISDIR (st.st_mode))
+ xine_list_push_back (plugindirs, path);
+ else
+ free (path);
+}
+
/*
* initialize catalog, load all plugins into new catalog
*/
void _x_scan_plugins (xine_t *this) {
-
- char *homedir, *plugindir, *pluginpath;
- int i,j;
- int lenpluginpath;
+
+ char *homedir, *pluginpath;
+ xine_list_t *plugindirs = xine_list_new ();
+ xine_list_iterator_t iter;
lprintf("_x_scan_plugins()\n");
@@ -1140,41 +1150,37 @@ void _x_scan_plugins (xine_t *this) {
this->plugin_catalog = _new_catalog();
load_cached_catalog (this);
- if ((pluginpath = getenv("XINE_PLUGIN_PATH")) != NULL) {
- pluginpath = strdup(pluginpath);
+ if ((pluginpath = getenv("XINE_PLUGIN_PATH")) != NULL && *pluginpath) {
+ char *p = pluginpath - 1;
+ while (p[1])
+ {
+ char *dir, *q = p;
+ p = strchr (p + 1, XINE_PATH_SEPARATOR_CHAR);
+ if (q[0] == '~' && q[1] == '/')
+ asprintf (&dir, "%s%.*s", homedir, (int)(p - q - 1), q + 1);
+ else
+ dir = strndup (q, p - q);
+ push_if_dir (plugindirs, dir); /* store or free it */
+ }
} else {
- const char *str1, *str2;
- int len;
-
- str1 = "~/.xine/plugins";
- str2 = XINE_PLUGINDIR;
- len = strlen(str1) + strlen(str2) + 2;
- pluginpath = xine_xmalloc(len);
- snprintf(pluginpath, len, "%s" XINE_PATH_SEPARATOR_STRING "%s", str1, str2);
- }
- plugindir = xine_xmalloc(strlen(pluginpath)+strlen(homedir)+2);
- j=0;
- lenpluginpath = strlen(pluginpath);
- for (i=0; i <= lenpluginpath; ++i){
- switch (pluginpath[i]){
- case XINE_PATH_SEPARATOR_CHAR:
- case '\0':
- plugindir[j] = '\0';
- collect_plugins(this, plugindir);
- j = 0;
- break;
- case '~':
- if (j == 0){
- strcpy(plugindir, homedir);
- j = strlen(plugindir);
- break;
- }
- default:
- plugindir[j++] = pluginpath[i];
+ char *dir;
+ int i;
+ asprintf (&dir, "%s/.xine/plugins", homedir);
+ push_if_dir (plugindirs, dir);
+ for (i = 0; i <= XINE_LT_AGE; ++i)
+ {
+ asprintf (&dir, "%s.%d", XINE_PLUGINROOT, XINE_LT_AGE - i);
+ push_if_dir (plugindirs, dir);
}
}
- free(plugindir);
- free(pluginpath);
+ for (iter = xine_list_front (plugindirs); iter;
+ iter = xine_list_next (plugindirs, iter))
+ {
+ char *dir = xine_list_get_value (plugindirs, iter);
+ collect_plugins(this, dir);
+ free (dir);
+ }
+ xine_list_delete (plugindirs);
free(homedir);
save_catalog (this);