fuzzel + check what's installed among all managed machines

This commit is contained in:
Gwenhael Le Moine 2024-11-26 16:17:45 +01:00
parent 020e5e1f01
commit 892f470f32
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
3 changed files with 128 additions and 3 deletions

80
wayland/fuzzel/SlackBuild Executable file
View file

@ -0,0 +1,80 @@
#!/bin/bash
# variables
VERSION=${VERSION:-latest}
BUILD=2
TAG=gwh
OUTPUT=/tmp
TMP=/tmp/$TAG
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
ARCH=$(uname -m)
REPOSITORY=/var/cache/SlackBuilds.gwh/$PRGNAM
PREFIX=/usr
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM
mkdir -p $PKG
# mise en place
[ ! -e $REPOSITORY ] && git clone https://codeberg.org/dnkl/fuzzel.git $REPOSITORY
cd $REPOSITORY
git pull --all
cp -R $REPOSITORY $TMP/
cd $TMP/$PRGNAM/
[ "x$VERSION" == "xlatest" ] && VERSION=$(git tag --sort=-version:refname | head -n1)
[ "x$VERSION" == "x" ] && VERSION=trunk
[ "x$VERSION" == "xtrunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION
meson setup \
--prefix /usr \
--mandir /usr/man/ \
build/
ninja -C build/
cd build/
meson install --destdir=$PKG
cd ../
mkdir -p $PKG$PREFIX/doc/
mv $PKG$PREFIX/share/doc/$PRGNAM/ $PKG$PREFIX/doc/
rm -fr $PKG$PREFIX/share/doc
# correction
cd $PKG
chown -R root:root *
[ -d $PKG$PREFIX/man ] && find $PKG$PREFIX/man -name "*.?" -type f -exec gzip -9 {} \;
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below kanshis it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# kanshi exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (App launcher and fuzzy finder for Wayland)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://codeberg.org/dnkl/fuzzel
EOF
# empaquetage
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz

45
what-s_installed-everywhere.sh Executable file
View file

@ -0,0 +1,45 @@
#!/bin/bash
cd $(dirname $0) || exit 1
PKGs_local=$(ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
SHORT_HOSTNAME=$(hostname -s)
if [ "$SHORT_HOSTNAME" == "tibou" ]; then
PKGs_tibou=$PKGs_local
else
PKGs_tibou=$(ssh tibou ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
fi
if [ "$SHORT_HOSTNAME" == "titplume" ]; then
PKGs_titplume=$PKGs_local
else
PKGs_titplume=$(ssh titplume ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
fi
if [ "$SHORT_HOSTNAME" == "tibonom" ]; then
PKGs_tibonom=$PKGs_local
else
PKGs_tibonom=$(ssh tibonom ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
fi
if [ "$SHORT_HOSTNAME" == "gwenhael" ]; then
PKGs_gwenhael=$PKGs_local
else
PKGs_gwenhael=$(ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
fi
echo "| tibou | titplume | tibonom | gwenhael |"
echo "|----------+----------+----------+----------+-------"
PKG_OK="| x "
PKG_KO="| "
for cat in a ap d l lua n wayland xap y; do
cd $cat
for p in $(ls -1); do
echo -n $PKGs_tibou | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO"
echo -n $PKGs_titplume | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO"
echo -n $PKGs_tibonom | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO"
echo -n $PKGs_gwenhael | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO"
echo "| $cat/$p"
done | sort
cd ..
done

View file

@ -2,7 +2,7 @@
cd $(dirname $0) || exit 1 cd $(dirname $0) || exit 1
PKGs=$(ls /var/adm/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|') PKGs=$(ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
for cat in a ap d l lua n wayland xap y; do for cat in a ap d l lua n wayland xap y; do
cd $cat cd $cat