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 7CDC3138252 for ; Tue, 10 May 2016 15:09:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5C89B21C08C; Tue, 10 May 2016 15:08:31 +0000 (UTC) Received: from smarthost01a.mail.zen.net.uk (smarthost01a.mail.zen.net.uk [212.23.1.1]) by pigeon.gentoo.org (Postfix) with ESMTP id E2C4B21C07F for ; Tue, 10 May 2016 15:08:29 +0000 (UTC) Received: from [81.108.251.46] (helo=mail.digimed.co.uk) by smarthost01a.mail.zen.net.uk with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1b09Gu-00011f-Mw for gentoo-user@lists.gentoo.org; Tue, 10 May 2016 15:08:28 +0000 Received: from hactar.digimed.co.uk (hactar.digimed.co.uk [192.168.1.3]) by mail.digimed.co.uk (Postfix) with ESMTPSA id 576A2430CF7 for ; Tue, 10 May 2016 16:08:28 +0100 (BST) Date: Tue, 10 May 2016 16:08:24 +0100 From: Neil Bothwick To: gentoo-user@lists.gentoo.org Subject: Re: [SOLVED] [gentoo-user] Automatically copy a file to a different location after package install/update Message-ID: <20160510160824.2530f00b@hactar.digimed.co.uk> In-Reply-To: <2071597.StHRLLJoUf@andromeda> References: <6307920.vm2KqvTLcz@andromeda> <15401227.EOBxzO5h95@andromeda> <20160510151308.38311166@digimed.co.uk> <2071597.StHRLLJoUf@andromeda> Organization: Digital Media Production X-Mailer: Claws Mail 3.13.2-137-gc4ebc9 (GTK+ 2.24.30; x86_64-pc-linux-gnu) X-GPG-Fingerprint: 7260 0F33 97EC 2F1E 7667 FE37 BA6E 1A97 4375 1903 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/13nC6lF9wKFxwjCg/mHMypj"; protocol="application/pgp-signature" X-Originating-smarthost01a-IP: [81.108.251.46] X-Archives-Salt: f99f0778-721a-4029-ab73-00159032914e X-Archives-Hash: 45b15411c64c688b9fedea2c91f8da62 --Sig_/13nC6lF9wKFxwjCg/mHMypj Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 10 May 2016 16:30:49 +0200, J. Roeleveld wrote: > > pkg_postinst() { > > cp /etc/openldap/schema/pureftpd.schema > > /opt/packages/SHARED/etc/openldap/schema/pureftpd.schema > > einfo "NOTE: LDAP Schema File copied." > > } > >=20 > > in /etc/portage/env/net-ftp/pure-ftpd =20 >=20 > When I did that, it complained about the syntax. > Apparently, from what I read through > google-searches, /etc/portage/env/... is handled by Python. And that > doesn't, obviously, understand bash-syntax. I definitely have bash in there. =20 > /etc/portage/bashrc is handled by Bash, which makes this possible. >=20 > The "pkg_postinst()" is for either ebuilds, or I am doing something > wrong... You can define functions as for ebuilds to have them executed in here. For example, for one package that I wanted to apply a patch from /etc/portage/patches, but didn't call epatch_user from its ebuild, I put this in /etc/portage/env/cat/pkg post_src_unpack() { cd "${S}" epatch_user } > I am using the latest stable portage. I'm using testing here, but have used this for years, so it worked with versions older than the current stable. --=20 Neil Bothwick Things are more like they are now than they ever were before. --Sig_/13nC6lF9wKFxwjCg/mHMypj Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlcx+WgACgkQum4al0N1GQM2UQCgloe1W2NhUQVlGUe0ARNqRoER dFYAoK/KGUiGespoRKU/vv/aF3THrfHu =8veD -----END PGP SIGNATURE----- --Sig_/13nC6lF9wKFxwjCg/mHMypj--