#!/bin/sh # lsb_release wrapper for LliureX # (C) 2007 Luis Garcia Gisbert # This package is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 dated June, 1991. # This package is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this package; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. UBUNTU_APPS_DIR="/etc/lsb-release-ubuntu.d" LLIUREX_APPS_DIR="/etc/lsb-release-lliurex.d" LSB_RELEASE_UBUNTU="/etc/lsb-release.ubuntu" LSB_RELEASE_LLIUREX="/etc/lsb-release.lliurex" DEFAULT_CONF="/etc/default/lliurex-lsb-release-wrapper" [ ! -r "$DEFAULT_CONF" ] || . $DEFAULT_CONF unset CDD_LSB_RELEASE if [ -r "$LSB_RELEASE_UBUNTU" -a -r "$LSB_RELEASE_LLIUREX" ] ; then REPARENTID="$(ps -p $PPID -o ppid=)" for p in $PPID $REPARENTID ; do PNAME="$(ps -p $p -o comm=)" if [ "$PNAME" ] ; then if rgrep -q "^${PNAME}$" ${UBUNTU_APPS_DIR} ; then export CDD_LSB_RELEASE="$LSB_RELEASE_UBUNTU" elif rgrep -q "^${PNAME}$" ${LLIUREX_APPS_DIR} ; then export CDD_LSB_RELEASE="$LSB_RELEASE_LLIUREX" fi [ "$DEBUG_FILE" -a -w "$DEBUG_FILE" ] && echo "${PNAME} -> (${CDD_LSB_RELEASE})" >> "$DEBUG_FILE" fi done else [ "$DEBUG_FILE" -a -w "$DEBUG_FILE" ] && echo "$LSB_RELEASE_UBUNTU not found. Using real lsb_release tool" >> "$DEBUG_FILE" fi exec ${0}.real "$@"