From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=unavailable version=3.2.5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imath.kiev.ua; s=hydra; t=1403207253; bh=9BcY+9U1fQY6gHG5Rqzigdjl6iMOSxZzXIa5c/K8p3c=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Cm2ZTU71N69jSve3stMRi3FEJmZrybHyroxmAHp9iux2KRif/CSb8JnmaOXx7856z aTYfubzZ7LS2n3pk1bEbB3bp5LCS/QQ1/GYfuBLnqXSrlmW7fWs/mvbMrzlrXTwepy CbZHtek1ZlzPORRhyNxGD7LjXd+egpyzQyoiIQ+g= X-Virus-Scanned: amavisd-new at imath.kiev.ua DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imath.kiev.ua; s=hydra; t=1403207249; bh=9BcY+9U1fQY6gHG5Rqzigdjl6iMOSxZzXIa5c/K8p3c=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=bngaugK5sGsnIDii7WeUGNxVxGLustnZLtLpn+blgVUTmppK0NISjGYf2AeayR/vu 0pAiQQDNxLJtgCnYDx/qTGX2YPhfwj2P4UfcBNvc06T4Eq7LaI2gJIL9nPJOuovTHQ epu3Wr7AaIAeZuSe+RE9kGQEqccQAIDUIyLXmM2s= Date: Thu, 19 Jun 2014 22:50:07 +0300 From: Igor Vlasenko To: ALT Linux Team development discussions Message-ID: <20140619195007.GA19664@dad.imath.kiev.ua> References: <53A2D326.7080801@altlinux.com> <20140619121723.GA10499@dad.imath.kiev.ua> <53A2DC6B.1050307@altlinux.com> <20140619142413.GA10880@dad.imath.kiev.ua> <53A3178E.5000001@altlinux.com> <20140619182035.GA18999@dad.imath.kiev.ua> <53A32D6F.1000903@altlinux.com> <20140619185217.GA19339@dad.imath.kiev.ua> <53A33521.2040609@altlinux.com> <20140619194626.GA19576@dad.imath.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140619194626.GA19576@dad.imath.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Anton Farygin Subject: Re: [devel] =?utf-8?b?R2VhciDQuCDQstC90LXRiNC90LjQtSAgIFZDUy4=?= X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jun 2014 19:47:43 -0000 Archived-At: List-Archive: List-Post: --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Jun 19, 2014 at 10:46:26PM +0300, Igor Vlasenko wrote: > On Thu, Jun 19, 2014 at 11:08:17PM +0400, Anton Farygin wrote: > > >Достаточно ли > > >>>пока поддерживает только стандартные теги v@version@ и @version@, > > >? > > нет, см. php5 > > Пока не определился с форматом .gear/upstream/tag-filter, > прикрепляю новый test-tag-watch, для php5 запускать как > > test-tag-watch --pattern 'php-([0-9\.]+)' > > когда станет ясно содержимое .gear/upstream/tag-filter, > php-([0-9\.]+) можно будет вписать туда. забыл сам скрипт прикрепить - прикрепляю. -- I V --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=test-tag-watch #!/usr/bin/perl use strict; use warnings; use RPM::uscan; use Getopt::Long; my $pattern='v?([\d\.]*\d)'; my $pkg_dir='.'; my $debug=0; my ($verbose,$help); my $result = GetOptions ( 'verbose+' => \$verbose, 'q|quiet' => sub {$verbose=0}, 'h|help' => \$help, 'pattern=s' => \$pattern, ); $debug=1 if $verbose; print "pattern=$pattern\n" if $debug; print 'remotes=', join("\n",get_remotes($pkg_dir)),"\n" if $debug; my @tags=get_tags(); die "no tags found that match pattern $pattern\n" unless @tags; @tags = map {$_->[0]} Devscripts::Versort::upstream_versort(map {[$_,$_]}@tags); print 'tags=', join(" ",@tags),"\n" if $debug; my (undef, $upackage, $uversion) = RPM::uscan::altlinux_guess_package_and_version($pkg_dir); my $version_cmp=Devscripts::Versort::myvercmp($uversion, $tags[0]); if ($version_cmp>1) { print "Oops! local repository ($uversion) is ahead of remote repository ($tags[0]).\n"; } elsif ($version_cmp==0) { print "Repository is up to date.\n"; } else { print "New version $tags[0] is available.\n"; } sub get_tags { my @tags; foreach my $remote (&get_remotes($pkg_dir)) { foreach my $tag (&exec2array('git ls-remote --tags '.$remote)) { $tag=~s!^\S+\s+refs/tags/!!; $tag=~s!\^\{\}$!!; print "testing: $tag\n" if $debug; push @tags, $1 if $tag=~/^$pattern$/; } } return @tags; } sub exec2array { my ($cmd)=@_; my @out; my $fn; open ($fn, "$cmd |") or die "$!: can't exec $cmd\n"; local $_; while (<$fn>) { chomp; push @out, $_; } close ($fn); #print 'out=', join(";",@out),"\n"; return @out; } sub get_remotes { my ($pkg_dir)=@_; my @remotes; die "can't find $pkg_dir/.gear/upstream/remotes\n" unless -r $pkg_dir.'/.gear/upstream/remotes'; my $fn; open ($fn, 'git config --file '.$pkg_dir.'/.gear/upstream/remotes --list|') or die "$!: can't open .gear/upstream/remotes\n"; local $_; while (<$fn>) { chomp; next unless /^remote\.([^\.]+)\.url=(\S+)/; my $remote=$1; #my $url=$2; push @remotes, $remote; } close ($fn); my %local_remotes=map{$_=>1} &exec2array('git remote'); foreach my $remote (@remotes) { die "Oops: remote $remote is present in .gear/upstream/remotes, but not in .git/config!\n" unless $local_remotes{$remote}; } return @remotes; } --wRRV7LY7NUeQGEoC--