[oe-commits] : tinylogin: have all applets use update-alternatives so they can be replaced by other packages (e.g. proper login, busybox, etc)

OE GIT Trial gittrial at amethyst.openembedded.net
Thu Oct 9 13:01:18 UTC 2008


Module: org.openembedded.dev.git
Branch: org.openembedded.dev
Commit: 43c6479e40cc6bf6adcbb10ebbbc18cf6872717b
URL:    http://gitweb.openembedded.net/?p=org.openembedded.dev.git&a=commit;h=43c6479e40cc6bf6adcbb10ebbbc18cf6872717b

Author:  <koen at openembedded.org>
Date:   Thu Oct  9 12:58:50 2008 +0000

tinylogin: have all applets use update-alternatives so they can be replaced by other packages (e.g. proper login, busybox, etc)

---

 packages/tinylogin/tinylogin_1.4.bb |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/packages/tinylogin/tinylogin_1.4.bb b/packages/tinylogin/tinylogin_1.4.bb
index ad254bf..43a7f10 100644
--- a/packages/tinylogin/tinylogin_1.4.bb
+++ b/packages/tinylogin/tinylogin_1.4.bb
@@ -3,11 +3,11 @@ DESCRIPTION = "TinyLogin is a suite of tiny UNIX \
 utilities for handling logins, user authentication, \
 changing passwords, and otherwise maintaining users \
 and groups on an embedded system."
-HOMEPAGE = "http://tinylogin.busybox.net/"
+HOMEPAGE = "http://tinylogin.tinylogin.net/"
 LICENSE = "GPL"
-PR = "r4"
+PR = "r5"
 
-SRC_URI = "http://tinylogin.busybox.net/downloads/tinylogin-${PV}.tar.bz2 \
+SRC_URI = "http://tinylogin.tinylogin.net/downloads/tinylogin-${PV}.tar.bz2 \
 	file://cvs-20040608.patch;patch=1;pnum=1 \
 	file://add-system.patch;patch=1;pnum=1 \
 	file://adduser-empty_pwd.patch;patch=1 \
@@ -22,8 +22,17 @@ do_compile () {
 do_install () {
 	install -d ${D}${base_bindir}
 	install -m 4755 tinylogin ${D}${base_bindir}/tinylogin
-	for i in `cat tinylogin.links`; do
-		mkdir -p ${D}/`dirname $i`
-		ln -sf /bin/tinylogin ${D}$i
-	done
+	install -d ${D}${sysconfdir}
+	install -m 0644 tinylogin.links ${D}${sysconfdir}
 }
+
+pkg_postinst_${PN} () {
+    # If we are not making an image we create links for the utilities that doesn't exist
+    # so the update-alternatives script will get the utilities it needs
+    # (update-alternatives have no problem replacing links later anyway)
+    if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/tinylogin";; /bin/*) to="tinylogin";; /*/*) to="../bin/tinylogin";; esac; ln -s $to $link; fi; done </etc/tinylogin.links; fi
+
+    # This adds the links, remember that this has to work when building an image too, hence the $D
+    while read link; do case "$link" in /*/*/*) to="../../bin/tinylogin";; /bin/*) to="tinylogin";; /*/*) to="../bin/tinylogin";; esac; bn=`basename $link`; update-alternatives --install $link $bn $to 40; done <$D/etc/tinylogin.links
+}
+





More information about the Openembedded-commits mailing list