Hello community,
here is the log from the commit of package obs-service-tar_scm for openSUSE:Factory
checked in at Fri Aug 12 16:46:49 CEST 2011.
--------
New Changes file:
--- /dev/null 2010-08-26 16:28:41.000000000 +0200
+++ /mounts/work_src_done/STABLE/obs-service-tar_scm/obs-service-tar_scm.changes 2011-08-12 13:51:34.000000000 +0200
@@ -0,0 +1,48 @@
+-------------------------------------------------------------------
+Fri Aug 12 11:51:07 UTC 2011 - adrian@suse.de
+
+- fix exclude expansion
+
+-------------------------------------------------------------------
+Mon Jun 20 08:48:12 UTC 2011 - cthiel@novell.com
+
+- add support for bzr
+
+-------------------------------------------------------------------
+Tue Mar 22 14:55:55 UTC 2011 - ammler@openttdcoop.org
+
+- Fix: recompressed tars were never reused
+- cleanup mercurial commands
+
+-------------------------------------------------------------------
+Tue Feb 8 16:00:48 UTC 2011 - adrian@suse.de
+
+- always trust svn server certificate. We don't have a secure handling
+ for it anyway. Trust needs to established via extra service.
+
+-------------------------------------------------------------------
+Wed Jan 12 10:02:41 UTC 2011 - adrian@suse.de
+
+- fix subdir usage for git
+
+-------------------------------------------------------------------
+Thu Dec 30 12:41:57 UTC 2010 - adrian@suse.de
+
+- add option exclude files/directories when creating the tar ball
+- git clone runs now with --depth 1 option
+
+-------------------------------------------------------------------
+Wed Dec 8 06:29:42 UTC 2010 - wr@rosenauer.org
+
+- support mercurial repositories
+
+-------------------------------------------------------------------
+Wed Oct 20 16:27:25 UTC 2010 - reddwarf@opensuse.org
+
+- Fix --filename parameter use
+
+-------------------------------------------------------------------
+Fri Sep 3 10:31:32 UTC 2010 - adrian@suse.de
+
+- initial version to checkout/update svn or git repos and create a tar
+
calling whatdependson for head-i586
New:
----
obs-service-tar_scm.changes
obs-service-tar_scm.spec
tar_scm
tar_scm.service
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ obs-service-tar_scm.spec ++++++
#
# spec file for package obs-service-tar_scm
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: obs-service-tar_scm
License: GPL v2 or later
Group: Development/Tools/Building
Summary: An OBS source service: checkout or update a tar ball from svn/git/hg
Url: https://build.opensuse.org/package/show?package=obs-service-tar_scm&project=openSUSE%3ATools
Version: 0.2.1
Release: 1
Source: tar_scm
Source1: tar_scm.service
Requires: subversion git mercurial bzr
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
This is a source service for openSUSE Build Service.
It supports downloading from svn, git, hg and bzr repositories.
%prep
%setup -q -D -T 0 -n .
%build
%install
mkdir -p $RPM_BUILD_ROOT/usr/lib/obs/service
install -m 0755 %{SOURCE0} $RPM_BUILD_ROOT/usr/lib/obs/service
install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/obs/service
%files
%defattr(-,root,root)
%dir /usr/lib/obs
/usr/lib/obs/service
%changelog
++++++ tar_scm ++++++
#!/bin/bash
# A simple script to checkout or update a svn or git repo as source service
#
# (C) 2010 by Adrian Schröter
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# See http://www.gnu.org/licenses/gpl-2.0.html for full license text.
# defaults
MYSCM=""
MYURL=""
MYVERSION=""
MYPREFIX=""
MYFILENAME=""
MYREVISION=""
while test $# -gt 0; do
case $1 in
*-scm)
MYSCM="$2"
shift
;;
*-url)
MYURL="$2"
shift
;;
*-subdir)
MYSUBDIR="$2"
shift
;;
*-revision)
MYREVISION="$2"
shift
;;
*-version)
MYVERSION="$2"
shift
;;
*-versionprefix)
MYPREFIX="$2"
shift
;;
*-exclude)
EXCLUDES="$EXCLUDES --exclude=${2#/}"
shift
;;
*-filename)
MYFILENAME="${2#/}"
shift
;;
*-outdir)
MYOUTDIR="$2"
shift
;;
*)
echo Unknown parameter $1.
echo 'Usage: tar_scm --scm $SCM --url $URL --outdir $OUT'
exit 1
;;
esac
shift
done
FILE="$MYFILENAME"
VERSION="$MYVERSION"
if [ -z "$MYSCM" ]; then
echo "ERROR: no scm is given via --scm parameter (git/svn/hg)!"
exit 1
fi
if [ -z "$MYURL" ]; then
echo "ERROR: no checkout URL is given via --url parameter!"
exit 1
fi
if [ -z "$MYOUTDIR" ]; then
echo "ERROR: no output directory is given via --outdir parameter!"
exit 1
fi
SRCDIR=$(pwd)
cd "$MYOUTDIR"
if [ -z "$FILE" -a "$MYSCM" == "git" ]; then
FILE="${MYURL%/}"
FILE="${FILE##*/}"
FILE="${FILE%.git}"
fi
if [ -z "$FILE" -a "$MYSCM" == "svn" ]; then
FILE="${MYURL%/}"
FILE="${FILE##*/}"
fi
if [ -z "$FILE" -a "$MYSCM" == "hg" ]; then
FILE="${MYURL%/}"
FILE="${FILE##*/}"
fi
existing_tar=$(echo $SRCDIR/_service:*tar_scm:${FILE}-*.tar*)
if [ -e "$existing_tar" ]; then
UNCOMPRESS="cat"
if [ "${existing_tar%.tar.gz}" != "$existing_tar" ]; then
UNCOMPRESS="gunzip -c"
elif [ "${existing_tar%.tar.bz2}" != "$existing_tar" ]; then
UNCOMPRESS="bunzip2 -c"
elif [ "${existing_tar%.tar.xz}" != "$existing_tar" ]; then
UNCOMPRESS="xz -dc"
fi
if $UNCOMPRESS "$existing_tar" | tar xf -; then
TAR_DIRECTORY=`find * -maxdepth 0 -a -type d`
fi
fi
if [ "$MYSCM" == "svn" ]; then
if [ -z "$MYSUBDIR" -a -d "$TAR_DIRECTORY" ]; then
# update existing content for speed/bandwidth reasons
cd "$TAR_DIRECTORY"
OLDVERSION=`LC_ALL=C svn info | sed -n 's,^Last Changed Rev: \(.*\),\1,p'`
if [ -n "$MYREVISION" ]; then
svn up -r"$MYREVISION" || exit 1
else
svn up || exit 1
fi
NEWVERSION=`LC_ALL=C svn info | sed -n 's,^Last Changed Rev: \(.*\),\1,p'`
cd -
if [ "$OLDVERSION" == "$NEWVERSION" ]; then
# cleanup and skip
rm -rf "$TAR_DIRECTORY"
exit 0
fi
mv "$TAR_DIRECTORY" "${FILE}" || exit 1
else
# new checkout
if [ -n "$MYSUBDIR" ]; then
# just checkout the subdir
mkdir -p "$MYSUBDIR"
cd "$MYSUBDIR"
fi
if [ -n "$MYREVISION" ]; then
svn co --non-interactive --trust-server-cert -r"$MYREVISION" "$MYURL/$MYSUBDIR" "${FILE}" || exit 1
else
svn co --non-interactive --trust-server-cert "$MYURL/$MYSUBDIR" "${FILE}" || exit 1
fi
if [ -n "$MYSUBDIR" ]; then
cd -
fi
fi
if [ -z "$VERSION" ]; then
cd "$FILE"
[ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX.rev"
VERSION="$MYPREFIX"`LC_ALL=C svn info | sed -n 's,^Last Changed Rev: \(.*\),\1,p'`
cd -
fi
elif [ "$MYSCM" == "git" ]; then
if [ -z "$MYSUBDIR" -a -d "$TAR_DIRECTORY" ]; then
# update existing content for speed/bandwidth reasons
cd "$TAR_DIRECTORY"
OLDVERSION=`git show --pretty=%at | head -n 1`
git pull || exit 1
if [ -n "$MYREVISION" ]; then
git checkout "$MYREVISION" || exit 1
fi
NEWVERSION=`git show --pretty=%at | head -n 1`
cd -
if [ "$OLDVERSION" == "$NEWVERSION" ]; then
# cleanup and skip
rm -rf "$TAR_DIRECTORY"
exit 0
fi
mv "$TAR_DIRECTORY" "${FILE}" || exit 1
else
# new checkout
git clone --depth 1 "$MYURL" "${FILE}" || exit 1
if [ -n "$MYREVISION" ]; then
cd "$FILE"
git checkout "$MYREVISION" || exit 1
cd -
fi
fi
if [ -z "$VERSION" ]; then
cd "$FILE"
[ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX."
VERSION="$MYPREFIX"`git show --pretty=%at | head -n 1`
cd -
fi
elif [ "$MYSCM" == "hg" ]; then
if [ -z "$MYSUBDIR" -a -d "$TAR_DIRECTORY" ]; then
# update existing content for speed/bandwidth reasons
cd "$TAR_DIRECTORY"
OLDVERSION=`hg id -i -rtip`
hg pull || exit 1
NEWVERSION=`hg id -i -rtip`
cd -
if [ "$OLDVERSION" == "$NEWVERSION" ]; then
# cleanup and skip
rm -rf "$TAR_DIRECTORY"
exit 0
fi
mv "$TAR_DIRECTORY" "${FILE}" || exit 1
else
# new checkout
hg clone "$MYURL" "${FILE}" || exit 1
fi
if [ -n "$MYREVISION" ]; then
cd "$FILE"
hg update "$MYREVISION" || exit 1
cd -
fi
if [ -z "$VERSION" ]; then
cd "$FILE"
[ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX."
# current working revision
VERSION="$MYPREFIX"`hg id -n`
cd -
fi
elif [ "$MYSCM" == "bzr" ]; then
if [ -z "$MYSUBDIR" -a -d "$TAR_DIRECTORY" ]; then
# update existing content for speed/bandwidth reasons
cd "$TAR_DIRECTORY"
OLDVERSION=`bzr revno`
bzr update || exit 1
if [ -n "$MYREVISION" ]; then
bzr revert -r "$MYREVISION" || exit 1
fi
NEWVERSION=`bzr revno`
cd -
if [ "$OLDVERSION" == "$NEWVERSION" ]; then
# cleanup and skip
rm -rf "$TAR_DIRECTORY"
exit 0
fi
mv "$TAR_DIRECTORY" "${FILE}" || exit 1
else
# new checkout
if [ -n "$MYREVISION" ]; then
bzr checkout -r "$MYREVISION" "$MYURL" "${FILE}" || exit 1
else
bzr checkout "$MYURL" "${FILE}" || exit 1
fi
fi
if [ -z "$VERSION" ]; then
cd "$FILE"
[ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX."
VERSION="$MYPREFIX"`bzr revno`
cd -
fi
else
echo "ERROR: unknown scm $MYSCM"
exit 1
fi
if [ ! -e "$FILE/$MYSUBDIR" ]; then
echo "Directory does not exist: $FILE/$MYSUBDIR"
exit 1
fi
mv "$FILE/$MYSUBDIR" "${FILE}-${VERSION}" || exit 1
tar cf "$MYOUTDIR/${FILE}-${VERSION}.tar" $EXCLUDES "${FILE}-${VERSION}" || exit 1
rm -rf "${FILE}-${VERSION}" "$FILE"
exit 0
++++++ tar_scm.service ++++++
<service name="tar_scm">
<summary>Create a tar ball from SCM repository</summary>
<description>This service uses a scm client to checkout or update from a given repository. Supported are svn, git, hg and bzr.</description>
<parameter name="scm">
<description>Used SCM</description>
<allowedvalue>svn</allowedvalue>
<allowedvalue>git</allowedvalue>
<allowedvalue>hg</allowedvalue>
<allowedvalue>bzr</allowedvalue>
<required/>
</parameter>
<parameter name="url">
<description>Checkout url</description>
<required/>
</parameter>
<parameter name="subdir">
<description>package just a sub directory</description>
</parameter>
<parameter name="versionprefix">
<description>specify a base version as prefix.</description>
</parameter>
<parameter name="revision">
<description>specify a revision</description>
</parameter>
<parameter name="filename">
<description>base file name to be created</description>
</parameter>
<parameter name="exclude">
<description>for sepcifing excludes when creating the tar ball</description>
</parameter>
<parameter name="version">
<description>version to be used in tar</description>
</parameter>
</service>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org