[Pkg-voip-commits] r3008 - asterisk/trunk/debian

Lionel Elie Mamane lionel at mamane.lu
Sat Jan 13 15:15:21 CET 2007


On Sat, Jan 13, 2007 at 02:13:01PM +0100, Kilian Krause wrote:
> Modified: asterisk/trunk/debian/asterisk_fix
> ===================================================================
> --- asterisk/trunk/debian/asterisk_fix	2007-01-13 12:56:20 UTC (rev 3007)
> +++ asterisk/trunk/debian/asterisk_fix	2007-01-13 13:13:00 UTC (rev 3008)
> @@ -26,12 +26,27 @@
>  # Update from /usr/share/asterisk/sounds/priv-callerintros to 
>  #             /var/lib/asterisk/sounds/priv-callerintros
>  if [ -d /usr/share/asterisk/sounds/priv-callerintros ];then
> -	echo -n "Updating private callerinfos location to /var/lib/asterisk/sounds/priv-callerintros"
> -	if [ `find /usr/share/asterisk/sounds/priv-callerintros -mindepth 1|wc -l` -gt 0 ];then
> -		mv /usr/share/asterisk/sounds/priv-callerintros/* /var/lib/asterisk/sounds/priv-callerintros
> +	if [ -L /usr/share/asterisk/sounds/priv-callerintros ];then
> +		# if this is a fresh install just try to move the symlink.
> +		rmdir --ignore-fail-on-non-empty /var/lib/asterisk/sounds/priv-callerintros
> +		if [ ! -d /var/lib/asterisk/sounds/priv-callerintros ];then
> +			echo -n "Updating private callerintros location to /var/lib/asterisk/sounds/priv-callerintros"
> +			ln -s `readlink /usr/share/asterisk/sounds/priv-callerintros` /var/lib/asterisk/sounds/priv-callerintros
> +			rm /usr/share/asterisk/sounds/priv-callerintros
> +			echo '.'

This looks like it will misbehave when
/usr/share/asterisk/sounds/priv-callerintros is a symlink to
/var/lib/asterisk/sounds/priv-callerintros and the latter is empty
(and hence removed by the rmdir), setting
/var/lib/asterisk/sounds/priv-callerintros to be a symlink to itself.

Sorry I can't test / look into details now.

> +		else
> +			echo 'Found user installed private callerintros. Not updating private callerintros'
> +			echo 'directory to new directory. Please adjust symlink manually to new location'
> +			echo '/var/lib/asterisk/sounds/priv-callerintros.'
> +		fi
> +	else
> +		echo -n "Updating private callerintros location to /var/lib/asterisk/sounds/priv-callerintros"
> +		if [ `find /usr/share/asterisk/sounds/priv-callerintros -mindepth 1|wc -l` -gt 0 ];then
> +			mv /usr/share/asterisk/sounds/priv-callerintros/* /var/lib/asterisk/sounds/priv-callerintros
> +		fi
> +		rmdir /usr/share/asterisk/sounds/priv-callerintros
> +		echo "."
>  	fi
> -	rmdir /usr/share/asterisk/sounds/priv-callerintros
> -	echo "."
>  fi
>  
>  # Make sure all (possibly) used dirs exist and is owned by asterisk

-- 
Lionel



More information about the Pkg-voip-commits mailing list