Merged in lindenlab/viewer-lynx

Mon, 07 Mar 2016 18:45:12 +0200

author
AndreyL ProductEngine <alihatskiy@productengine.com>
date
Mon, 07 Mar 2016 18:45:12 +0200
changeset 48915
b11d9da3c1bf
parent 48909
16f91253ce49
parent 48914
9951ebb842b6
child 48916
3a87b4065448

Merged in lindenlab/viewer-lynx

indra/newview/llviewertexture.cpp file | annotate | diff | revisions
indra/newview/llviewertexturelist.cpp file | annotate | diff | revisions
indra/newview/llvoavatar.cpp file | annotate | diff | revisions
     1.1 --- a/BuildParams	Fri Mar 04 18:22:08 2016 +0200
     1.2 +++ b/BuildParams	Mon Mar 07 18:45:12 2016 +0200
     1.3 @@ -70,15 +70,12 @@
     1.4  # the viewer_channel_suffix is prefixed by a blank and then appended to the viewer_channel
     1.5  # for the package in a setting that overrides the compiled-in value
     1.6  ################################################################
     1.7 -## Removed 2015-07-02 (MAINT-5360) until we fix packaging step in Team City
     1.8 -## additional_packages = "EDU"
     1.9 +additional_packages = "EDU"
    1.10  
    1.11  # The EDU package allows us to create a separate release channel whose expirations
    1.12  # are synchronized as much as possible with the academic year
    1.13 -## Removed 2015-07-02 (MAINT-5360) until we fix packaging step in Team City
    1.14 -## EDU_sourceid = ""
    1.15 -## Removed 2015-07-02 (MAINT-5360) until we fix packaging step in Team City
    1.16 -## EDU_viewer_channel_suffix = "edu"
    1.17 +EDU_sourceid = ""
    1.18 +EDU_viewer_channel_suffix = "edu"
    1.19  
    1.20  # Notifications - to configure email notices, add a setting like this:
    1.21  # <username>_<reponame>.email = <email-address>
     2.1 --- a/indra/llcorehttp/CMakeLists.txt	Fri Mar 04 18:22:08 2016 +0200
     2.2 +++ b/indra/llcorehttp/CMakeLists.txt	Mon Mar 07 18:45:12 2016 +0200
     2.3 @@ -141,6 +141,43 @@
     2.4                            "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llcorehttp_peer.py"
     2.5                            )
     2.6  
     2.7 +if (DARWIN)
     2.8 +  # Path inside the app bundle where we'll need to copy libraries
     2.9 +  set(LL_TEST_DESTINATION_DIR
    2.10 +    ${CMAKE_SOURCE_DIR}/../build-darwin-i386/sharedlibs/Resources
    2.11 +  )
    2.12 +
    2.13 +  # Create the Contents/Resources directory
    2.14 +  add_custom_command(
    2.15 +    TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
    2.16 +    COMMAND ${CMAKE_COMMAND}
    2.17 +    ARGS
    2.18 +      -E
    2.19 +      make_directory
    2.20 +      ${LL_TEST_DESTINATION_DIR}
    2.21 +    COMMENT "Creating Resources directory in app bundle."
    2.22 +  )
    2.23 +  
    2.24 +  # Copy the required libraries to the package app
    2.25 +  add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
    2.26 +    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib ${LL_TEST_DESTINATION_DIR}
    2.27 +    DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib
    2.28 +  )
    2.29 +  add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
    2.30 +    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib ${LL_TEST_DESTINATION_DIR}
    2.31 +    DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib
    2.32 +  )
    2.33 +  add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
    2.34 +    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib ${LL_TEST_DESTINATION_DIR}
    2.35 +    DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib
    2.36 +  )
    2.37 +  add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
    2.38 +    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib ${LL_TEST_DESTINATION_DIR}
    2.39 +    DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib
    2.40 +  )
    2.41 +
    2.42 +endif (DARWIN)
    2.43 +
    2.44    #
    2.45    # Example Programs
    2.46    #
     3.1 --- a/indra/media_plugins/cef/CMakeLists.txt	Fri Mar 04 18:22:08 2016 +0200
     3.2 +++ b/indra/media_plugins/cef/CMakeLists.txt	Mon Mar 07 18:45:12 2016 +0200
     3.3 @@ -114,4 +114,12 @@
     3.4      LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
     3.5    )
     3.6  
     3.7 +  add_custom_command(TARGET media_plugin_cef
     3.8 +    POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework"
     3.9 +        "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework"
    3.10 +        "$<TARGET_FILE:media_plugin_cef>"
    3.11 +    VERBATIM
    3.12 +    COMMENT "Fixing path to CEF Framework"
    3.13 +  )
    3.14 +
    3.15  endif (DARWIN)
     4.1 --- a/indra/newview/lllocalbitmaps.cpp	Fri Mar 04 18:22:08 2016 +0200
     4.2 +++ b/indra/newview/lllocalbitmaps.cpp	Mon Mar 07 18:45:12 2016 +0200
     4.3 @@ -135,7 +135,7 @@
     4.4  	}
     4.5  
     4.6  	// delete self from gimagelist
     4.7 -	LLViewerFetchedTexture* image = gTextureList.findImage(mWorldID, TEX_LIST_STANDARD);
     4.8 +	LLViewerFetchedTexture* image = gTextureList.findImage(mWorldID, TEX_LIST_DISCARD);
     4.9  	gTextureList.deleteImage(image);
    4.10  
    4.11  	if (image)
    4.12 @@ -207,7 +207,7 @@
    4.13  					texture->setCachedRawImage(LL_LOCAL_DISCARD_LEVEL, raw_image);
    4.14  					texture->ref(); 
    4.15  
    4.16 -					gTextureList.addImage(texture, TEX_LIST_STANDARD);
    4.17 +					gTextureList.addImage(texture, TEX_LIST_DISCARD);
    4.18  			
    4.19  					if (optional_firstupdate != UT_FIRSTUSE)
    4.20  					{
    4.21 @@ -215,7 +215,7 @@
    4.22  						replaceIDs(old_id, mWorldID);
    4.23  
    4.24  						// remove old_id from gimagelist
    4.25 -						LLViewerFetchedTexture* image = gTextureList.findImage(old_id, TEX_LIST_STANDARD);
    4.26 +						LLViewerFetchedTexture* image = gTextureList.findImage(old_id, TEX_LIST_DISCARD);
    4.27  						if (image != NULL)
    4.28  						{
    4.29  							gTextureList.deleteImage(image);
    4.30 @@ -384,7 +384,7 @@
    4.31  std::vector<LLViewerObject*> LLLocalBitmap::prepUpdateObjects(LLUUID old_id, U32 channel)
    4.32  {
    4.33  	std::vector<LLViewerObject*> obj_list;
    4.34 -	LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id, TEX_LIST_STANDARD);
    4.35 +	LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id, TEX_LIST_DISCARD);
    4.36  
    4.37  	for(U32 face_iterator = 0; face_iterator < old_texture->getNumFaces(channel); face_iterator++)
    4.38  	{
    4.39 @@ -502,7 +502,7 @@
    4.40  
    4.41  void LLLocalBitmap::updateUserSculpts(LLUUID old_id, LLUUID new_id)
    4.42  {
    4.43 -	LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id, TEX_LIST_STANDARD);
    4.44 +	LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id, TEX_LIST_DISCARD);
    4.45  	for(U32 volume_iter = 0; volume_iter < old_texture->getNumVolumes(); volume_iter++)
    4.46  	{
    4.47  		LLVOVolume* volume_to_object = (*old_texture->getVolumeList())[volume_iter];
     5.1 --- a/indra/newview/llpanelface.cpp	Fri Mar 04 18:22:08 2016 +0200
     5.2 +++ b/indra/newview/llpanelface.cpp	Mon Mar 07 18:45:12 2016 +0200
     5.3 @@ -2214,7 +2214,7 @@
     5.4  				LLTextureEntry *te = object->getTE(te_index);
     5.5  				if (te)
     5.6  				{
     5.7 -					LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : NULL;
     5.8 +					LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_DISCARD) : NULL;
     5.9  					if(!tex)
    5.10  					{
    5.11  						tex = LLViewerFetchedTexture::sDefaultImagep;
     6.1 --- a/indra/newview/lltexturectrl.cpp	Fri Mar 04 18:22:08 2016 +0200
     6.2 +++ b/indra/newview/lltexturectrl.cpp	Mon Mar 07 18:45:12 2016 +0200
     6.3 @@ -1393,7 +1393,7 @@
     6.4  
     6.5  void	LLTextureCtrl::setImageAssetName(const std::string& name)
     6.6  {
     6.7 -	LLPointer<LLUIImage> imagep = LLUI::getUIImage(name, LLGLTexture::BOOST_PREVIEW);
     6.8 +	LLPointer<LLUIImage> imagep = LLUI::getUIImage(name);
     6.9  	if(imagep)
    6.10  	{
    6.11  		LLViewerFetchedTexture* pTexture = dynamic_cast<LLViewerFetchedTexture*>(imagep->getImage().get());
     7.1 --- a/indra/newview/lltexturefetch.cpp	Fri Mar 04 18:22:08 2016 +0200
     7.2 +++ b/indra/newview/lltexturefetch.cpp	Mon Mar 07 18:45:12 2016 +0200
     7.3 @@ -4460,7 +4460,7 @@
     7.4  			mRefetchedAllData += worker->mFormattedImage->getDataSize();
     7.5  
     7.6  			// refetch list only requests/creates normal images, so requesting ui='false'
     7.7 -			LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, TEX_LIST_STANDARD);
     7.8 +			LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, TEX_LIST_DISCARD);
     7.9  			if(tex && mRefetchList[tex].begin() != mRefetchList[tex].end())
    7.10  			{
    7.11  				if(worker->mDecodedDiscard == mFetchingHistory[mRefetchList[tex][0]].mDecodedLevel)
     8.1 --- a/indra/newview/llviewerparcelmgr.cpp	Fri Mar 04 18:22:08 2016 +0200
     8.2 +++ b/indra/newview/llviewerparcelmgr.cpp	Mon Mar 07 18:45:12 2016 +0200
     8.3 @@ -143,8 +143,8 @@
     8.4  	// JC: Resolved a merge conflict here, eliminated
     8.5  	// mBlockedImage->setAddressMode(LLTexUnit::TAM_WRAP);
     8.6  	// because it is done in llviewertexturelist.cpp
     8.7 -	mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryLines.png");
     8.8 -	mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryPassLines.png");
     8.9 +	mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryLines.png", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI);
    8.10 +	mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryPassLines.png", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI);
    8.11  
    8.12  	S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS;
    8.13  	sPackedOverlay = new U8[overlay_size];
     9.1 --- a/indra/newview/llviewertexture.cpp	Fri Mar 04 18:22:08 2016 +0200
     9.2 +++ b/indra/newview/llviewertexture.cpp	Mon Mar 07 18:45:12 2016 +0200
     9.3 @@ -3323,7 +3323,7 @@
     9.4  
     9.5  	setCategory(LLGLTexture::MEDIA);
     9.6  	
     9.7 -	LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_STANDARD);
     9.8 +	LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_DISCARD);
     9.9  	if(tex) //this media is a parcel media for tex.
    9.10  	{
    9.11  		tex->setParcelMedia(this);
    9.12 @@ -3333,7 +3333,7 @@
    9.13  //virtual 
    9.14  LLViewerMediaTexture::~LLViewerMediaTexture() 
    9.15  {	
    9.16 -	LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_STANDARD);
    9.17 +	LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_DISCARD);
    9.18  	if(tex) //this media is a parcel media for tex.
    9.19  	{
    9.20  		tex->setParcelMedia(NULL);
    9.21 @@ -3388,7 +3388,7 @@
    9.22  
    9.23  	BOOL ret = TRUE;
    9.24  	
    9.25 -	LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_STANDARD);
    9.26 +	LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_DISCARD);
    9.27  	if(tex) //this media is a parcel media for tex.
    9.28  	{
    9.29  		for (U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch)
    9.30 @@ -3497,7 +3497,7 @@
    9.31  	const LLTextureEntry* te = facep->getTextureEntry();
    9.32  	if(te && te->getID().notNull())
    9.33  	{
    9.34 -		LLViewerTexture* tex = gTextureList.findImage(te->getID(), TEX_LIST_STANDARD);
    9.35 +		LLViewerTexture* tex = gTextureList.findImage(te->getID(), TEX_LIST_DISCARD);
    9.36  		if(tex)
    9.37  		{
    9.38  			mTextureList.push_back(tex);//increase the reference number by one for tex to avoid deleting it.
    9.39 @@ -3526,7 +3526,7 @@
    9.40  	const LLTextureEntry* te = facep->getTextureEntry();
    9.41  	if(te && te->getID().notNull())
    9.42  	{
    9.43 -		LLViewerTexture* tex = gTextureList.findImage(te->getID(), TEX_LIST_STANDARD);
    9.44 +		LLViewerTexture* tex = gTextureList.findImage(te->getID(), TEX_LIST_DISCARD);
    9.45  		if(tex)
    9.46  		{
    9.47  			for(std::list< LLPointer<LLViewerTexture> >::iterator iter = mTextureList.begin();
    9.48 @@ -3635,10 +3635,10 @@
    9.49  			const LLTextureEntry* te = facep->getTextureEntry();
    9.50  			if(te)
    9.51  			{
    9.52 -				LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : NULL;
    9.53 +				LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_DISCARD) : NULL;
    9.54  				if(!tex && te->getID() != mID)//try parcel media.
    9.55  				{
    9.56 -					tex = gTextureList.findImage(mID, TEX_LIST_STANDARD);
    9.57 +					tex = gTextureList.findImage(mID, TEX_LIST_DISCARD);
    9.58  				}
    9.59  				if(!tex)
    9.60  				{
    10.1 --- a/indra/newview/llviewertexturelist.cpp	Fri Mar 04 18:22:08 2016 +0200
    10.2 +++ b/indra/newview/llviewertexturelist.cpp	Mon Mar 07 18:45:12 2016 +0200
    10.3 @@ -72,18 +72,20 @@
    10.4  
    10.5  ETexListType get_element_type(S32 priority)
    10.6  {
    10.7 -    if (priority == LLViewerFetchedTexture::BOOST_ICON)
    10.8 +    // don't discard flag can be used in some cases, but it usually is not set yet
    10.9 +    if (priority == LLViewerFetchedTexture::BOOST_ICON
   10.10 +        || priority == LLViewerFetchedTexture::BOOST_UI)
   10.11      {
   10.12 -        return TEX_LIST_SCALE;
   10.13 +        return TEX_LIST_UI;
   10.14      }
   10.15 -    return TEX_LIST_STANDARD;
   10.16 +    return TEX_LIST_DISCARD;
   10.17  }
   10.18  
   10.19  ///////////////////////////////////////////////////////////////////////////////
   10.20  
   10.21  LLTextureKey::LLTextureKey()
   10.22  : textureId(LLUUID::null),
   10.23 -textureType(TEX_LIST_STANDARD)
   10.24 +textureType(TEX_LIST_DISCARD)
   10.25  {
   10.26  }
   10.27  
   10.28 @@ -589,7 +591,7 @@
   10.29  
   10.30  void LLViewerTextureList::findTexturesByID(const LLUUID &image_id, std::vector<LLViewerFetchedTexture*> &output)
   10.31  {
   10.32 -    LLTextureKey search_key(image_id, TEX_LIST_STANDARD);
   10.33 +    LLTextureKey search_key(image_id, TEX_LIST_DISCARD);
   10.34      uuid_map_t::iterator iter = mUUIDMap.lower_bound(search_key);
   10.35      while (iter != mUUIDMap.end() && iter->first.textureId == image_id)
   10.36      {
   10.37 @@ -1595,14 +1597,14 @@
   10.38  	LLUUID image_id;
   10.39  	msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, image_id);
   10.40  	
   10.41 -	LLViewerFetchedTexture* image = gTextureList.findImage( image_id, TEX_LIST_STANDARD);
   10.42 +	LLViewerFetchedTexture* image = gTextureList.findImage( image_id, TEX_LIST_DISCARD);
   10.43  	if( image )
   10.44  	{
   10.45  		LL_WARNS() << "Image not in db" << LL_ENDL;
   10.46  		image->setIsMissingAsset();
   10.47  	}
   10.48  
   10.49 -    image = gTextureList.findImage(image_id, TEX_LIST_SCALE);
   10.50 +    image = gTextureList.findImage(image_id, TEX_LIST_UI);
   10.51      if (image)
   10.52      {
   10.53          LL_WARNS() << "Icon not in db" << LL_ENDL;
    11.1 --- a/indra/newview/llviewertexturelist.h	Fri Mar 04 18:22:08 2016 +0200
    11.2 +++ b/indra/newview/llviewertexturelist.h	Mon Mar 07 18:45:12 2016 +0200
    11.3 @@ -61,8 +61,8 @@
    11.4  
    11.5  enum ETexListType
    11.6  {
    11.7 -    TEX_LIST_STANDARD = 0,
    11.8 -    TEX_LIST_SCALE // images that will be scaled, they should not be mixed up with regular images
    11.9 +    TEX_LIST_DISCARD = 0,
   11.10 +    TEX_LIST_UI
   11.11  };
   11.12  
   11.13  struct LLTextureKey
    12.1 --- a/indra/newview/llvoavatar.cpp	Fri Mar 04 18:22:08 2016 +0200
    12.2 +++ b/indra/newview/llvoavatar.cpp	Mon Mar 07 18:45:12 2016 +0200
    12.3 @@ -1992,7 +1992,7 @@
    12.4  		uuid == IMG_INVISIBLE)
    12.5  	{
    12.6  		// Should already exist, don't need to find it on sim or baked-texture host.
    12.7 -		result = gTextureList.findImage(uuid, TEX_LIST_STANDARD);
    12.8 +		result = gTextureList.findImage(uuid, TEX_LIST_DISCARD);
    12.9  	}
   12.10  	if (!result)
   12.11  	{
   12.12 @@ -4313,7 +4313,7 @@
   12.13  {
   12.14  	for (std::set<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
   12.15  	{
   12.16 -		LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_STANDARD);
   12.17 +		LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_DISCARD);
   12.18  		if (imagep && imagep->getDiscardLevel()!=0)
   12.19  		{
   12.20  			return false;
   12.21 @@ -4385,7 +4385,7 @@
   12.22  	S32Bytes result(0);
   12.23  	for (std::set<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
   12.24  	{
   12.25 -		LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_STANDARD);
   12.26 +		LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_DISCARD);
   12.27  		if (imagep)
   12.28  		{
   12.29  			result += imagep->getTextureMemory();
   12.30 @@ -4473,7 +4473,7 @@
   12.31  	{
   12.32  		if (new_texture_ids.find(*it) == new_texture_ids.end())
   12.33  		{
   12.34 -			LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_STANDARD);
   12.35 +			LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_DISCARD);
   12.36  			if (imagep)
   12.37  			{
   12.38  				current_texture_mem += imagep->getTextureMemory();
    13.1 --- a/indra/newview/viewer_manifest.py	Fri Mar 04 18:22:08 2016 +0200
    13.2 +++ b/indra/newview/viewer_manifest.py	Mon Mar 07 18:45:12 2016 +0200
    13.3 @@ -28,6 +28,7 @@
    13.4  """
    13.5  import sys
    13.6  import os.path
    13.7 +import shutil
    13.8  import errno
    13.9  import re
   13.10  import tarfile
   13.11 @@ -855,14 +856,17 @@
   13.12                  # This code constructs a relative path from the
   13.13                  # target framework folder back to the location of the symlink.
   13.14                  # It needs to be relative so that the symlink still works when
   13.15 -                # (as is normal) the user moves the app bunlde out of the DMG
   13.16 +                # (as is normal) the user moves the app bundle out of the DMG
   13.17                  # and into the /Applications folder. Note we also call 'raise'
   13.18                  # to terminate the process if we get an error since without
   13.19                  # this symlink, Second Life web media can't possibly work.
   13.20                  # Real Framework folder:
   13.21                  #   Second Life.app/Contents/Frameworks/Chromium Embedded Framework.framework/
   13.22 -                # Location of symlink and why it'ds relavie 
   13.23 +                # Location of symlink and why it'ds relative 
   13.24                  #   Second Life.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework/
   13.25 +                # Real Frameworks folder, with the symlink inside the bundled SLPlugin.app (and why it's relative)
   13.26 +                #   <top level>.app/Contents/Frameworks/Chromium Embedded Framework.framework/
   13.27 +                #   <top level>.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework ->
   13.28                  frameworkpath = os.path.join(os.pardir, os.pardir, os.pardir, os.pardir, "Frameworks", "Chromium Embedded Framework.framework")
   13.29                  try:
   13.30                      symlinkf(frameworkpath, pluginframeworkpath)
   13.31 @@ -872,10 +876,6 @@
   13.32  
   13.33              self.end_prefix("Contents")
   13.34  
   13.35 -        # fix up media_plugin.dylib so it knows where to look for CEF files it needs
   13.36 -        self.run_command('install_name_tool -change "@executable_path/Chromium Embedded Framework" "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" "%(config)s/Second Life.app/Contents/Resources/llplugin/media_plugin_cef.dylib"' %
   13.37 -                        { 'config' : self.args['configuration'] })
   13.38 -
   13.39          # NOTE: the -S argument to strip causes it to keep enough info for
   13.40          # annotated backtraces (i.e. function names in the crash log).  'strip' with no
   13.41          # arguments yields a slightly smaller binary but makes crash logs mostly useless.
   13.42 @@ -1247,12 +1247,33 @@
   13.43          # file, but that strategy doesn't work so well if we don't have
   13.44          # permissions to remove it. Check to see if it's already the
   13.45          # symlink we want, which is the usual reason for EEXIST.
   13.46 -        if not (os.path.islink(dst) and os.readlink(dst) == src):
   13.47 -            # Here either dst isn't a symlink or it's the wrong symlink.
   13.48 -            # Remove and recreate. Caller will just have to deal with any
   13.49 -            # exceptions at this stage.
   13.50 +        elif os.path.islink(dst):
   13.51 +            if os.readlink(dst) == src:
   13.52 +                # the requested link already exists
   13.53 +                pass
   13.54 +            else:
   13.55 +                # dst is the wrong symlink; attempt to remove and recreate it
   13.56 +                os.remove(dst)
   13.57 +                os.symlink(src, dst)
   13.58 +        elif os.path.isdir(dst):
   13.59 +            print "Requested symlink (%s) exists but is a directory; replacing" % dst
   13.60 +            shutil.rmtree(dst)
   13.61 +            os.symlink(src, dst)
   13.62 +        elif os.path.exists(dst):
   13.63 +            print "Requested symlink (%s) exists but is a file; replacing" % dst
   13.64              os.remove(dst)
   13.65              os.symlink(src, dst)
   13.66 +        else:
   13.67 +            # see if the problem is that the parent directory does not exist
   13.68 +            # and try to explain what is missing
   13.69 +            (parent, tail) = os.path.split(dst)
   13.70 +            while not os.path.exists(parent):
   13.71 +                (parent, tail) = os.path.split(parent)
   13.72 +            if tail:
   13.73 +                raise Exception("Requested symlink (%s) cannot be created because %s does not exist"
   13.74 +                                % os.path.join(parent, tail))
   13.75 +            else:
   13.76 +                raise
   13.77  
   13.78  if __name__ == "__main__":
   13.79      main()

mercurial