summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2006-10-19 10:26:10 +0000
committerMatthias Schwarzott <zzam@gentoo.org>2006-10-19 10:26:10 +0000
commit8a870a7c109756828dd0dbf79a684211cc2b2711 (patch)
treed5f4875d8f18471ad59d94146146a09a45beda6f /eclass/vdr-plugin.eclass
parentNew snapshot (diff)
downloadgentoo-2-8a870a7c109756828dd0dbf79a684211cc2b2711.tar.gz
gentoo-2-8a870a7c109756828dd0dbf79a684211cc2b2711.tar.bz2
gentoo-2-8a870a7c109756828dd0dbf79a684211cc2b2711.zip
Added support for newer vdrplugin-rebuild database.
Diffstat (limited to 'eclass/vdr-plugin.eclass')
-rw-r--r--eclass/vdr-plugin.eclass52
1 files changed, 49 insertions, 3 deletions
diff --git a/eclass/vdr-plugin.eclass b/eclass/vdr-plugin.eclass
index 6836d0ab397b..e3d6ac1bfb09 100644
--- a/eclass/vdr-plugin.eclass
+++ b/eclass/vdr-plugin.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.36 2006/10/12 16:31:45 zzam Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.37 2006/10/19 10:26:10 zzam Exp $
#
# Author:
# Matthias Schwarzott <zzam@gentoo.org>
@@ -100,6 +100,45 @@ remove_vdrplugindb() {
fi
}
+# New method of storing plugindb
+# Called from src_install
+# file maintained by normal portage-methods
+create_plugindb_file() {
+ local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
+ local DB_FILE=${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}
+ insinto ${NEW_VDRPLUGINDB_DIR}
+ cat <<-EOT > ${D}/${DB_FILE}
+ VDRPLUGIN_DB=1
+ CREATOR=ECLASS
+ EBUILD=${CATEGORY}/${PN}
+ EBUILD_V=${PVR}
+ EOT
+}
+
+# Delete files created outside of vdr-plugin.eclass
+# vdrplugin-rebuild.ebuild converted plugindb and files are
+# not deleted by portage itself - should only be needed as
+# long as not every system has switched over to
+# vdrplugin-rebuild-0.2
+delete_orphan_plugindb_file() {
+ #einfo Testing for orphaned plugindb file
+ local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
+ local DB_FILE=${ROOT}/${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}
+
+ # file exists
+ [[ -f ${DB_FILE} ]] || return
+
+ # will portage handle the file itself
+ if grep -q CREATOR=ECLASS ${DB_FILE}; then
+ #einfo file owned by eclass - don't touch it
+ return
+ fi
+
+ einfo "Removing orphaned plugindb-file."
+ einfo "#rm ${DB_FILE}"
+ rm ${DB_FILE}
+}
+
vdr-plugin_pkg_setup() {
# -fPIC is needed for shared objects on some platforms (amd64 and others)
append-flags -fPIC
@@ -323,10 +362,14 @@ vdr-plugin_src_install() {
doins header-md5-${PN}
fi
fi
+
+ create_plugindb_file
}
vdr-plugin_pkg_postinst() {
- update_vdrplugindb
+ if has_version "<=media-tv/vdrplugin-rebuild-0.1"; then
+ update_vdrplugindb
+ fi
einfo
einfo "The vdr plugin ${VDRPLUGIN} has now been installed."
einfo "To activate execute the following command:"
@@ -341,7 +384,10 @@ vdr-plugin_pkg_postinst() {
}
vdr-plugin_pkg_postrm() {
- remove_vdrplugindb
+ if has_version "<=media-tv/vdrplugin-rebuild-0.1"; then
+ remove_vdrplugindb
+ fi
+ delete_orphan_plugindb_file
}
vdr-plugin_pkg_config_final() {