#!/bin/sh blacklist=( libchamplain libgda ) if [ $# -eq 0 ]; then modules=( $(jhbuild list -a) ) else modules=( "$@" ) fi OLD_IFS="$IFS" IFS=" " posts=( $(curl http://mail.gnome.org/archives/ftp-release-list/$(date +%Y-%B).txt.gz | zcat | grep "Subject: " | sed 's/^Subject: //') ) IFS=$OLD_IFS declare -A releases for post in "${posts[@]}" do key="$(echo $post | awk '{ print $1 }')" version="$(echo $post | awk '{ print $2 }')" releases["$key"]="$version" done for module in "${modules[@]}" do version="${releases[$module]}" [ -z "$version" ] && continue MAJOR_MINOR_VERSION=$(echo $version | sed -n 's/\([^.]*[.][^.]*\).*/\1/p') [ -n $MAJOR_MINOR_VERSION ] || continue; MAJOR_VERSION=$(echo $version | sed -n 's/\([^.]*\)[.].*/\1/p') [ -n $MAJOR_VERSION ] || continue; for variant in ${module}$MAJOR_VERSION ${module}3 ${module}30 ${module%%[^a-zA-Z]}$MAJOR_VERSION ${module} lib${module} lib${module}$MAJOR_VERSION ${module}24 do koji latest-pkg f16 $variant | grep -q $variant || continue if [ ! -d $variant ]; then fedpkg clone $variant >& /dev/null [ -d $variant ] || continue fi cd $variant || continue next=0 for package in "${blacklist[@]}" do if [ $package = $variant ]; then next=1 fi done if [ $next = 1 ]; then cd - break; fi fedpkg switch-branch f16 >& /dev/null next=0 for target in f16-gnome f16-updates-testing f16-updates-candidate f16-build do latest=$(koji latest-pkg $target $variant | grep $variant | awk '{print $1}') rpmdev-vercmp $latest $variant-$version-1.fc16 if [ $? -lt 12 ]; then next=1 break; fi done if [ $next = 1 ]; then cd - break; fi tarball=$module-$version.tar.xz url=http://ftp.gnome.org/pub/GNOME/sources/$module/$MAJOR_MINOR_VERSION/$tarball if [ ! -f $tarball ]; then wget $url fi if ! grep -q "Version: *$version" *.spec; then if ! grep -q $tarball sources; then mv sources old-sources grep -v $module old-sources > sources fedpkg upload $tarball fi sed -i -e 's@Version:\([ \t]*\).*@Version:\1'"$version"'@' *.spec sed -i -e 's@Release:\([ \t]*\)[^%]*\(.*\)@Release:\10\2@' *.spec sed -i -e 's@\(Source.*:.*%{name}-%{version}.tar\).*@\1.xz@' *.spec sed -i -e 's@\(Source.*:.*'"$name-%{version}"'.tar\).*@\1.xz@' *.spec sed -i -e 's@\(Source.*:.*'"$module"'-%{version}.tar\).*@\1.xz@' *.spec sed -i -e 's@\(Source.*:.*'"$module-$version"'.tar\).*@\1.xz@' *.spec rpmdev-bumpspec -c "Update to $version" *.spec git commit -a -m "Update to $version" # sudo yum builddep -y $variant # if ! fedpkg local; then # bash -i # cd - # break # fi fi fedpkg push sh -c "fedpkg build --target f16-gnome && koji tag-pkg f16-updates-candidate $(fedpkg verrel)" & cd - break done done