tweaked it a bit, updated man page to note that -U installs/updates man, new tarball.

This commit is contained in:
inxi-svn 2012-06-25 23:49:21 +00:00
parent e9c2c3882a
commit 0ec99ebc47
2 changed files with 9 additions and 7 deletions

13
inxi
View file

@ -415,6 +415,7 @@ LOG_FILE="$SCRIPT_DATA_DIR/inxi.log"
LOG_FILE_1="$SCRIPT_DATA_DIR/inxi.1.log" LOG_FILE_1="$SCRIPT_DATA_DIR/inxi.1.log"
LOG_FILE_2="$SCRIPT_DATA_DIR/inxi.2.log" LOG_FILE_2="$SCRIPT_DATA_DIR/inxi.2.log"
MAN_FILE_DOWNLOAD='http://inxi.googlecode.com/svn/trunk/inxi.8.gz' MAN_FILE_DOWNLOAD='http://inxi.googlecode.com/svn/trunk/inxi.8.gz'
MAN_FILE_LOCATION='/usr/share/man/man8'
SCRIPT_NAME="inxi" SCRIPT_NAME="inxi"
SCRIPT_PATCH_NUMBER='' SCRIPT_PATCH_NUMBER=''
SCRIPT_PATH="" #filled-in in Main SCRIPT_PATH="" #filled-in in Main
@ -1252,7 +1253,7 @@ script_self_updater()
{ {
eval $LOGFS eval $LOGFS
local wget_error=0 file_contents='' wget_man_error=0 local wget_error=0 file_contents='' wget_man_error=0
local man_location='/usr/share/man/man8'
print_screen_output "Starting $SCRIPT_NAME self updater." print_screen_output "Starting $SCRIPT_NAME self updater."
print_screen_output "Currently running $SCRIPT_NAME version number: $SCRIPT_VERSION_NUMBER" print_screen_output "Currently running $SCRIPT_NAME version number: $SCRIPT_VERSION_NUMBER"
print_screen_output "Current version patch number: $SCRIPT_PATCH_NUMBER" print_screen_output "Current version patch number: $SCRIPT_PATCH_NUMBER"
@ -1272,8 +1273,8 @@ script_self_updater()
print_screen_output "To run the new version, just start $SCRIPT_NAME again." print_screen_output "To run the new version, just start $SCRIPT_NAME again."
print_screen_output "----------------------------------------" print_screen_output "----------------------------------------"
print_screen_output "Starting download of man page file now." print_screen_output "Starting download of man page file now."
if [[ ! -d $man_location ]];then if [[ ! -d $MAN_FILE_LOCATION ]];then
print_screen_output "The required man directory was not detected on your system, unable to continue: $man_location" print_screen_output "The required man directory was not detected on your system, unable to continue: $MAN_FILE_LOCATION"
else else
if [[ $B_ROOT == 'true' ]];then if [[ $B_ROOT == 'true' ]];then
print_screen_output "Checking Man page download URL..." print_screen_output "Checking Man page download URL..."
@ -1281,10 +1282,10 @@ script_self_updater()
if [[ $wget_man_error -eq 0 ]];then if [[ $wget_man_error -eq 0 ]];then
print_screen_output "Man file download URL verified: $MAN_FILE_DOWNLOAD" print_screen_output "Man file download URL verified: $MAN_FILE_DOWNLOAD"
print_screen_output "Downloading Man page file now." print_screen_output "Downloading Man page file now."
wget -O $man_location $MAN_FILE_DOWNLOAD || wget_man_error=$? wget -O $MAN_FILE_LOCATION $MAN_FILE_DOWNLOAD || wget_man_error=$?
if [[ $wget_man_error -gt 0 ]];then if [[ $wget_man_error -gt 0 ]];then
print_screen_output "Oh no! Something went wrong downloading the Man gz file at: $MAN_FILE_DOWNLOAD" print_screen_output "Oh no! Something went wrong downloading the Man gz file at: $MAN_FILE_DOWNLOAD"
print_screen_output "Check the error messages for what happened." print_screen_output "Check the error messages for what happened. Error: $wget_man_error"
else else
print_screen_output " Download/install of man page successful. Check to make sure it works: man inxi" print_screen_output " Download/install of man page successful. Check to make sure it works: man inxi"
fi fi
@ -1292,7 +1293,7 @@ script_self_updater()
print_screen_output "Man file download URL failed, unable to continue: $MAN_FILE_DOWNLOAD" print_screen_output "Man file download URL failed, unable to continue: $MAN_FILE_DOWNLOAD"
fi fi
else else
print_screen_output "Updating / Installing the Man page requires root user, writing to: $man_location" print_screen_output "Updating / Installing the Man page requires root user, writing to: $MAN_FILE_LOCATION"
print_screen_output "If you want the man page, you'll have to run $SCRIPT_NAME -U as root." print_screen_output "If you want the man page, you'll have to run $SCRIPT_NAME -U as root."
fi fi
fi fi

3
inxi.8
View file

@ -230,7 +230,8 @@ Show partition UUIDs. Default: short partition \fB-P\fR. For full \fB-p\fR outpu
.TP .TP
.B -U .B -U
Auto-update script. Note: if you installed as root, you must be root to update, Auto-update script. Note: if you installed as root, you must be root to update,
otherwise user is fine. otherwise user is fine. Also installs /updates this Man Page to: \fB-/usr/share/man/man8\fR
This requires that you be root to write to that directory.
.TP .TP
.B -V .B -V
inxi version information. Prints information then exits. inxi version information. Prints information then exits.