D25604: Properly add data root to XDG_DATA_DIRS and only when necessary

Wilfried van Asten noreply at phabricator.kde.org
Fri Nov 29 00:07:18 GMT 2019


sniperrifle created this revision.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
sniperrifle requested review of this revision.

REVISION SUMMARY
  This patch ensures the XDG_DATA_DIRS will be properly altered and only when necessary. This implies:
  
  - If the data root is already in XDG_DATA_DIRS either in the value or in the spec's default value, the value will remain unchanged.
  - If the data root is not in the value yet, it will be prepended, thus given preference over other prefixes containing KDE resources. This is what I believe was the intention of the original code.
  
  Furthermore this restores the proper preference order of the default value.
  
  BUG: 315452

TEST PLAN
  I tested three scenarios by setting XDG_DATA_DIRS in startplasma-dev.sh:
  
  - Unset and not present. Should result in <dev-data-root>:/usr/local/share:/usr/share
  - Set and present. Should leave value unchanged
  - Set and not present. I tested this by setting it to the default value manually with a bogus diretory in between. Leaving out the default might have led to other problems. Should result in <dev-data-root>:/bogus:/usr/local/share:/usr/share
  
  I did not test the fourth scenario unset and present, since it would have involved installing the dev kde in /usr/local or /usr and I did not want to do that.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D25604

AFFECTED FILES
  startkde/startplasma.cpp

To: sniperrifle
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191129/4ee7024c/attachment-0001.html>


More information about the Plasma-devel mailing list