Permalink
Browse files

Update src-sh/about script to auto-create the

/usr/local/share/pcbsd/version file during installation

This file will be used to pull the specific PC-BSD version string
  • Loading branch information...
1 parent 87a7010 commit 5053ee4c870deda4b682725339a933f8f9f67894 @kmoore134 kmoore134 committed Mar 11, 2014
Showing with 32 additions and 2 deletions.
  1. +3 −2 src-sh/about/Makefile
  2. +6 −0 src-sh/about/about
  3. +22 −0 src-sh/about/install.sh
  4. +1 −0 src-sh/port-files/pkg-plist
View
@@ -39,15 +39,16 @@ uninstall_scripts: FORCE
-$(DEL_FILE) -r $(INSTALL_ROOT)$(PREFIX)/bin/about
-$(DEL_DIR) $(INSTALL_ROOT)$(PREFIX)/bin/
+install_doinstall:
+ sh install.sh $(PREFIX)
install_dochmod: first FORCE
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(PREFIX)/bin/ || $(MKDIR) $(INSTALL_ROOT)$(PREFIX)/bin/
chmod 755 $(PREFIX)/bin/about
-install: install_scripts install_dochmod FORCE
+install: install_scripts install_dochmod install_doinstall FORCE
uninstall: uninstall_scripts FORCE
FORCE:
-
View
@@ -42,6 +42,7 @@ display_pkg_version()
if [ "$SYSTYPE" = "PCBSD" ]; then
display_pcbsd_banner
+ VERNAME="PC-BSD"
fi
if [ "$SYSTYPE" = "TRUEOS" ]; then
display_trueos_banner
@@ -53,6 +54,11 @@ echo " Host:..............`hostname`"
echo " User:..............`whoami`"
echo " Uptime:............`uptime | awk '{sub(/^.* up +/,"");sub(/, *[0-9]+ users.*/,"");print}'`"
echo " FreeBSD ver:.......`uname -r`"
+if [ "$SYSTYPE" = "PCBSD" ]; then
+ echo " PC-BSD ver:........`cat /usr/local/share/pcbsd/version`"
+else
+ echo " TrueOS ver:........`cat /usr/local/share/pcbsd/version`"
+fi
echo " Arch:..............`uname -m`"
echo " Kernel ident:......`uname -i`"
echo " CPU:...............`sysctl -n hw.model`"
View
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Script to set "about" version number
+
+VER=`cat ../../src-qt4/config.h | grep '#define PCBSDVERSION' | cut -d '"' -f 2`
+
+DEFAULT="/usr/local"
+
+if [ -z "$1" ] ; then
+ LB="${DEFAULT}"
+else
+ LB="${1}"
+fi
+
+DIR=`dirname $0`
+DIR=`realpath $DIR`
+cd ${DIR}
+
+if [ ! -d "${LB}/share/pcbsd" ] ; then
+ mkdir -p ${LB}/share/pcbsd/
+fi
+
+echo "$VER" > ${LB}/share/pcbsd/version
@@ -545,6 +545,7 @@ share/pcbsd/scripts/mkzfsdir.sh
share/pcbsd/scripts/reset-firewall
share/pcbsd/scripts/rmzfsdir.sh
share/pcbsd/scripts/sys-init.sh
+share/pcbsd/version
etc/warden.conf.dist
etc/pc-activedirectory.conf
etc/pc-ldap.conf

0 comments on commit 5053ee4

Please sign in to comment.