Hello community,

here is the log from the commit of package ruby-common for openSUSE:Factory 
checked in at 2013-01-03 13:47:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ruby-common (Old)
 and      /work/SRC/openSUSE:Factory/.ruby-common.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ruby-common", Maintainer is "r...@suse.com"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ruby-common/ruby-common.changes  2012-12-05 
14:06:49.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ruby-common.new/ruby-common.changes     
2013-01-03 13:47:49.000000000 +0100
@@ -1,0 +2,16 @@
+Fri Dec 28 13:38:59 UTC 2012 - co...@suse.com
+
+- always provide the full version string as people use
+  ~> 1.2 even if the version is 1.2
+  The old logic assumed people would always require one digit
+  less than the actual version
+
+-------------------------------------------------------------------
+Wed Dec 19 19:17:46 GMT 2012 - aspi...@suse.com
+
+- Import an enhanced version of d:l:r:e/all-good/update-sources.sh
+  which can be reused for any project, and allows more thorough
+  handling of BuildRequires from different repository / arch
+  combinations.
+
+-------------------------------------------------------------------

New:
----
  generate_buildrequires.sh

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ruby-common.spec ++++++
--- /var/tmp/diff_new_pack.xUb8mk/_old  2013-01-03 13:47:50.000000000 +0100
+++ /var/tmp/diff_new_pack.xUb8mk/_new  2013-01-03 13:47:50.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ruby-common
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 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
@@ -25,6 +25,7 @@
 Source4:        rubygems.attr
 Source5:        rubygemsdeps.rb
 Source6:        gem_install.sh
+Source7:        generate_buildrequires.sh
 Summary:        Collection of scripts and macros for ruby packaging
 License:        MIT
 Group:          Development/Languages/Ruby
@@ -53,6 +54,7 @@
 install -D -m 0755 %{S:5} $RPM_BUILD_ROOT/usr/lib/rpm/rubygemsdeps.rb
 install -D -m 0755 %{S:6} $RPM_BUILD_ROOT/usr/lib/rpm/gem_install.sh
 install -D -m 0755 %{S:1} $RPM_BUILD_ROOT/usr/lib/rpm/gem_build_cleanup.sh
+install -D -m 0755 %{S:7} $RPM_BUILD_ROOT/usr/lib/rpm/generate_buildrequires.sh
 
 %files
 %defattr(-,root,root)
@@ -62,5 +64,6 @@
 /usr/lib/rpm/rubygemsdeps.rb
 /usr/lib/rpm/gem_install.sh
 /usr/lib/rpm/gem_build_cleanup.sh
+/usr/lib/rpm/generate_buildrequires.sh
 
 %changelog

++++++ generate_buildrequires.sh ++++++
#!/bin/sh
#
# In the current package's specfile, updates a block delimited
# by "# BEGIN" / "# END" lines to contain BuildRequires: lines
# for each rubygem rpm (or rpm matching a given pattern) which
# has been built by the project.
#
# This gives us project-build-time dependency checking without the
# performance impact that specifying BuildRequires lines within
# each gem would cause.  For more information, see:
#
#   
http://en.opensuse.org/openSUSE:Packaging_Ruby#Compensating_for_lack_of_BuildRequires
#
# Usage:
# ------
#
# 1. Ensure you have an "all-rubygems-good" package or similar
#    in your project.  If in doubt, copy the one from
#    devel:languages:ruby:extensions.
#
# 2. cd to a working copy
#
# If you're feeling lazy, you are probably fine skipping the next two
# steps.
#
# 3. Run this script with the -l option and make sure you understand
#    any differences between each repository/arch combination in the
#    numbers of matching gems found.
#
# 4. If you don't, run with -l REPO ARCH to compare individual lists
#    of matching gems.
#
# 5. If you want a BuildRequires: list of matching gems from *all*
#    repo/arch combinations, run again with no arguments.
#
#      OR
#
#    If you want a BuildRequires: list of matching gems from a specific
#    repo/arch combinations, run again with REPO ARCH as arguments.
#
# 6. osc diff to review the changes to the spec file, then osc commit.

me=`basename $0`

DEFAULT_PATTERN="rubygem-"

main () {
    parse_opts "$@"

    project=$( osc info | sed -ne '/^Project name: / { s///; p }' )
    if [ -z "$project" ]; then
        echo "Couldn't establish build service project name." >&2
        echo "Are you inside a package working directory?" >&2
        exit 1
    fi
    echo "Project: $project"

    specfile=$( ls -1 *.spec )
    if ! [ -f "$specfile" ]; then
        echo "Couldn't find spec file." >&2
        echo "Are you inside a package working directory?" >&2
        exit 1
    fi

    if [ -n "$list" ]; then
        if [ -n "$repo" ]; then
            get_buildrequires_lines "$repo" "$arch"
        else
            list_matches
        fi
    else
        if [ -n "$repo" ]; then
            get_buildrequires_lines "$repo" "$arch" | update_spec
        else
            find_all_matches | update_spec
        fi
    fi
}

