Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
enlightment nightly build grab script
#!/bin/bash
set -e
PROJECTS=(
eina
eet
evas
ecore
embryo
edje
e_dbus
efreet
eeze
elementary
e
eio
)
GAMES=(
econcentration
)
MODULES=(
mail
notification
)
#PROJECTS=""
#GAMES=""
#MODULES=""
#FIXME evas_generic_loaders
SITE="svn.enlightenment.org"
SVN_generic="http://$SITE/svn/e/trunk"
SVN_game="http://$SITE/svn/e/trunk/GAMES"
SVN_module="http://$SITE/svn/e/trunk/E-MODULES-EXTRA"
OSC_PROJECT="X11:Enlightenment:Nightly"
OPT=()
submit_package()
{
echo "Updating $PROJ"
PROJ="$1"
OSC_PACKAGE="$PROJ"
PACKAGE_NAME="$PROJ"
case "$2" in
module) OSC_PACKAGE="e_module-$PROJ"; SVN="$SVN_module" ;;
game) SVN="$SVN_game" ;;
*) SVN="$SVN_generic" ;;
esac
if [ $PROJ = "e" ]; then
PACKAGE_NAME="enlightenment"
OSC_PACKAGE="e17"
fi
# FIXME: this is just wrong!
PACKAGE_REGEX=$PACKAGE_NAME-*tar.*z*
PACKAGE_REGEX_COPY=$PACKAGE_NAME-*.tar.bz2
echo " - updating OBS package"
if [ -d "$OSC_PROJECT/$OSC_PACKAGE" ]; then
osc up "$OSC_PROJECT/$OSC_PACKAGE"
else
osc checkout "$OSC_PROJECT" "$OSC_PACKAGE"
fi
OLD_REVISION="$(cd "$OSC_PROJECT/$OSC_PACKAGE" && ls $PACKAGE_REGEX_COPY | sed "s/^$PACKAGE_NAME-[0-9.]\+\.\([0-9.]\+\)\.tar\.bz2$/\1/")"
echo " - updating SVN repository"
svn co "$SVN/$PROJ"
cd "$PROJ"
echo "$OLD_REVISION"
if [ "$(svn log -r "${OLD_REVISION}":HEAD | wc -l)" -eq 1 ]; then
echo " - no changes for $PROJ"
cd -
continue
fi
rm -f $PACKAGE_REGEX
make clean distclean || true
./autogen.sh "${OPT[@]}"
make dist-bzip2
VERSION="$(ls $PACKAGE_REGEX_COPY | sed "s/^$PACKAGE_NAME-\([0-9.]\+\)\.tar\.bz2$/\1/")"
cd -
cd "$OSC_PROJECT/$OSC_PACKAGE"
rm -f $PACKAGE_REGEX
cp ../../"$PROJ"/$PACKAGE_REGEX_COPY ./ && \
osc addremove && \
sed -i "s/^Version:.*/Version: $VERSION/" "$OSC_PACKAGE.spec" && \
osc vc -m "bump version to $VERSION" && \
osc commit -m "bump version to $VERSION"
cd -
}
if [ "$#" -ne 0 ]; then
submit_package "$@"
else
for PROJ in "${PROJECTS[@]}"; do
submit_package "$PROJ"
done
for GAME in "${GAMES[@]}"; do
submit_package "$GAME"
done
for MODULE in "${MODULES[@]}"; do
submit_package "$MODULE" "module"
done
fi
#!/bin/bash
set -e
PROJECTS=(
eina
eet
evas
ecore
embryo
edje
e_dbus
efreet
eeze
elementary
e
eio
)
GAMES=(
econcentration
)
MODULES=(
mail
notification
taskbar
)
CUSTOM_PACKAGES=(
emphasis
)
REPOS=(
CentOS_CentOS-5
CentOS_CentOS-6
Fedora_14
Fedora_15
Mandriva_2009.1
Mandriva_2010
Mandriva_2010.1
openSUSE_11.3
openSUSE_11.4
openSUSE_Factory
openSUSE_Tumbleweed
RedHat_RHEL-4
RedHat_RHEL-5
RedHat_RHEL-6
SLE_10_SDK
SLE_11_SP1
)
#PROJECTS=""
#GAMES=""
#MODULES=""
#FIXME evas_generic_loaders
SITE="svn.enlightenment.org"
SVN_generic="http://$SITE/svn/e/trunk"
SVN_game="http://$SITE/svn/e/trunk/GAMES"
SVN_module="http://$SITE/svn/e/trunk/E-MODULES-EXTRA"
# custom SVN repositories
SVN_emphasis=http://emphasis-elementary.googlecode.com/svn/trunk/
OSC_PROJECT="X11:Enlightenment:Nightly"
OPT=()
make_tarball() {
# FIXME
DIR="$1"
NAME="$2"
VERSION="$3"
local TMP_DIR="$(mktemp -d)"
(
OLD_PWD="$PWD"
cd "$TMP_DIR"
cp -Rp "$DIR" "$NAME-$VERSION"
tar cjf "$OLD_PWD/$NAME-$VERSION.tar.bz2" --exclude-vcs "$NAME-$VERSION"
cd "$OLD_PWD"
rm -rf "$TMP_DIR"
)
}
submit_package()
{
echo "Updating $PROJ"
local SVNDIR=""
PROJ="$2"
OSC_PACKAGE="$PROJ"
PACKAGE_NAME="$PROJ"
case "$1" in
module) OSC_PACKAGE="e_module-$PROJ"; SVN="$SVN_module"; SVNSUBDIR="/$PROJ" ;;
game) SVN="$SVN_game/$PROJ" ;;
generic) SVN="$SVN_generic/$PROJ" ;;
custom) eval SVN="\"\$SVN_$PROJ\""; SVNDIR="$PROJ" ;;
*) echo "Unknown type '$1', aborting..."; return 1;;
esac
if [ $PROJ = "e" ]; then
PACKAGE_NAME="enlightenment"
OSC_PACKAGE="e17"
fi
# FIXME: this is just wrong!
PACKAGE_REGEX=$PACKAGE_NAME-*tar.*z*
PACKAGE_REGEX_COPY=$PACKAGE_NAME-*.tar.bz2
echo " - updating OBS package"
if [ -d "$OSC_PROJECT/$OSC_PACKAGE" ]; then
osc up "$OSC_PROJECT/$OSC_PACKAGE"
else
osc checkout "$OSC_PROJECT" "$OSC_PACKAGE"
fi
OLD_REVISION="$(cd "$OSC_PROJECT/$OSC_PACKAGE" && ls $PACKAGE_REGEX_COPY | sed -n "\$s/^$PACKAGE_NAME-[0-9.]\+\.\([0-9.]\+\)\.tar\.bz2$/\1/p")"
if [ -z "$OLD_REVISION" ]; then
OLD_REVISION=1
fi
echo " - updating SVN repository"
svn co "$SVN" ${SVNDIR:+"$SVNDIR"}
cd "$PROJ"
echo " - old revision: $OLD_REVISION"
if [ "$(svn log -r "${OLD_REVISION}":HEAD | wc -l)" -eq 1 ]; then
echo " - no changes for $PROJ"
cd -
continue
fi
echo " - changes detected"
rm -f $PACKAGE_REGEX
make clean distclean || true
[ -x autogen.sh ] && ./autogen.sh "${OPT[@]}"
make dist-bzip2
VERSION="$(ls $PACKAGE_REGEX_COPY | sed "s/^$PACKAGE_NAME-\([0-9.]\+\)\.tar\.bz2$/\1/")"
cd - &> /dev/null
cd "$OSC_PROJECT/$OSC_PACKAGE"
rm -f $PACKAGE_REGEX
cp ../../"$PROJ"/$PACKAGE_REGEX_COPY ./ && \
osc addremove && \
sed -i "s/^Version:.*/Version: $VERSION/" "$OSC_PACKAGE.spec" && \
osc vc -m "bump version to $VERSION" && \
yes | osc commit -m "bump version to $VERSION"
cd - &> /dev/null
}
can_ccache() {
if [[ "openSUSE_11.3 openSUSE_11.4 openSUSE_Factory openSUSE_Tumbleweed SLE_10_SDK SLE_11_SP1 Fedora_14 Fedora_15" =~ "$1" ]]; then
echo '--ccache'
fi
}
build_package_against_repo() {
(
cd "$1" || cd "e17" || retun 1
osc build `can_ccache "$2"` "$2" "$3"
)
}
build() {
cd "$OSC_PROJECT"
: > ../result
[ -d ../logs ] || mkdir ../logs
local res
for p in "${PROJECTS[@]}" "${GAMES[@]}" `for m in "${MODULES[@]}"; do echo "e_module-$m"; done`; do
for r in "${REPOS[@]}"; do
for a in i586 x86_64; do
if build_package_against_repo "$p" "$r" "$a" &> ../logs/"$p-$r-$a-$(date '+%F-%T')"; then
res=passed
else
res=failed
fi
printf "%-8s %-16s %-19s %6s\n" "$res" "$p" "$r" "$a" >> ../result
done
done
done
}
if [ "$#" -ne 0 ]; then
case "$1" in
-b) build ;;
-B) shift ; build_package_against_repo "$@" ;;
*) submit_package "$@" ;;
esac
else
for PROJ in "${PROJECTS[@]}"; do
submit_package "generic" "$PROJ"
done
for GAME in "${GAMES[@]}"; do
submit_package "game" "$GAME"
done
for MODULE in "${MODULES[@]}"; do
submit_package "module" "$MODULE"
done
for CUST in "${CUSTOM_PACKAGES[@]}"; do
submit_package "custom" "$CUST"
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.