app-portage/elicense: update live ebuild
authorThomas Deutschmann <whissi@gentoo.org>
Tue, 21 May 2019 14:48:20 +0000 (16:48 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Tue, 21 May 2019 14:50:22 +0000 (16:50 +0200)
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
app-portage/elicense/elicense-9999.ebuild

index a7cb3da3c328ed564b00f298c306f0d8d65a28ac..bbba9eea7ef6a9d353130190194d4613f67acb8c 100644 (file)
@@ -21,3 +21,16 @@ SLOT="0"
 IUSE=""
 
 RDEPEND=">=sys-apps/portage-2.3.62[${PYTHON_USEDEP}]"
+
+src_prepare() {
+       default
+
+       local MY_PV=${PV}
+       if [[ ${PV} == "9999" ]]; then
+               local last_commit=$(git rev-parse HEAD)
+               MY_PV="${last_commit:0:7}-git"
+       fi
+
+       sed -i -e "s/^MY_PV =.*$/MY_PV = \"${MY_PV}\"/" \
+               elicense || die "Failed to sed in version."
+}