summaryrefslogtreecommitdiff
path: root/src/mips64el-tools/mipsrelease
diff options
context:
space:
mode:
Diffstat (limited to 'src/mips64el-tools/mipsrelease')
-rwxr-xr-xsrc/mips64el-tools/mipsrelease61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/mips64el-tools/mipsrelease b/src/mips64el-tools/mipsrelease
new file mode 100755
index 0000000..de17651
--- /dev/null
+++ b/src/mips64el-tools/mipsrelease
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+# Lic: GPLv3+
+# Author: Nicolas Reynolds <fauno@kiwwwi.com.ar>
+# Local release of mips64el packages + clean ABS sync
+# Called by HOOKLOCALRELEASE
+
+# $1 repo
+# $2+ packages
+
+. libremessages
+. $(librelib conf.sh)
+load_files makepkg
+check_vars makepkg CARCH PKGDEST PKGEXT || exit 1
+load_files libretools
+check_vars libretools WORKDIR || exit 1
+
+usage() {
+ echo "$0 repo"
+ echo
+ echo " release packages locally on \${PKGDEST}/stage3."
+ echo " and make a clean ABS sync "
+}
+
+main() {
+ if [[ $# != 1 ]]; then
+ usage
+ exit 1
+ fi
+
+ repo=$1
+
+ if [ -z "${repo}" ]; then
+ error "Empty repo"
+ exit 1
+ fi
+
+ # Get all needed sources
+ load_PKGBUILD
+ pkgs=()
+ makepkg --source -f --skippgpcheck -c
+
+ msg "Adding packages to [stage3]..."
+ for name in "${pkgname[@]}"; do
+ msg2 "${name} $(get_full_version $name)"
+ pkgs+=(${PKGDEST}/${name}-$(get_full_version $name)-*.pkg.tar.*)
+ done
+
+ repo-add ${PKGDEST}/stage3.db.tar.gz "${pkgs[@]}"
+
+ librestage ${repo}
+
+ mkdir -p ${WORKDIR}/abs/${CARCH}/${repo} >/dev/null
+
+ pushd ${WORKDIR}/abs/${CARCH}/${repo} >/dev/null
+ tar xvf $SRCPKGDEST/${pkgbase:-${pkgname[0]}}-$(get_full_version)${SRCEXT}
+ popd >/dev/null
+
+ exit $?
+}
+
+main "$@"