From owner-svn-ports-head@FreeBSD.ORG Sun Sep 16 13:31:39 2012 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0E881065677; Sun, 16 Sep 2012 13:31:39 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABF808FC14; Sun, 16 Sep 2012 13:31:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GDVdlV094972; Sun, 16 Sep 2012 13:31:39 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GDVdP5094970; Sun, 16 Sep 2012 13:31:39 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201209161331.q8GDVdP5094970@svn.freebsd.org> From: Chris Rees Date: Sun, 16 Sep 2012 13:31:39 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r304348 - head/Tools/scripts X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 13:31:39 -0000 Author: crees Date: Sun Sep 16 13:31:39 2012 New Revision: 304348 URL: http://svn.freebsd.org/changeset/ports/304348 Log: Accepts the new svn_revision tag in the removed ports xml database. Apologies for the complexity of the code; it's optimised for speed. Soon I will be able to remove the section working with dates. Modified: head/Tools/scripts/addport Modified: head/Tools/scripts/addport ============================================================================== --- head/Tools/scripts/addport Sun Sep 16 12:54:04 2012 (r304347) +++ head/Tools/scripts/addport Sun Sep 16 13:31:39 2012 (r304348) @@ -332,11 +332,17 @@ foreach my $thisdir (@dirs) { my $oldportlist; if ($oldportlist = get('http://people.FreeBSD.org/~crees/removed_ports/index.xml')) { foreach (split("\n", $oldportlist)) { - if (/^ +\$category\/$portname\([^<]*)/) { - $previous_incarnation = $1; - $previous_incarnation =~ s,/,-,g; + if (/^ +\$category\/$portname(?:\r([0-9]*)\<\/removed_revision\>)?\([^<]*)/) { print "Found one!\n"; - print "This port was last alive on $previous_incarnation.\n"; + if ($1 == "") { + $previous_incarnation = $2; + $previous_incarnation =~ s,/,-,g; + print "This port was last alive on $previous_incarnation.\n"; + $previous_incarnation = "\{$previous_incarnation\}"; + } else { + $previous_incarnation = $1 - 1; + print "The last living revision of this port was r$previous_incarnation.\n"; + } last; } } @@ -345,7 +351,7 @@ foreach my $thisdir (@dirs) { } if ($previous_incarnation ne "bogus") { print "Fetching older version... "; - system("svn cp -q '$repo/$category/$portname\@{$previous_incarnation}' ."); + system("svn cp -q '$repo/$category/$portname\@$previous_incarnation' ."); print "[DONE]\n"; print "Removing irrelevant files and directories... "; my @oldfiles = split("\0", `cd $portname && find . -type f -print0`);