Hello community, here is the log from the commit of package obs-service-set_version for openSUSE:Factory checked in at 2014-09-12 17:04:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/obs-service-set_version (Old) and /work/SRC/openSUSE:Factory/.obs-service-set_version.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "obs-service-set_version" Changes: -------- --- /work/SRC/openSUSE:Factory/obs-service-set_version/obs-service-set_version.changes 2014-07-11 06:47:00.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.obs-service-set_version.new/obs-service-set_version.changes 2014-09-12 17:05:54.000000000 +0200 @@ -1,0 +2,16 @@ +Thu Sep 11 12:44:10 UTC 2014 - jblunck@infradead.org + +- Update to version 0.4.2: + + Release 0.4.2 - Update Debian changelog + +------------------------------------------------------------------- +Wed Sep 10 15:40:33 UTC 2014 - adrian@suse.de + +- Update to version 0.4.2: + + the extension needs to be \. + + test with defined() at ./set_version line 118. + + Fix processing of --file parameter + + Add support for setting the version in debian.changelog + + Sort local file list based on modification time (newest first) + +------------------------------------------------------------------- Old: ---- obs-service-set_version-0.4.1.tar.gz New: ---- obs-service-set_version-0.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ obs-service-set_version.spec ++++++ --- /var/tmp/diff_new_pack.vR63fZ/_old 2014-09-12 17:05:55.000000000 +0200 +++ /var/tmp/diff_new_pack.vR63fZ/_new 2014-09-12 17:05:55.000000000 +0200 @@ -19,7 +19,7 @@ %define service set_version Name: obs-service-%{service} -Version: 0.4.1 +Version: 0.4.2 Release: 0 Summary: An OBS source service: Update spec file version License: GPL-2.0+ ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.vR63fZ/_old 2014-09-12 17:05:55.000000000 +0200 +++ /var/tmp/diff_new_pack.vR63fZ/_new 2014-09-12 17:05:55.000000000 +0200 @@ -1,4 +1,4 @@ asd=yxc pkgrel=0 -md5sums=('829bf5506328c711e7077400efc6feba') +md5sums=('df5a1fdf5313a841afcbd82dd1ab593d') ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.vR63fZ/_old 2014-09-12 17:05:55.000000000 +0200 +++ /var/tmp/diff_new_pack.vR63fZ/_new 2014-09-12 17:05:55.000000000 +0200 @@ -1,5 +1,5 @@ <servicedata> <service name="tar_scm"> <param name="url">git@github.com:openSUSE/obs-service-set_version.git</param> - <param name="changesrevision">eab34cf8af</param></service> + <param name="changesrevision">310b9a0efc</param></service> </servicedata> \ No newline at end of file ++++++ debian.dsc ++++++ --- /var/tmp/diff_new_pack.vR63fZ/_old 2014-09-12 17:05:55.000000000 +0200 +++ /var/tmp/diff_new_pack.vR63fZ/_new 2014-09-12 17:05:55.000000000 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: obs-service-set-version -Version: 0.4.1 +Version: 0.4.2 Binary: obs-service-set-version Maintainer: Adrian Schroeter <adrian@suse.de> Architecture: all ++++++ obs-service-set_version-0.4.1.tar.gz -> obs-service-set_version-0.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-set_version-0.4.1/debian/changelog new/obs-service-set_version-0.4.2/debian/changelog --- old/obs-service-set_version-0.4.1/debian/changelog 2014-07-09 16:09:37.000000000 +0200 +++ new/obs-service-set_version-0.4.2/debian/changelog 2014-09-11 14:44:10.000000000 +0200 @@ -1,3 +1,13 @@ +obs-service-set-version (0.4.2) unstable; urgency=low + + * the extension needs to be \. + * test with defined() at ./set_version line 118. + * Fix processing of --file parameter + * Add support for setting the version in debian.changelog + * Sort local file list based on modification time (newest first) + + -- Jan Blunck <jblunck@infradead.org> Wed, 10 Sep 2014 18:20:20 +0200 + obs-service-set-version (0.4.1) unstable; urgency=low * Initial release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-set_version-0.4.1/set_version new/obs-service-set_version-0.4.2/set_version --- old/obs-service-set_version-0.4.1/set_version 2014-07-09 16:09:37.000000000 +0200 +++ new/obs-service-set_version-0.4.2/set_version 2014-09-11 14:44:10.000000000 +0200 @@ -80,12 +80,15 @@ my @srcfiles = grep {$_ ne '.' && $_ ne '..'} readdir(D); closedir D; +# sorted local file list by modification time (newest first) +@srcfiles = sort { -M "$a" <=> -M "$b" } (@srcfiles); + # Detect version based on file names unless ($version) { my @binsufs = qw{tar tar.gz tgz tar.bz2 tbz2 tar.xz zip}; my $binsufsre = join('|', map {"\Q$_\E"} @binsufs); for my $name (@srcfiles) { - if ($name =~ /^$basename.*[-_]([\d].*).(?:$binsufsre)$/) { + if ($name =~ /^$basename.*[-_]([\d].*)\.(?:$binsufsre)$/) { $version=$1; last; } @@ -115,7 +118,7 @@ # Detect version based on Debian changelog unless ($version) { - if (my $dch = glob("*debian.changelog")) { + if (defined(my $dch = glob("*debian.changelog"))) { open ( FH, "$dch" ); my $line = <FH>; if ($line =~ /.*\((.*)\).*/) { @@ -158,20 +161,58 @@ rename("$outdir/.$filename", "$outdir/$filename") || die("rename failed"); } +# to replace version in debian.changelog file +sub replace_debian_changelog_version { + my ($filename, $string) = @_; + local *R; + local *W; + # read, try first an modified version in outdir + if (!open(R, '<', "$outdir/$filename")) { + if (!open(R, '<', $filename)) { + die("unable to read $filename: $!\n"); + return undef; + } + } + if (!open(W, '>', "$outdir/.$filename")) { + die("unable to write .$filename: $!\n"); + return undef; + } + my $line = <R>; + # only replace version in the most recent entry (the first line) + if ($line =~ /.*\((.*)\).*/) { + $line =~ s/$1/$string/; + } + print W "$line"; + # copy the rest + while (<R>) { + print W; + } + close R; + close W; + + rename("$outdir/.$filename", "$outdir/$filename") || die("rename failed"); +} + die("No version found or defined") unless $version; +# if no files explicitly specified process whole directory +push @files, @srcfiles if @files <= 0; + # handle rpm spec and debian dsc files -@files = grep {$_ =~ /.(spec|dsc)$/} @srcfiles if @files <= 0; -for my $file (@files) { +for my $file (grep {$_ =~ /.(spec|dsc)$/} @files) { replace_tag($file, 'Version', $version); replace_tag($file, 'Release', "0"); } +# update debian.changelog file +for my $file (grep {$_ =~ /.*debian.changelog$/} @files) { + replace_debian_changelog_version($file, $version); +} + use Digest::MD5; # handle arch linux PKGBUILD files -@files = grep {$_ =~ /PKGBUILD$/} @srcfiles; -for my $pkgbuild (@files) { +for my $pkgbuild (grep {$_ =~ /PKGBUILD$/} @files) { # find md5sum of tar ball my $md5sum; my $tarfile; -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org