Hello community,
here is the log from the commit of package obs-service-recompress for
openSUSE:Factory checked in at 2012-03-22 12:37:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-service-recompress (Old)
and /work/SRC/openSUSE:Factory/.obs-service-recompress.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "obs-service-recompress", Maintainer is ""
Changes:
--------
New Changes file:
--- /dev/null 2012-03-17 10:42:43.883537212 +0100
+++
/work/SRC/openSUSE:Factory/.obs-service-recompress.new/obs-service-recompress.changes
2012-03-22 12:37:19.000000000 +0100
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------
+Thu Feb 14 15:52:17 UTC 2012 - [email protected]
+
+- always remove uncompressed files
+- fix rpmlint warnings
New:
----
obs-service-recompress.changes
obs-service-recompress.spec
recompress
recompress.service
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ obs-service-recompress.spec ++++++
#
# spec file for package obs-service-recompress
#
# Copyright (c) 2012 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-recompress
License: GPL-2.0+
Group: Development/Tools/Building
Summary: An OBS source service: Recompress files
Version: 0.2
Release: 1
Url:
https://build.opensuse.org/package/show?package=obs-service-recompress&project=openSUSE%3ATools
Source: recompress
Source1: recompress.service
Requires: xz gzip bzip2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
This is a source service for openSUSE Build Service.
It supports to compress, uncompress or recompress files from or to
none : No Compression
gz : Gzip Compression
bz2 : Bzip2 Compression
xz : XZ Compression
%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
++++++ recompress ++++++
#!/bin/bash
# A simple script to checkout or update a svn or git repo as source service
#
# (C) 2010 by Adrian Schröter <[email protected]>
#
# 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
MYCOMPRESSION=""
FILES=""
while test $# -gt 0; do
case $1 in
*-compression)
MYCOMPRESSION="$2"
shift
;;
*-file)
FILES="$FILES ${2##*/}"
shift
;;
*-outdir)
MYOUTDIR="$2"
shift
;;
*)
echo Unknown parameter $1.
echo 'Usage: recompress --compression $COMPRESSION --file $FILE --outdir
$OUT'
exit 1
;;
esac
shift
done
if [ -z "$MYCOMPRESSION" ]; then
MYCOMPRESSION="bz2"
fi
if [ -z "$FILES" ]; then
echo "ERROR: no inputs files are given via --file parameter!"
exit 1
fi
if [ -z "$MYOUTDIR" ]; then
echo "ERROR: no output directory is given via --outdir parameter!"
exit 1
fi
for i in $FILES; do
FILE=`ls -1 "$i" || ls -1 "_service:*:$i"`
if [ ! -f "$FILE" ]; then
echo "Unknown file $i"
exit 1
fi
UNCOMPRESS="cat"
BASENAME="$FILE"
if [ "${FILE%.gz}" != "$FILE" ]; then
UNCOMPRESS="gunzip -c"
BASENAME="${FILE%.gz}"
elif [ "${FILE%.tgz}" != "$FILE" ]; then
UNCOMPRESS="gunzip -c"
BASENAME="${FILE%.tgz}.tar"
elif [ "${FILE%.bz2}" != "$FILE" ]; then
UNCOMPRESS="bunzip2 -c"
BASENAME="${FILE%.bz2}"
elif [ "${FILE%.xz}" != "$FILE" ]; then
UNCOMPRESS="xz -dc"
BASENAME="${FILE%.xz}"
fi
if [ "$MYCOMPRESSION" == "gz" ]; then
COMPRESS="gzip -c -n --rsyncable -"
NEWFILE="${BASENAME#_service:}.gz"
elif [ "$MYCOMPRESSION" == "bz2" ]; then
COMPRESS="bzip2 -c -"
NEWFILE="${BASENAME#_service:}.bz2"
elif [ "$MYCOMPRESSION" == "xz" ]; then
COMPRESS="xz -c -"
NEWFILE="${BASENAME#_service:}.xz"
elif [ "$MYCOMPRESSION" == "none" ]; then
COMPRESS="cat -"
NEWFILE="${BASENAME#_service:}"
else
echo "ERROR: Unknown compression $MYCOMPRESSION"
exit 1
fi
# do the real work
$UNCOMPRESS "$FILE" | $COMPRESS > "$MYOUTDIR/$NEWFILE" || exit 1
# we can remove service files, no need to store them twice
rm -f "$FILE"
done
exit 0
++++++ recompress.service ++++++
<service name="recompress">
<summary>Change File Compression</summary>
<description>This service supports to compress, uncompress or recompress
files from or to
none : No Compression
gz : Gzip Compression
bz2 : Bzip2 Compression
xz : XZ Compression
</description>
<parameter name="compression">
<description>Used compression</description>
<allowedvalue>none</allowedvalue>
<allowedvalue>gz</allowedvalue>
<allowedvalue>bz2</allowedvalue>
<allowedvalue>xz</allowedvalue>
<required/>
</parameter>
<parameter name="file">
<description>name of file to be recompressed. RegExp are
allowed.</description>
<required/>
</parameter>
</service>
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]