Commit 4926fbab authored by Seblu's avatar Seblu
Browse files

Add support for zst

parent 1c6181e2
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -8,3 +8,5 @@ TODO
test
tags
*.pkg.tar.xz
*.pkg.tar.zst
*.pkg.tar.*.sig
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ makepkg:
    expire_in: 1 week
    paths:
      - "*.pkg.tar.xz"
      - "*.pkg.tar.zst"

commitpkg:
  stage: deploy
+2 −1
Original line number Diff line number Diff line
@@ -18,7 +18,8 @@

[[ ! -f PKGBUILD ]] && echo 'No PKGBUILD' && exit 1

source /etc/makepkg.conf
source /usr/share/devtools/makepkg-x86_64.conf
[[ -r "$HOME/.makepkg.conf" ]]  && source "$HOME/.makepkg.conf"
source PKGBUILD

repo=${0##*/}
+5 −8
Original line number Diff line number Diff line
@@ -16,13 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

db='seblu.db.tar.gz'
repo='/home/archlinux/repo/seblu'
arch=('x86_64')

# source makepkg config
. /etc/makepkg.conf

cleanup() {
	[[ -e $dir_file ]] && rm -f "$dir_file"
	[[ -e $db_file ]] && rm -f "$db_file"
@@ -31,6 +24,10 @@ cleanup() {
# remove temp file on exit
trap cleanup 0

db='seblu.db.tar.gz'
repo='/home/archlinux/repo/seblu'
arch=('x86_64')

# create temporary files for computes diff
dir_file=$(mktemp ${0##*/}.XXXXX)
db_file=$(mktemp ${0##*/}.XXXXX)
@@ -39,7 +36,7 @@ db_file=$(mktemp ${0##*/}.XXXXX)
for arch in "${arch[@]}"; do
	[[ -t 1 ]] && echo ":: Cleaning $repo/$arch"
	# list files in directory
	find "$repo/$arch" -type f -name "*${PKGEXT}" -printf '%f\n'|sort > "$dir_file"
	find "$repo/$arch" -type f -regex '.*\.pkg\.tar\.\(xz\|zst\)' -printf '%f\n'|sort > "$dir_file"
	# list files in database
	bsdtar -xOf "$repo/$arch/$db" | awk '/^%FILENAME%/{getline;print}'|sort > "$db_file"
	# compute file not in db
+1 −7
Original line number Diff line number Diff line
@@ -23,9 +23,6 @@ repo_64="$repo/x86_64"
# packages to add
declare -a to_32 to_64

[[ -r /etc/makepkg.conf ]] && source /etc/makepkg.conf
[[ -r "$HOME/.makepkg.conf" ]]  && source "$HOME/.makepkg.conf"

shopt -s nullglob

if [[ -t 0 && -t 2 ]]; then
@@ -111,10 +108,7 @@ shift $((OPTIND - 1));
(( $# >= 1 )) || usage

for _pkg; do
	case "$_pkg" in
		*-x86_64$PKGEXT) to_64+=("$_pkg");;
		*-any$PKGEXT) to_64+=("$_pkg");;
	esac
	[[ "$_pkg" =~ .*\.pkg\.tar\.(xz|zst) ]] && to_64+=("$_pkg")
done

if (( ${#to_32[@]} + ${#to_64[@]} == 0 )); then
Loading