diff options
author | crees <crees@FreeBSD.org> | 2012-09-16 21:31:39 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2012-09-16 21:31:39 +0800 |
commit | 4f101337e4d939c460a8f9cd4a2b774b8ad3f20d (patch) | |
tree | d897256f943ff5d93534046d41804b605996874d /Tools | |
parent | ea017f3a9054bdc3cae44b669542c7c7f7c7da24 (diff) | |
download | freebsd-ports-graphics-4f101337e4d939c460a8f9cd4a2b774b8ad3f20d.tar.gz freebsd-ports-graphics-4f101337e4d939c460a8f9cd4a2b774b8ad3f20d.tar.zst freebsd-ports-graphics-4f101337e4d939c460a8f9cd4a2b774b8ad3f20d.zip |
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.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/addport | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index 07193a2c7b5..9cabca07269 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -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 (/^ +\<port\>$category\/$portname\<removed_date\>([^<]*)/) { - $previous_incarnation = $1; - $previous_incarnation =~ s,/,-,g; + if (/^ +\<port\>$category\/$portname(?:\<removed_revision\>r([0-9]*)\<\/removed_revision\>)?\<removed_date\>([^<]*)/) { 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`); |