diff options
Diffstat (limited to 'src/mips64el-tools')
-rwxr-xr-x | src/mips64el-tools/mipsrelease | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/src/mips64el-tools/mipsrelease b/src/mips64el-tools/mipsrelease index 393ca08..30ebb46 100755 --- a/src/mips64el-tools/mipsrelease +++ b/src/mips64el-tools/mipsrelease @@ -10,57 +10,53 @@ . 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 package1 [ package2 ... packageN ]" - echo - echo " release packages locally on ${PKGDEST}/stage3." - echo " and make a clean ABS sync " + echo "$0 repo" + echo + echo " release packages locally on \${PKGDEST}/stage3." + echo " and make a clean ABS sync " } -## -# usage : get_full_version( $epoch, $pkgver, $pkgrel ) -# return : full version spec, including epoch (if necessary), pkgver, pkgrel -## -get_full_version() { - if [[ $1 -eq 0 ]]; then - # zero epoch case, don't include it in version - echo $2-$3 - else - echo $1:$2-$3 - fi -} +main() { + if [[ $# != 1 ]]; then + usage + exit 1 + fi -repo=$1; shift + repo=$1 -if [ -z "${repo}" ]; then - error "Empty repo" - exit 1 -fi + if [ -z "${repo}" ]; then + error "Empty repo" + exit 1 + fi -# Get all needed sources -source PKGBUILD -fullver=$(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}) -pkgs=() -makepkg --source -f --skippgpcheck + # Get all needed sources + source PKGBUILD + fullver=$(get_full_version) + pkgs=() + makepkg --source -f --skippgpcheck -msg "Adding packages to [stage3]..." -for name in ${pkgname[@]}; do - msg2 "${name} ${fullver}" - pkgs+=("${PKGDEST}/${name}-${fullver}-*.pkg.tar.*") -done + msg "Adding packages to [stage3]..." + for name in "${pkgname[@]}"; do + msg2 "${name} ${fullver}" + pkgs+=(${PKGDEST}/${name}-${fullver}-*.pkg.tar.*) + done -repo-add ${PKGDEST}/stage3.db.tar.gz ${pkgs[@]} + repo-add ${PKGDEST}/stage3.db.tar.gz "${pkgs[@]}" -librestage ${repo} + librestage ${repo} + mkdir -p ${WORKDIR}/abs/${CARCH}/${repo} >/dev/null -mkdir -p ${WORKDIR}/abs/${CARCH}/${repo} >/dev/null + pushd ${WORKDIR}/abs/${CARCH}/${repo} >/dev/null + tar xvf $SRCPKGDEST/${pkgbase:-${pkgname[0]}}-${fullver}${SRCEXT} + popd >/dev/null -pushd ${WORKDIR}/abs/${CARCH}/${repo} >/dev/null - tar xvf $SRCPKGDEST/${pkgbase:-${pkgname[0]}}-${fullver}${SRCEXT} -popd >/dev/null + exit $? +} -exit $? +main "$@" |