usage () {
    # Call as: usage [EXITCODE] [USAGE MESSAGE]
    exit_code=1
    if [[ "$1" == [0-9] ]]; then
        exit_code="$1"
        shift
    fi
    if [ -n "$1" ]; then
        echo "$*" >&2
        echo
    fi

    cat <<EOF >&2
Usage: $me [options] [REPOSITORY ARCH]
Options:
  -h, --help         Show this help and exit
  -l, --list         List matching rpms for the given repository / arch.
                     If no repository specified, show counts of matching
                     rpms per repository / arch.
  -p, --pattern=PAT  Set the pattern to match rpms by [$DEFAULT_PATTERN]
EOF
    exit "$exit_code"
}

parse_opts () {
    list=
    pattern="$DEFAULT_PATTERN"

    while [ $# != 0 ]; do
        case "$1" in
            -h|--help)
                usage 0
                ;;
            -l|--list)
                list=y
                shift
                ;;
            -p|--pattern)
                pattern="$2"
                shift 2
                ;;
            -*)
                usage "Unrecognised option: $1"
                ;;
            *)
                break
                ;;
        esac
    done

    if [ $# = 1 ]; then
        usage "Insufficient arguments."
    fi

    if [ $# -gt 2 ]; then
        usage "Too many arguments."
    fi

    repo="$1"
    arch="$2"
}

get_buildrequires_lines () {
    repo="$1" arch="$2"
    osc api "/build/$project/$repo/$arch/_repository" | \
        grep "binary .*filename=\"$pattern" | \
        sed -e 's,.*  <binary filename=",,; s,\.rpm".*,,; s,^,BuildRequires: ,' 
| \
        grep -v debuginfo
}

list_matches () {
    echo
    echo "Matching rpms per repository/arch:"
    echo
    osc repos | while read repo arch; do
        count=$( get_buildrequires_lines "$repo" "$arch" | wc -l )
        printf "%-17s %-8s %d\n" "$repo" "$arch" "$count"
    done
    echo
}

find_all_matches () {
    osc repos | while read repo arch; do
        echo "Obtaining BuildRequires from $repo $arch ..." >&2
        get_buildrequires_lines "$repo" "$arch"
    done | sort -u
}

edit_spec () {
    sed -n -e '1,/BEGIN/p' $specfile
    echo "# Automatically generated by $0"
    echo "# on `date`"
    echo "# See 
http://en.opensuse.org/openSUSE:Packaging_Ruby#Compensating_for_lack_of_BuildRequires";
    cat
    sed -n -e '/END/,$p' $specfile
}

update_spec () {
    if edit_spec > $specfile.new; then
        mv $specfile.new $specfile
        echo "Updated spec: $specfile"
    else
        echo "Failed to generate new spec file contents; aborting." >&2
        exit 1
    fi
}

main "$@"
++++++ rubygemsdeps.rb ++++++
--- /var/tmp/diff_new_pack.xUb8mk/_old  2013-01-03 13:47:50.000000000 +0100
+++ /var/tmp/diff_new_pack.xUb8mk/_new  2013-01-03 13:47:50.000000000 +0100
@@ -99,17 +99,17 @@
     # old forms
     puts "rubygem-#{spec.name} = #{spec.version}"
     versions = spec.version.to_s.split('.')
-    puts "rubygem-#{spec.name}-#{versions[0]} = #{spec.version}" if 
versions.length > 1
-    puts "rubygem-#{spec.name}-#{versions[0]}_#{versions[1]} = 
#{spec.version}" if versions.length > 2
-    puts "rubygem-#{spec.name}-#{versions[0]}_#{versions[1]}_#{versions[2]} = 
#{spec.version}" if versions.length > 3
+    puts "rubygem-#{spec.name}-#{versions[0]} = #{spec.version}" if 
versions.length > 0
+    puts "rubygem-#{spec.name}-#{versions[0]}_#{versions[1]} = 
#{spec.version}" if versions.length > 1
+    puts "rubygem-#{spec.name}-#{versions[0]}_#{versions[1]}_#{versions[2]} = 
#{spec.version}" if versions.length > 2
 
     # version without ruby version - asking for trouble
     puts "rubygem(#{spec.name}) = #{spec.version}"
     if rubyabi
       puts "rubygem(#{rubyabi}:#{spec.name}) = #{spec.version}"
-      puts "rubygem(#{rubyabi}:#{spec.name}:#{versions[0]}) = #{spec.version}" 
if versions.length > 1
-      puts "rubygem(#{rubyabi}:#{spec.name}:#{versions[0]}.#{versions[1]}) = 
#{spec.version}" if versions.length > 2
-      puts 
"rubygem(#{rubyabi}:#{spec.name}:#{versions[0]}.#{versions[1]}.#{versions[2]}) 
= #{spec.version}" if versions.length > 3
+      puts "rubygem(#{rubyabi}:#{spec.name}:#{versions[0]}) = #{spec.version}" 
if versions.length > 0
+      puts "rubygem(#{rubyabi}:#{spec.name}:#{versions[0]}.#{versions[1]}) = 
#{spec.version}" if versions.length > 1
+      puts 
"rubygem(#{rubyabi}:#{spec.name}:#{versions[0]}.#{versions[1]}.#{versions[2]}) 
= #{spec.version}" if versions.length > 2
     end
   end
 

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to