From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 72757138A1F for ; Thu, 30 Jan 2014 03:37:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 61B91E0C4C; Thu, 30 Jan 2014 03:37:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 67D77E0C28 for ; Thu, 30 Jan 2014 03:37:31 +0000 (UTC) Received: from [192.168.1.204] (76-230-137-203.lightspeed.livnmi.sbcglobal.net [76.230.137.203]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 2706C33F84B; Thu, 30 Jan 2014 03:37:30 +0000 (UTC) Message-ID: <52E9C8F6.6080106@gentoo.org> Date: Wed, 29 Jan 2014 22:37:26 -0500 From: Mike Gilbert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: Gentoo Dev CC: freedesktop-bugs@gentoo.org Subject: [gentoo-dev] New eclass: xdg-basedir X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mjasEaCFQGPv3QcGHWQRALCpH8T6Edou5" X-Archives-Salt: 10963841-baa1-4a6e-b404-2649d64518e0 X-Archives-Hash: 3014c27e20bbaf300caf9d498a04fbf4 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mjasEaCFQGPv3QcGHWQRALCpH8T6Edou5 Content-Type: multipart/mixed; boundary="------------020804000608040901030408" This is a multi-part message in MIME format. --------------020804000608040901030408 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Here's a simple eclass that pretty much just extracts the XDG stuff from the gnome2_environment_reset function. One difference: it creates 3 of the 4 directories under ${HOME} instead of ${T}, just to mimic the default behavior in the XDG basedir spec a bit more closely. Please give a look. --------------020804000608040901030408 Content-Type: text/plain; charset=UTF-8; name="xdg-basedir.eclass" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xdg-basedir.eclass" # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # @ECLASS: xdg-basedir # @MAINTAINER: # freedesktop-bugs@gentoo.org # @BLURB: Set up directories according to the XDG Base Directory Specific= ation. # @EXAMPLE: # @CODE # inherit xdg-basedir # # src_prepare() { # xdg-basedir-setup # } # @CODE # Unset these globally to avoid leaking values from the calling environme= nt. unset XDG_DATA_HOME XDG_CONFIG_HOME XDG_CACHE_HOME XDG_RUNTIME_DIR # @FUNCTION: xdg-basedir-setup # @DESCRIPTION: # Creates sensible locations for the following environment variables: # XDG_DATA_HOME # XDG_CONFIG_HOME # XDG_CACHE_HOME # XDG_RUNTIME_DIR xdg-basedir-setup() { export XDG_DATA_HOME=3D"${HOME}/.local/share" export XDG_CONFIG_HOME=3D"${HOME}/.config" export XDG_CACHE_HOME=3D"${HOME}/.cache" export XDG_RUNTIME_DIR=3D"${T}/run" mkdir -p "${XDG_DATA_HOME}" "${XDG_CONFIG_HOME}" "${XDG_CACHE_HOME}" || = die mkdir -p -m 0700 "${XDG_RUNTIME_DIR}" || die } --------------020804000608040901030408-- --mjasEaCFQGPv3QcGHWQRALCpH8T6Edou5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlLpyPYACgkQC77qH+pIQ6RfbgD/QDT61O1W7a4XQHEY4Nb9QBPs s0IaBFO3wtVtBb6a1rsBAIGOqM5d/f9//3tC/zpPYnrPvetGPMMOa98Tuv8gjh9d =Qh0C -----END PGP SIGNATURE----- --mjasEaCFQGPv3QcGHWQRALCpH8T6Edou5--