Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

initial commit, won't work at this time. but you're invited to leave …

…your comments!
  • Loading branch information...
commit 901e57a08d1371b5a79541328d8ed6557a435dbc 1 parent 7ae0cb0
Norman Meßtorff authored
3  TODO
... ... @@ -0,0 +1,3 @@
  1 + - change schema to package/repo insted of repo/package
  2 + - catch mock error messages
  3 + - usage of mock --enable-scm ?
0  package/testing/SOURCES/package-1.0.tar.gz
No changes.
0  package/testing/SPECS/package.spec
No changes.
12 schema.txt
... ... @@ -0,0 +1,12 @@
  1 +package/
  2 +├── stable
  3 +│ ├── SOURCES
  4 +│ │   └── package-1.0.tar.gz
  5 +│ └── SPECS
  6 +│ └── package.spec
  7 +└── testing
  8 + ├── SOURCES
  9 + │   └── package-1.0.tar.gz
  10 + └── SPECS
  11 + └── package.spec
  12 +
108 svnmock.sh
... ... @@ -0,0 +1,108 @@
  1 +#!/bin/bash
  2 +#set -x
  3 +# Startup check
  4 +REPO="$1"
  5 +REV=$2
  6 +RESULTDIR="/data/result"
  7 +
  8 +if [ -z "${REPO}" ]; then
  9 + REPO=/Users/normes/svn/mocktest.svn/
  10 + REV=22
  11 +fi
  12 +REPO="${REPO}/"
  13 +TMPDIR=${REPO}tmp
  14 +
  15 +shopt -s nullglob
  16 +
  17 +#
  18 +# local basic functions
  19 +#
  20 +function log {
  21 + logger -t "$0" "$@"
  22 + echo "$@"
  23 +}
  24 +
  25 +function die {
  26 + logger -s -t "$0" "ERROR: $@"
  27 + echo "$@"
  28 + exit 1
  29 +}
  30 +
  31 +
  32 +#
  33 +# prepare envireonment
  34 +#
  35 +log starting "$REPO" "$REV"
  36 +
  37 +mkdir -p ${TMPDIR} ${RESULTDIR}
  38 +cd ${TMPDIR} || "Could not cd into ${TMPDIR}"
  39 +# prevent us to NOT delete the whole hdd :)
  40 +if [ ${#TMPDIR} -gt 5 ]; then
  41 + rm -rf ${TMPDIR}/*
  42 +else
  43 + die "problems with TMPDIR (${TMPDIR})!"
  44 +fi
  45 +
  46 +
  47 +#
  48 +# check changed repos
  49 +#
  50 +REPOS=()
  51 +for repository in `svnlook dirs-changed --revision ${REV} "${REPO}"`; do
  52 + currentrepo=${repository%%/*}
  53 +
  54 + # check duplicate values
  55 + duplicated=false
  56 + for dup in ${REPOS[@]}; do
  57 + if [ "${dup}" == "${currentrepo}" ]; then
  58 + duplicated=true
  59 + break;
  60 + else
  61 + continue;
  62 + fi
  63 + done
  64 +
  65 + # add value to array
  66 + if [ $duplicated == false ]; then
  67 + log " * repo changed: '${currentrepo}'"
  68 + REPOS=("${REPOS[@]}" "${currentrepo}")
  69 + fi
  70 +done
  71 +
  72 +
  73 +#
  74 +# working thru changed packages in all repos
  75 +#
  76 +for repository in ${REPOS[@]}; do
  77 + #
  78 + # changed packages
  79 + #
  80 + PACKAGES=()
  81 + for package in `svnlook dirs-changed --revision ${REV} "${REPO}"`; do
  82 + currentpkg=${package##$repository/}
  83 + currentpkg=${currentpkg%%/*}
  84 +
  85 + log " * package changed: '${repository}/${currentpkg}'"
  86 + PACKAGES=("${PACKAGES[@]}" "${currentpkg}")
  87 + done
  88 +
  89 + #
  90 + # svn export into TMPDIR
  91 + #
  92 + echo ${PACKAGES}
  93 + for package in ${PACKAGES[@]}; do
  94 + svn export -r $REV file:///"$REPO""${repository}/""${package}"/ --force
  95 + mkdir -p "${package}"/{RPMS,SRPMS}
  96 + log " . building SRPM '${repository}/${package}'"
  97 + mock --resultdir="${package}"/SRPMS/ --buildsrpm --spec "${package}"/SPECS/"${package}".spec --source "${package}"/SOURCES/
  98 + RET=$?
  99 + log " . [DONE=${RET}] building SRPM '${repository}/${package}'"
  100 + log " . building binary RPM '${repository}/${package}'"
  101 + mock --resultdir="${package}"/RPMS/ --rebuild "${package}"/SRPMS/*.src.rpm
  102 + RET=$?
  103 + log " . [DONE=${RET}] building binary RPM '${repository}/${package}'"
  104 + mv "${package}"/{RPMS,SRPMS} ${RESULTDIR}
  105 + done
  106 +done
  107 +
  108 +exit $?

0 comments on commit 901e57a

Please sign in to comment.
Something went wrong with that request. Please try again.