Update 2024-01-21 21:52 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id 2024-01-21 21:52:56 +01:00
parent c60e153c40
commit f58efc8e88
7 changed files with 238 additions and 0 deletions

63
.bin/list-myfiles Executable file
View File

@ -0,0 +1,63 @@
#!/bin/sh
(
#find \
# $HOME/.config/* \
# $HOME/.* \
# -maxdepth 1 \
# \( -name "*.cfg" \
# -o -name "*.conf" \
# -o -name "*.lua" \
# -o -name "*.sh" \
# -o -name "*.pl" \
# -o -name "*.c" \
# -o -name "*.h" \
# -o -name "*.ksh" \
# -o -name "*.local" \
# -o -name "*.txt" \
# -o -name "*.html" \
# -o -name "*.md" \
# -o -name "*.th" \
# -o -name "*.ps" \
# -o -name "*.pm" \
# -o -name "Makefile" \
# -o -name "*.toml" \
# -o -name "*.xsession*" \
# -o -name "*rc" \
# -o -name ".Xresources" \
# -o -name ".Xdefaults" \
# -o -name ".ini" \
# -o -name "config" \
# \) -type f
find "$PWD" \
-maxdepth 3 \
-not \( -path "*CVS*" \
-o -path "*.git*" \
-o -path "*.fonts*" \
-o -path "*cache*" \
-o -path "$HOME/.cfg*" \
-o -iname "*.tags" \
-o -iname "*cscope*" \
-o -iname "*.db" \
-o -iname "*.mkv" \
-o -iname "*.mp4" \
-o -iname "*.avi" \
-o -iname "*.flv" \
-o -iname "*.mov" \
-o -iname "*.torrent" \
-o -iname "*.dat" \
-o -iname "*.img" \
-o -iname "*.iso" \
-o -iname "*.ldb" \
-o -iname "*.mp3" \
-o -iname "*.ogg" \
-o -iname "*.png" \
-o -iname "*.jpg" \
-o -iname "*.flac" \
\) -type f
) | sed 's,/home/dpb/usr/ports/,/usr/ports/,' \
| sed "s,$PWD/,," \
| sort -ur

21
.bin/listincludes.pl Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env perl
use strict;
use warnings;
use File::Find;
use Data::Dumper;
find( { wanted => \&findfiles, },'.' );
sub findfiles {
if(-f "$File::Find::name") {
if("$File::Find::name" =~ /.*.\[c\|cc\|cpp\|h\|hh\|hpp\]/) {
print "$File::Find::name\n";
}
}
}
exit;

91
.bin/port Executable file
View File

@ -0,0 +1,91 @@
#!/bin/sh
usage() {
printf "Argument missing\n"
exit 2
}
[ -z $1 ] && usage
# MAKE SURE MARKFILE EXISTS
MARKFILE="/var/cache/pmark"
if [ ! -f "${MARKFILE}" ]
then
doas touch "${MARKFILE}"
doas sdk:sdk "${MARKFILE}"
fi
portmark() {
printf "%s" "${PWD}" > ${MARKFILE}
printf "marked.\n"
}
portsrcdir() {
printf "%s" "$(cat "${MARKFILE}")"
}
portobjdir() {
cd "$(cat "${MARKFILE}")" \
&& printf "%s" "$(make show=WRKSRC)"
}
portclean() {(
cd /usr/ports
doas rm -rf /usr/ports/{pobj/*,plist,logs,packages,bulk,update}
doas make fix-permissions > /dev/null
echo done
)}
portdiff() {
_opwd="$PWD"
_name="$(make show=PKGNAME)"
_epoch="$(make show=EPOCH)"
_rev="$(make show=REVISION)"
_patchname="${_name}${_epoch:+v$_epoch}${_rev:+p$_rev}"
cd /usr/ports \
&& doas cvs -d sdk@cvs.openbsd.org:/cvs diff -uNp $(echo "$_opwd" \
| sed 's,/data/cvs/ports/,,g' \
| sed 's,/usr/ports/,,g') \
> /home/sdk/diffs/${_patchname}.diff
grep '^?' /home/sdk/diffs/${_patchname}.diff
cd "$_opwd"
printf "Patch created: /home/sdk/diffs/%s.diff\n" "$_patchname"
}
portpack() {
_dir="$(basename "$(readlink -f .)")"
cd ..
doas tar czvf "${_dir}.tgz" "${_dir}" \
&& readlink -f "${_dir}.tgz"
cd -
}
portjump() {
if [ -z $1 ]
then
echo /usr/ports
exit 0
fi
_dirs="archivers astro audio benchmarks biology books bulk \
cad chinese comms converters databases devel editors \
education emulators fonts games geo graphics inputmethods \
japanese java korean lang mail math meta misc multimedia \
net news plan9 print productivity security shells sysutils \
telephony textproc wayland www x11"
for d in $_dirs
do
if [ -d /usr/ports/$d/$1 ]
then
echo /usr/ports/$d/$1
fi
done
}
case $1 in
mark) portmark; ;;
src) portsrcdir; ;;
obj) portobjdir; ;;
clean) portclean; ;;
diff) portdiff; ;;
pack) portpack; ;;
jump) portjump $2; ;;
esac

11
.bin/port-deleter Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
while true;
do
PORT=$(pkg_info -mz | fzf -e --sync --bind start:last)
[ ! -z $PORT ] \
&& doas pkg_delete -c "$PORT"
[ -z $PORT ] \
&& exit 0
done
pkg_delete -ac

23
.bin/port-info Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
if [ -z "$1" ]
then
echo "usage: $(basename $0) <portsdir>"
exit 2
fi
if [ ! -d "/usr/ports/$1/pkg" ]
then
echo "not a ports dir"
exit 1
fi
cd /usr/ports/$1
make show="COMMENT FULLPKGNAME HOMEPAGE SITES MAINTAINER DESCR" \
| tr -s " " \
| awk 'NR == 1 { print "Comment: "$0 } \
NR == 2 { print "Distname: "$0 } \
NR == 3 { print "Homepage: "$0 } \
NR == 5 { print "Maintainer: "$0"\n" } \
NR == 6 { system("/bin/cat " $0); }'

17
.bin/port-list Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
find /usr/ports/ \
-maxdepth 6 \
-not \( \
-path "*CVS*" \
-o -path "*.git*" \
-o -path "/usr/ports/distfiles" \
-o -path "/usr/ports/infrastructure" \
-o -path "/usr/ports/lock" \
-o -path "/usr/ports/packages" \
-o -path "/usr/ports/plist" \
-o -path "/usr/ports/pobj" \
\) \
-path "*/pkg" \
-prune \
| sed 's,/usr/ports/\(.*\)/pkg$,\1,'

12
.bin/portsearch Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
ugrep \
--exclude-dir=CVS \
--exclude-dir=pobj \
--exclude-dir=plist \
--exclude-dir=logs \
--exclude-dir=distfiles \
--include=Makefile \
--include='patch-*' \
--recursive \
"$@" \
/usr/ports/