[Suggestion] man-pages modules for all base modules

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Suggestion] man-pages modules for all base modules

Post#1 by Rava » 06 Feb 2021, 06:00

How do I download man pages for offline use?
Sadly, my suggestion years ago to have man pages not deleted when creating modules, but moved to a different folder instead, like so:

Code: Select all

#lets presume the following:
#$MODULE represents the module name without extension, e.g. 001-core
#$MODFOLDER represents the folder in which the files and folders are installed in
#  or copied in for later dir2xzm e.g. /mnt/sda2/Porteus_modules/5.0rc3/
#so that in this example $MODFOLDER${MODULE}/ would be 
#/mnt/sda2/Porteus_modules/5.0rc3/001-core/
#and $MODFOLDER${MODULE}-man-pages/ would be
#/mnt/sda2/Porteus_modules/5.0rc3/001-core-man-pages/
#$boldred and $off are escape sequences for echo: bold+red marking and for
#  switching off any marking

## instead of deleting the man pages copy them for an extra manpages module
## and delete them afterwards
cp -a --parents $MODFOLDER${MODULE}/usr/man/* $MODFOLDER${MODULE}-man-pages/
if [ $? - eq 0 ]; then
	rm -r $MODFOLDER${MODULE}/usr/man
else
	echo -e ${boldred}"WARNING! Something went wrong when copying the manpages files and folders.
See above for any error message.
No write access in target folder / target folder read-only?
No free disk space in target folder?"$off
fi

cp -a --parents $MODFOLDER${MODULE}/usr/local/man/* $MODFOLDER${MODULE}-man-pages/
if [ $? - eq 0 ]; then
	rm -r $MODFOLDER${MODULE}/usr/local/man/man?/*
else
	echo -e ${boldred}"WARNING! Something went wrong when copying the manpages files and folders.
See above for any error message.
No write access in target folder / target folder read-only?
No free disk space in target folder?"$off
fi
and then make an extra manpages module like so

Code: Select all

dir2xzm $MODFOLDER${MODULE}-man-pages/ $MODFOLDER${MODULE}-man-pages.xzm
is sadly not implemented yet. :cry:
Since the above is scripted it would take only the small amount of extra time to create the manpages module, the copying is automatic and should not be that much slower than deleting the files and folders (unless the target directory has very slow write rates) and would only be done once prior the creation of the main module and the manpages module.
.
Especially for situations where the set up Porteus machines do have no permanent internet access or no internet access at all, having man pages locally could be vital. In most - especially richer - countries having permanent internet access is usually no issue, but… we create our Linux system especially for the use of older machines, and some people who use such machines are in countries or maybe only areas of countries with non-permanent internet access.
Or only temporary having not the funds for permanent internet access, e.g. because of the changes due to Corona-Chan measures that disrupt commerce globally.

Now, instead, how do I download a man page?
man wget gets me the page via lynx, which is fine when I have internet, and I do get nothing which is bad when I have no internet:

Code: Select all

                         Linux Manpages Online - man.cx manual pages (p1 of 163)
   [INS: :INS]

                                    Manpages

   Manpage: ____________________ go

NAME

   Wget - The non-interactive network downloader.

SYNOPSIS

   wget [option]... [ URL ]...

(NORMAL LINK) Use right-arrow or <return> to activate.
  Arrow keys: Up and Down to move.  Right to follow a link; Left to go back.
 H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list 
I think everybody agrees that making 163 screenshots of the example man page of wget alone is a less than desirable solution, much less an optimal one.
Trying to ask lynx how to download a file also fails:
After I pressed "h" :

Code: Select all

Alert!: Unable to access document.
  Arrow keys: Up and Down to move.  Right to follow a link; Left to go back.
Image
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[Suggestion] man-pages modules for all base modules

Post#2 by Ed_P » 06 Feb 2021, 06:15

Rava what is the URL you used for your Linux Manpages Online manual?

Do these modules work for you? https://mirrors.edge.kernel.org/pub/lin ... man-pages/
From http://manpages.courier-mta.org/
Ed

burdi01
Shogun
Shogun
Posts: 201
Joined: 18 Aug 2013, 12:09
Distribution: Slackware PartedMagic Xubuntu
Location: The Netherlands

[Suggestion] man-pages modules for all base modules

Post#3 by burdi01 » 06 Feb 2021, 10:40

Might Slackware Current's man-db package be what you are looking for?
:D

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Suggestion] man-pages modules for all base modules

Post#4 by Rava » 06 Feb 2021, 14:15

@both
I could find my way around finding offline man pages, but I aside from the code snippet above I acted like a less tech savvy user who needs offline man pages and used the tools at hand:
executing man [name] gets you to lynx, and pressing "h" in lynx to get help of how to download the current web page gets you the lynx help text not found error.

A normal user would be at his wits end on how to solve the problem since he tried the tools as given my Porteus:

He tried man (he could be a Linux or *IX* user but new to Porteus) and was directed to lynx and then he would get the help in lynx unavailable info.
That would mean end of the line for most users.


Therefore the thread is named [Suggestion] and has already a script [ code ] snippet that would take care of creating man-pages module for every base module created.
Ed_P wrote:
06 Feb 2021, 06:15
Rava what is the URL you used for your Linux Manpages Online manual?
I use man wget as I wrote here:
Rava wrote:
06 Feb 2021, 06:00
man wget gets me the page via lynx, which is fine when I have internet, and I do get nothing which is bad when I have no internet
_________________________________________________
burdi01 wrote:
06 Feb 2021, 10:40
Might Slackware Current's man-db package be what you are looking for?
:D
I am only interested in the man pages of the programs already installed, usually every program comes with a man page, but during module creation that gets purged, therefore my code snippet that would let any maintainer create not only his/her 00X-whatever-module.xzm but also a 00X-whatever-module-man-pages.xzm and the probably few folks who need offline man pages can choose to download these modules.

Or even others might see it as a good idea to at least have them downloaded, when not activated by default. What if for whatever reason you get a network error and the man page of one or the other network tool would have the info you needed? But since you are offline you could never read the info since all man pages are purged.

Or all created like my code snippet above base man-pages modules can be put into one single man page module, that is also okay - but when updating only one of the base modules, and it removed a program and has a different as alternative, the all-in-one man-pages module would not be accurate.
Last edited by Rava on 06 Feb 2021, 14:18, edited 1 time in total.
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

[Suggestion] man-pages modules for all base modules

Post#5 by ncmprhnsbl » 06 Feb 2021, 23:45

future releases of porteus will have a "man.xzm", that includes the missing man pages(and the tools necessary to access them), available for download .. maybe via "bundles"..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Suggestion] man-pages modules for all base modules

Post#6 by Rava » 07 Feb 2021, 15:49

^
Yay!
Image Image Image

I now close this thread. :celebrate3:
Last edited by Rava on 07 Feb 2021, 15:52, edited 1 time in total.
Reason: topic locked since suggestion will come to fruition in future releases.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[Suggestion] man-pages modules for all base modules

Post#7 by Ed_P » 07 Feb 2021, 16:48

:good:

A good suggestion Rava. Normally when I need help with a question or problem about a command I use Google. For offline scenarios your suggestion is perfect. Might even be a quicker solution to problems without using Google. :happy62:
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Suggestion] man-pages modules for all base modules

Post#8 by Rava » 07 Feb 2021, 16:52

Ed_P wrote:
07 Feb 2021, 16:48
A good suggestion Rava. Normally when I need help with a question or problem about a command I use Google. For offline scenarios your suggestion is perfect. Might even be a quicker solution to problems without using Google. :happy62:
It depends, duckduckgo gives you solutions as well… but your learning experience curve stays flat.
While when you have to figure it out for yourself (and you need manpages for that) you have to understand stuff you previously did not know much about, and so your learning curve goes up.
Cheers!
Yours Rava

Locked