summaryrefslogtreecommitdiff
path: root/Tizen:Common
diff options
context:
space:
mode:
authorEd Bartosh <eduard.bartosh@intel.com>2014-10-28 14:56:03 +0200
committerEd Bartosh <eduard.bartosh@intel.com>2014-10-28 15:31:57 +0200
commit7c45b5b141238b6559c694cc21c6436a6aa72031 (patch)
tree5401db8f65901c4dd1fee53435e83ad40fccf856 /Tizen:Common
parent3c758dda325d7aab7c0af3e8e9914b8dce387a54 (diff)
downloadobs-7c45b5b141238b6559c694cc21c6436a6aa72031.tar.gz
obs-7c45b5b141238b6559c694cc21c6436a6aa72031.tar.bz2
obs-7c45b5b141238b6559c694cc21c6436a6aa72031.zip
Move update_meta script to the top
This script is not specific to Common, so let's put it to the root of source tree. Change-Id: I8a4725db7bbd9f6942d663f2b98e9ee61a37822b Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Diffstat (limited to 'Tizen:Common')
-rwxr-xr-xTizen:Common/update_meta.sh84
1 files changed, 0 insertions, 84 deletions
diff --git a/Tizen:Common/update_meta.sh b/Tizen:Common/update_meta.sh
deleted file mode 100755
index 61cf44a..0000000
--- a/Tizen:Common/update_meta.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/bash
-
-API=https://api.tizen.org
-PRJ=${1:-Tizen:Common}
-
-PARALLEL_JOBS=8
-
-set -e
-
-function parallel_jobs {
- local max_number=$((0 + ${1:-0}))
- while true; do
- jobs &>/dev/null
- if [[ $(jobs -p | wc -l) -lt $max_number ]]; then
- break
- fi
- sleep 0.3
- done
-}
-
-cd $(dirname $0)
-
-# fetch project config
-echo "Fetching project config for $PRJ"
-osc -A $API meta prjconf $PRJ >_config
-
-# fetch project meta
-echo "Fetching project meta for $PRJ"
-osc -A $API meta prj $PRJ >_meta
-
-# check that each subdir exists on OBS project
-shopt -s extglob
-for file in $(ls */@(_aggregate|_link)); do
- pkg=$(dirname $file)
- echo "Checking $pkg"
- if ! osc -A $API ls $PRJ $pkg &>/dev/null; then
- echo "Package $pkg was removed on OBS. Removing dir $pkg."
- git rm -rf $pkg
- fi
-done
-
-function check_package() {
- pkg=$1
- pkgtype="X"
-
- # fetch file list for each package and deduce type
- for filename in $(osc -A $API ls -u $PRJ $pkg); do
- case $filename in
- _aggregate) pkgtype="A"; break;;
- _link) pkgtype="L"; break;;
- _service) pkgtype="S"; break;;
- *) pkgtype="U"; break;;
- esac
- done
- msg="$pkgtype $pkg"
-
- # uddate aggregate and link packages
- case $pkgtype in
- A)
- mkdir -p $pkg
- osc -A $API api /source/$PRJ/$pkg/_aggregate >$pkg/_aggregate
- osc -A $API api /source/$PRJ/$pkg/_meta >$pkg/_meta
- msg="$msg (updated)"
- ;;
- L)
- mkdir -p $pkg
- osc -A $API api /source/$PRJ/$pkg/_link >$pkg/_link
- msg="$msg (updated)"
- ;;
- *)
- ;;
- esac
-
- echo $msg
-}
-
-# fetch packages list
-osc -A $API ls $PRJ | while read pkg; do
- parallel_jobs $PARALLEL_JOBS
- check_package $pkg &
-done
-
-parallel_jobs 1
-