diff --git a/xbps/.config/fish/conf.d/nomad.fish b/xbps/.config/fish/conf.d/nomad.fish new file mode 100644 index 0000000..b8ab8f0 --- /dev/null +++ b/xbps/.config/fish/conf.d/nomad.fish @@ -0,0 +1,14 @@ +set -x NOMAD_NAMESPACE '*' +set -x NOMAD_ADDR "https://nomad.s.voidlinux.org" +set -x VAULT_ADDR "https://vault.s.voidlinux.org" + +function vault-login + vault login -method=ldap + # can take username=$username parameter + #expires in one day +end + +function nomad-token + set -x NOMAD_TOKEN (vault read -field secret_id nomad/creds/apps-admin) + #expires in one hour +end diff --git a/linux-utils/.local/bin/depgraph b/xbps/.local/bin/depgraph similarity index 100% rename from linux-utils/.local/bin/depgraph rename to xbps/.local/bin/depgraph diff --git a/xbps/.local/bin/xclean b/xbps/.local/bin/xclean new file mode 100755 index 0000000..4e17676 --- /dev/null +++ b/xbps/.local/bin/xclean @@ -0,0 +1,4 @@ +#!/bin/sh +MASTERDIR=${1:-masterdir} +rm -fr $MASTERDIR/ && +rm $MASTERDIR diff --git a/xbps/.local/bin/xcreate b/xbps/.local/bin/xcreate new file mode 100755 index 0000000..2f9d762 --- /dev/null +++ b/xbps/.local/bin/xcreate @@ -0,0 +1,6 @@ +#!/bin/sh +MASTERDIR=masterdir +[ "$1" ] && MASTERDIR=${1:+masterdir-$1} +mktmpdir $MASTERDIR +mkdir $MASTERDIR/tmp +./xbps-src -m $MASTERDIR binary-bootstrap $2 diff --git a/xbps/.local/bin/xdirs b/xbps/.local/bin/xdirs new file mode 100755 index 0000000..1a52d0b --- /dev/null +++ b/xbps/.local/bin/xdirs @@ -0,0 +1,3 @@ +#!/bin/sh +MASTERDIR=${1:-masterdir} +rm -rf $MASTERDIR/destdir $MASTERDIR/builddir diff --git a/xbps/.local/bin/xfindup b/xbps/.local/bin/xfindup new file mode 100755 index 0000000..164050b --- /dev/null +++ b/xbps/.local/bin/xfindup @@ -0,0 +1,12 @@ +#!/bin/sh +set +x + +PKGLIST="$(xbps-query -l | awk '{print $2}' | xargs -l1 xbps-uhelper getpkgname)" +curl -LO https://a-hel-fi.m.voidlinux.org/void-updates/void-updates.txt + +for pkg in $PKGLIST +do + rg "^$pkg " void-updates.txt +done + +rg -C 10 ericonr void-updates.txt diff --git a/xbps/.local/bin/xgitsub b/xbps/.local/bin/xgitsub new file mode 100755 index 0000000..d77006d --- /dev/null +++ b/xbps/.local/bin/xgitsub @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +# by Johnnynator +import git +import argparse + +def basename (arg): + pos = arg.rfind("/") + if pos > -1: + arg = arg[pos+1:] + pos = arg.rfind(".") + if pos > -1: + arg = arg[:pos] + return arg + +def getUrls (repo): + for submodule in repo.submodules: + if submodule.url.startswith("https://github.com"): + url = submodule.url + if url.endswith(".git"): + url=url[:-4] + print(url + "/archive/${" + basename(submodule.path).replace('-', '_') + "_commit}.tar.gz") + else: + print("Unknown URL, don't know how to rewrite") + exit(1) + +def getCommits (repo): + for submodule in repo.submodules: + print(basename(submodule.path).replace('-', '_') + "_commit=" + submodule.hexsha) + +def constructPostExtract (repo): + print("post_extract() {") + for sub in repo.submodules: + print("\trmdir -v ${wrksrc}/" + sub.path) + print("\tmv ${wrksrc}/../" + basename(sub.url) + "-${" + basename(sub.path).replace('-', '_') + "_commit} ${wrksrc}/" + sub.path) + print("}") + +parser = argparse.ArgumentParser(description='Print some git submodule infos') +parser.add_argument('path', nargs=1, help='path to a git repo') +parser.add_argument('-p', '--print-post-extract', dest='post_extract', action='store_const', const=True, default=False, help='print post_extract function for template') +parser.add_argument('--no-urls', dest='print_urls', action='store_const', const=False, default=True, help='print no distfile urls') +args = parser.parse_args() + +repo = git.Repo(args.path[0]) +if(args.post_extract): + constructPostExtract(repo) +else: + getCommits(repo) + if(args.print_urls): + getUrls(repo)