From 4925836a185fc7d2f016b7ef22bcc48efb3ca4de Mon Sep 17 00:00:00 2001 From: Robert Lowry Date: Mon, 10 Dec 2018 16:42:29 -0600 Subject: update README and script to be slightly more user friendly. --- README.md | 29 +++++++++++++++++++++++------ xbps-mini-builder | 16 +++++++++++----- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c321b32..ea86d33 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,27 @@ # xbps-mini-builder This is the XBPS mini builder, use it when you want to create a mirror -containing restricted packages that the Void project doesn't build for -you. Put this script in a directory on its own and put a -`packages.list` next to it that contians the packages you want to -build. You can also add an `xbps-src.conf` to be used during builds. +containing restricted packages that the Void project doesn't build for you. Put +this script in a directory on its own and put a `packages.list` next to it that +contains the packages you want to build. You can also add an `xbps-src.conf` to +be used during builds. -Run the script on a cron or with `snooze(1)` once a day to get -updates, all other tasks are handled for you! +Run the script on a cron or with `snooze(1)` once a day to get updates, all +other tasks are handled for you! + +## Notes + +- Create `packages.list` and `xbps-src.conf` before running `xbps-mini-builder` +- Run the script *only* as the user you plan to run it as normally, or the + repository will have broken permissions. +- To build restricted packages, you must add `XBPS_ALLOW_RESTRICTED=yes` to + `xbps-src.conf` + +## Troubleshooting + +If you do add packages to `packages.list` after the script has initialized the +repository, or forgot to enable the building of restricted packages, the script +will not build the package files until they are updated upstream. To manually +build a specific package, run `./xbps-mini-builder ` and it will build +the package, whether it has changed or not. Remember to only run this as the +user that will be running the script normally. diff --git a/xbps-mini-builder b/xbps-mini-builder index 2fdf4b8..72cd850 100755 --- a/xbps-mini-builder +++ b/xbps-mini-builder @@ -58,11 +58,17 @@ if [ -f ../xbps-src.conf ] ; then cat ../xbps-src.conf >> etc/conf fi -while read -r package ; do - if grep "${package}" ../changed; then - ./xbps-src pkg "${package}" - fi -done < ../packages.list +if [ -z "$@" ] ; then + while read -r package ; do + if grep "${package}" ../changed; then + ./xbps-src pkg "${package}" + fi + done < ../packages.list +else + for pkg in "$@"; do + ./xbps-src pkg "${pkg}" + done +fi # Sign built packages xbps-rindex --sign --signedby "XBPS-mini-builder" --privkey ../id_rsa hostdir/binpkgs -- cgit v1.2.3