diff --git a/installer.sh b/installer.sh index 565c814..83e33f4 100755 --- a/installer.sh +++ b/installer.sh @@ -26,6 +26,13 @@ do [ -f $existing_file ] && mv $existing_file /root/.pkg/ done +# fix version and date in man page - get version from recently installed +VER=$(while read ver; do [ "${ver:0:6}" = 'APPVER' ] && ver=${ver#*=} && ver=${ver/\"/} && ver=${ver/\"/} && echo $ver && break;done < /usr/sbin/pkg) +DATE="$(date '+%B %Y')" +sed -e "s/VERSION_PLACEHOLDER/$VER/g" \ + -e "s/DATE_PLACEHOLDER/$DATE/" \ + < usr/share/man/man1/pkg.1 > /usr/share/man/man1/pkg.1 + [ -s ~/.packages/${pkgname}.files ] && echo -e "Package contents listed in ~/.packages/${pkgname}.files \n" echo -e "Setting up Pkg... \n" diff --git a/usr/share/man/man1/pkg.1 b/usr/share/man/man1/pkg.1 index ad5c119..aeb8e48 100644 --- a/usr/share/man/man1/pkg.1 +++ b/usr/share/man/man1/pkg.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH PKG "1" "December 2017" "Pkg 1.9.19alpha" "User Commands" +.TH PKG "1" "DATE_PLACEHOLDER" "Pkg VERSION_PLACEHOLDER" "User Commands" .SH NAME Pkg .SH VERSION -1.9.17alpha +VERSION_PLACEHOLDER .SH SYNOPSIS .B pkg [OPTION(S)] PKGNAME|FILENAME|SEARCH