diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-02 00:23:36 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-05 20:01:06 -0600 |
commit | 24073402dd3d4324f117f12abc3c921cc3dc3750 (patch) | |
tree | 7a3f1ed1e354ebdc015b97aba7751c6a0f6dec99 /src/mips64el-tools | |
parent | 7c741c5c1b0253d87a925927cb74ff3d329aa16a (diff) |
fix up mipsrelease/fullpkg-build/HOOKLOCALRELEASE
HOOKLOCALRELEASE:
- set to librestage by default, because the mips value is mipsrelease,
which calls librestage
- document what arguments it is given.
fullpkg-build:
- Run HOOKLOCALRELEASE in a way that is consistent with treepkg does and
what mipsrelease takes. Note that what fullpkg-build did is what
mipsrelease documentation said, but not what it actually did.
- Don't run librestage; if we want it to run, run it with HOOKLOCALRELEASE
mipsrelease: Telling diff to ignore whitespace helps with this one.
- use get_full_version from common.sh/libremessages
- give a code path to display usage()
- correct usage()
- fix a little quoting
- make sure makepkg.conf variables are set
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 "$@" |