[Rt-commit] rtir branch, ipv6, updated. 2.6.0-24-g5cf3e5b

Ruslan Zakirov ruz at bestpractical.com
Wed Jun 29 17:35:05 EDT 2011


The branch, ipv6 has been updated
       via  5cf3e5b3aa706585fca1ebb4b1ef1b9953b47674 (commit)
      from  d7198e76bbf953dfe0cb2a0abc65e95046e8f3da (commit)

Summary of changes:
 etc/upgrade/2.6.1/content |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 etc/upgrade/2.6.1/content

- Log -----------------------------------------------------------------
commit 5cf3e5b3aa706585fca1ebb4b1ef1b9953b47674
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Jun 30 01:30:54 2011 +0400

    upgrade script, change pattern on IP field

diff --git a/etc/upgrade/2.6.1/content b/etc/upgrade/2.6.1/content
new file mode 100644
index 0000000..3dc8835
--- /dev/null
+++ b/etc/upgrade/2.6.1/content
@@ -0,0 +1,21 @@
+use Regexp::Common qw(net);
+use Regexp::Common::net::CIDR();
+use Regexp::IPv6 qw($IPv6_re);
+my $ip_pattern = qr{(?#IP/IP-IP/CIDR)^(?:|\s*$RE{net}{IPv4}(?:\s*-\s*$RE{net}{IPv4})?\s*|$RE{net}{CIDR}{IPv4}|$IPv6_re(?:\/\d+)?|$IPv6_re-$IPv6_re)$};
+
+ at Final = (
+    sub {
+        my $cf = RT::CustomField->new( $RT::SystemUser );
+        $cf->Load('IP');
+        unless ( $cf->id ) {
+            $RT::Logger->error("Couldn't load IP custom field");
+            return;
+        }
+
+        my ($status, $msg) = $cf->SetPattern("$ip_pattern");
+        unless ( $status ) {
+            $RT::Logger->error("Couldn't change pattern: $msg");
+        }
+        return $status;
+    },
+);

-----------------------------------------------------------------------


More information about the Rt-commit mailing list