summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/mpra
blob: 74eb5525e985f45c7ab2b5c81115c46715dc3e08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# MakePkg Repo-Add

fn () {
	find . -maxdepth 1 -type f -name '*.pkg.tar.zst' -delete
	makepkg -f
	newpkg="$(find . -maxdepth 1 -type f -name '*.pkg.tar.zst')"
	mv "$newpkg" ..
	# need manually repo-add new database for first time initialization
	repo-add -R "$(find .. -maxdepth 1 -type f -name '*.db.tar.gz')" "../$newpkg"
}

upd -p

if [ $# -eq 0 ]; then
	fn 
else
	for dir; do
		cd -- "$(realpath -- "$dir")" || exit
		fn	
	done
fi

upd -p