Skip to content

Commit

Permalink
[eos-apps-info] updated info pages of some apps
Browse files Browse the repository at this point in the history
  • Loading branch information
EndeavourOS committed Aug 11, 2023
1 parent 5af412a commit 4bfe075
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 88 deletions.
6 changes: 3 additions & 3 deletions eos-apps-info/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pkgname=eos-apps-info
pkgdesc="Documentation about apps in the EndeavourOS repository."
pkgver=1.7
pkgrel=2
pkgrel=3
arch=('any')
license=('GPL')
depends=(
Expand Down Expand Up @@ -34,10 +34,10 @@ source=(

sha512sums=('8cefc007cd9ad7c1d53e096d14c52983ba56a8d53eb44b94d43101a227b8e301c8d1f500d67933ad0ffb958056712da20e1b9331ce6fefadca4a6d00c33694c3'
'dbc9308955967856fe317e3a8bf5dbd7f75f7040b21fb92f49f66d747efda5bd776eb3285102c0e9c4d81a5be2f436a42d2c770229c357f3c111144afe766047'
'5e3f7212d1b7ed272d7f58013b39e11f7f908af78f18c9bf33e2d42a4ecc4a67109bb73db9f5b5dc1bd18e17cd099658d4bd8d4a1c792b70cdb4f14f0a042167'
'215379c963cb5ba0c880656653025cef3e84e7cfd438d7c1003a69a5ab4f58e945e3e862ee91971bba8113892e70a930561e97656bb0456596b4638103e0f5a5'
'8a0692ff5e714a0690c7a90d04a928b2edf2e01515f8707b345d0da36ee95cab7f4f9badf3dca6cbd280438a08519957c5852be92e7936da9f0affef3d895b17'
'4b5eef3ce297cfa66d38b6ad92739eee905050228f72bd2c58d7f05700269b0ef434b0aa5c6ff8423a98af33918089f1255858bd2385ef3db2967d71e0d1d350'
'f077d50c2f20c5476e3a8beb2b5c4d1d7d0f7042ab6307136db55bfd7d934a0cb40c8ff0b58c84db19ac4ac562e683178768311446e305a142405f415bb82f2e')
'bd6993f18ac77e1bd410174e083b939c4ac5fa52a81e37025fc30ab76864b980e988ade5c6d561fc7977ca7fe0b095685f901792e4a11f1b1eaddace0833ce10')

package() {
local xx
Expand Down
38 changes: 29 additions & 9 deletions eos-apps-info/eos-apps-info-collect
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,30 @@ Man2html() {
echo "$app" >&2
}

GetDescription() {
local app="$1"
expac -Q %d $app || expac -Q %d $app || LANG=C yay -Si $app | grep Description | sed 's|^Description[ ]*: ||'
GetInfoItem() {
local -r app="$1" # pkgname
local -r word="$2" # field name from the output of command 'yay -Si $pkgname'

case "$word" in
Description) type=d ;;
Version) type=v ;;
esac
expac -Q %$type $app || LANG=C yay -Si $app | grep -w "^$word" | sed "s|^$word[ ]*: ||"
}

ShowVersion() {
local version="$1"
if [ -n "$version" ] ; then
printf "\nVersion: %s<br>\n" "$version"
else
printf "\n"
fi
}

Help2html() {
local app # e.g. rate-mirrors and others
local descr
local version
local help
local fmt='```'
local usage usage_def="$(printf "\n## Usage\n\n")"
Expand All @@ -105,7 +121,7 @@ Help2html() {
case "$app" in
rate-mirrors)
usage=""
help="$($app -h | grep -v "Usually default options should work")" # fix!
help="$($app -h 2>/dev/null)"
;;
*)
usage="$usage_def"
Expand All @@ -114,10 +130,11 @@ Help2html() {
esac
mkdir -p $tmpdir/$app
tmpfile=$tmpdir/$app/foobar123.md
descr=$(GetDescription $app)
descr=$(GetInfoItem "$app" Description)
version=$(GetInfoItem "$app" Version)
cat <<EOF > $tmpfile
# $app
$(ShowVersion "$version")
$descr
$usage
$fmt
Expand All @@ -144,9 +161,13 @@ Main()
mkdir -p $infos_folder || DIE "creating folder '$infos_folder' failed"
cd $infos_folder || DIE "changing folder to '$infos_folder' failed"

# help option to html
# app's help option to html
for app in eos-packagelist nvidia-inst rate-mirrors ; do
Help2html $app
if [ -x /usr/bin/$app ] ; then
Help2html $app
else
DIE "app $app is not available, please install it."
fi
done

# direct pages
Expand All @@ -156,7 +177,6 @@ Main()
done

# indirect via man folder
# note: added 'rate-mirrors' here!
pushd ../man
local apps=(*)
popd
Expand Down
Binary file modified eos-apps-info/eos-apps-info-pages.tar.gz
Binary file not shown.
76 changes: 0 additions & 76 deletions eos-apps-info/man/rate-mirrors/rate-mirrors.md

This file was deleted.

0 comments on commit 4bfe075

Please sign in to comment.