void-packages

Void Source Packages
git clone git://ezup.dev/void-packages.git
Log | Files | Refs | README | LICENSE

gen-repoinfo.sh (2471B)


      1#!/bin/sh
      2
      3: "${progname:="${0##*/}"}"
      4
      5get_info_html() {
      6	#PACKAGES=$(find $REPODIR -name "*.xbps" | xargs -I{} basename {} .xbps | rev | cut -d. -f2- | cut -d- -f2- | rev | sort -u)
      7	cat <<EOF
      8<!DOCTYPE html>
      9<html lang="en">
     10<head>
     11<meta charset="UTF-8">
     12<title>Information about Dash Eclipse's Void Linux Repository | ezup.dev </title>
     13</head>
     14<pre>
     15<b><a href="https://ezup.dev/">[ezup.dev]</a></b> / repo / voidlinux / <b><a href="https://ezup.dev/repo/voidlinux/current/">[current]</a></b> / info.html
     16
     17<b>Dash Eclipse's Void Linux Repository</b>
     18<b>------------------------------------</b>
     19
     20Dash Eclipse's Void Linux packages collection
     21
     22stagit: <a href="https://ezup.dev/git/void-packages/" target="_blank">https://ezup.dev/git/void-packages/</a>
     23git clone <a href="git://ezup.dev/void-packages.git">git://ezup.dev/void-packages.git</a>
     24
     25
     26<b>How to Use</b>
     27<b>----------</b>
     28
     291. Copy the main repository configuration file to /etc/xbps.d
     30
     31   # cp /usr/share/xbps.d/00-repository-main.conf /etc/xbps.d/
     32
     332. To get packages which only includes in this repository,
     34   add this repository after your main one
     35
     36   # x86_64-musl, aarch64-musl, armv7l-musl
     37   repository=<a href="https://ezup.dev/repo/voidlinux/current" target="_blank">https://ezup.dev/repo/voidlinux/current</a>
     38
     393. Synchronize repositories, install packages you need
     40
     41   # xbps-install -S [PKG...]
     42
     43WARNING: You can replace a package from your main repository with the one
     44which has the same name from this repository by insert this repository at the
     45beginning of your repository configuration, but you will risking some of other
     46packages also be replaced. I would recommend you to check related package
     47template, build it by yourself and optionally self-host your own repository.
     48
     49
     50<b>Packages</b>
     51<b>--------</b>
     52
     53EOF
     54
     55	ls -v1 $REPODIR/*.x86_64-musl.xbps $REPODIR/*.noarch.xbps \
     56		| xargs -I{} basename {} | sed 's/.\(x86_64-musl\|noarch\).xbps$//' \
     57		| rev | sed 's/-/ /; s/_/ - /' | rev \
     58		| tac | sort -uk1,1 \
     59		| column -t -R4 \
     60		| tree -N --fromfile \
     61		| sed -e "
     62			s|^0 directories, \([0-9]\+\) files$|\1 packages - <b>$(date -u +%FT%TZ)</b>|
     63			s,\x1B\[[0-9;]*[a-zA-Z],,g
     64			"
     65
     66	cat <<EOF
     67</pre>
     68</html>
     69EOF
     70}
     71
     72#get_info_html >$(dirname $(realpath $0))/info.html
     73
     74usage() {
     75	cat <<_EOF
     76Usage: $progname repo_dir
     77_EOF
     78}
     79
     80if [ ! -z $1 ]; then
     81	[ -f $1/x86_64-musl-repodata ] || { echo "$1 is not a valid repo" && exit 0; }
     82	REPODIR=$1
     83	get_info_html >$REPODIR/info.html
     84else
     85	usage
     86fi