p4ruby 2017.1.1599185 → 2020.1.1970474
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +3 -871
- data/ext/P4/extconf.rb +62 -12
- data/ext/P4/p4.cpp +26 -0
- data/ext/P4/p4clientapi.cpp +36 -17
- data/ext/P4/p4clientapi.h +3 -1
- data/ext/P4/p4error.cpp +15 -0
- data/ext/P4/p4error.h +1 -0
- data/ext/P4/p4result.cpp +1 -0
- data/ext/P4/specmgr.cpp +54 -88
- data/lib/P4.rb +1 -1
- data/lib/P4/version.rb +3 -3
- metadata +8 -8
    
        data/ext/P4/extconf.rb
    CHANGED
    
    | @@ -6,10 +6,19 @@ require 'mkmf' | |
| 6 6 | 
             
            require 'net/ftp'
         | 
| 7 7 | 
             
            require 'P4/version'
         | 
| 8 8 | 
             
            require 'rbconfig'
         | 
| 9 | 
            +
            require 'openssl'
         | 
| 9 10 |  | 
| 10 11 | 
             
            # Set this to the main version directory we look up in ftp.perforce.com for the P4API
         | 
| 11 12 | 
             
            # This is ignored if you specify the version on the command line.
         | 
| 12 | 
            -
             | 
| 13 | 
            +
            # Changed the hardcoded string so that the version is now derived from version.rb file
         | 
| 14 | 
            +
            #P4API_VERSION_DIR = 'r19.1'
         | 
| 15 | 
            +
            def p4api_version_dir
         | 
| 16 | 
            +
                    ver=P4::Version.split(".")
         | 
| 17 | 
            +
                    p4_major = ver[0].chars.last(2).join
         | 
| 18 | 
            +
                    p4_minor = ver[1]
         | 
| 19 | 
            +
                    dir = "r" + p4_major + "." + p4_minor
         | 
| 20 | 
            +
            end
         | 
| 21 | 
            +
             | 
| 13 22 |  | 
| 14 23 | 
             
            #==============================================================================
         | 
| 15 24 | 
             
            # Provide platform variables in P4-specific format
         | 
| @@ -102,6 +111,15 @@ def calculate_p4osver | |
| 102 111 | 
             
              return ver
         | 
| 103 112 | 
             
            end
         | 
| 104 113 |  | 
| 114 | 
            +
            def gcc
         | 
| 115 | 
            +
              @gcc ||= calculate_gcc
         | 
| 116 | 
            +
            end
         | 
| 117 | 
            +
             | 
| 118 | 
            +
            def calculate_gcc
         | 
| 119 | 
            +
              gcc = RbConfig::CONFIG["GCC"]
         | 
| 120 | 
            +
              return gcc
         | 
| 121 | 
            +
            end
         | 
| 122 | 
            +
             | 
| 105 123 | 
             
            def uname_platform
         | 
| 106 124 | 
             
              @uname_platform ||= calculate_uname_platform
         | 
| 107 125 | 
             
            end
         | 
| @@ -155,6 +173,13 @@ def set_platform_opts | |
| 155 173 | 
             
              end
         | 
| 156 174 | 
             
            end
         | 
| 157 175 |  | 
| 176 | 
            +
            def set_platform_cxxflags
         | 
| 177 | 
            +
              if (p4osname == 'LINUX') && (gcc == 'yes')
         | 
| 178 | 
            +
                $CXXFLAGS += " -std=c++11 "
         | 
| 179 | 
            +
              end
         | 
| 180 | 
            +
            end
         | 
| 181 | 
            +
             | 
| 182 | 
            +
             | 
| 158 183 | 
             
            def set_platform_cppflags
         | 
| 159 184 | 
             
              $CPPFLAGS += "-DOS_#{p4osname} "
         | 
| 160 185 | 
             
              $CPPFLAGS += "-DOS_#{p4osname}#{p4osver} "
         | 
| @@ -214,6 +239,7 @@ def set_platform_libs | |
| 214 239 | 
             
                    $LDFLAGS += ' -framework CoreFoundation -framework Foundation'
         | 
| 215 240 | 
             
                  end
         | 
| 216 241 | 
             
                when 'LINUX', 'MINGW32'
         | 
| 242 | 
            +
                  $LDFLAGS += ' -Wl,--allow-multiple-definition'
         | 
| 217 243 | 
             
                  have_library('supc++')
         | 
| 218 244 | 
             
              end
         | 
| 219 245 | 
             
            end
         | 
| @@ -445,13 +471,34 @@ def ftp_download_dir(version) | |
| 445 471 | 
             
            end
         | 
| 446 472 |  | 
| 447 473 | 
             
            def filename
         | 
| 474 | 
            +
              openssl_number = OpenSSL::OPENSSL_VERSION.split(' ')[1].to_s
         | 
| 475 | 
            +
              openssl_number = openssl_number.slice(0, (openssl_number.rindex('.')))
         | 
| 476 | 
            +
             | 
| 448 477 | 
             
              if RbConfig::CONFIG['target_os'].downcase =~ /nt|mswin|mingw/
         | 
| 449 | 
            -
                'p4api.zip'
         | 
| 478 | 
            +
                filename = 'p4api.zip'
         | 
| 479 | 
            +
                if !openssl_number.to_s.empty?
         | 
| 480 | 
            +
                    case openssl_number.to_s
         | 
| 481 | 
            +
                        when /1.1/
         | 
| 482 | 
            +
                            filename = 'p4api-openssl1.1.1.zip'
         | 
| 483 | 
            +
                        when /1.0/
         | 
| 484 | 
            +
                            filename = 'p4api-openssl1.0.2.zip'
         | 
| 485 | 
            +
                         end
         | 
| 486 | 
            +
                end
         | 
| 450 487 | 
             
              else
         | 
| 451 | 
            -
                'p4api.tgz'
         | 
| 488 | 
            +
                filename = 'p4api.tgz'
         | 
| 489 | 
            +
                if !openssl_number.to_s.empty?
         | 
| 490 | 
            +
                    case openssl_number.to_s
         | 
| 491 | 
            +
                        when /1.1/
         | 
| 492 | 
            +
                            filename = 'p4api-glibc2.3-openssl1.1.1.tgz'
         | 
| 493 | 
            +
                        when /1.0/
         | 
| 494 | 
            +
                            filename = 'p4api-glibc2.3-openssl1.0.2.tgz'
         | 
| 495 | 
            +
                    end
         | 
| 496 | 
            +
                end
         | 
| 452 497 | 
             
              end
         | 
| 498 | 
            +
              return filename
         | 
| 453 499 | 
             
            end
         | 
| 454 500 |  | 
| 501 | 
            +
             | 
| 455 502 | 
             
            def remote_files_matching(ftp, dir, regex)
         | 
| 456 503 | 
             
              ftp.ls(dir.to_s).map { |entry|
         | 
| 457 504 | 
             
                if match = entry.match(regex)
         | 
| @@ -499,9 +546,8 @@ def download_api_via_ftp | |
| 499 546 | 
             
              # At one point, we allowed the gem build to just find the most recent p4api build.
         | 
| 500 547 | 
             
              # P4Ruby probably shouldn't do that by default.
         | 
| 501 548 | 
             
              #version_dir = find_latest_version_dir(ftp)
         | 
| 502 | 
            -
              version_dir = P4API_VERSION_DIR
         | 
| 503 549 |  | 
| 504 | 
            -
              dir = ftp_download_dir( | 
| 550 | 
            +
              dir = ftp_download_dir(p4api_version_dir)
         | 
| 505 551 | 
             
              ftp.chdir(dir)
         | 
| 506 552 |  | 
| 507 553 | 
             
              puts "downloading #{filename} from #{dir} on ftp.perforce.com"
         | 
| @@ -536,9 +582,11 @@ set_platform_opts | |
| 536 582 | 
             
            # based solely on platform detection.
         | 
| 537 583 | 
             
            set_platform_cppflags
         | 
| 538 584 | 
             
            set_platform_cflags
         | 
| 585 | 
            +
            set_platform_cxxflags
         | 
| 539 586 |  | 
| 540 587 | 
             
            puts "$CPPFLAGS #{$CPPFLAGS}"
         | 
| 541 588 | 
             
            puts "$CFLAGS #{$CFLAGS}"
         | 
| 589 | 
            +
            puts "$CXXFLAGS #{$CXXFLAGS}"
         | 
| 542 590 |  | 
| 543 591 | 
             
            # Setup additional system library definitions based on platform type before
         | 
| 544 592 | 
             
            # we setup other libraries, in order to preserve linking order
         | 
| @@ -554,15 +602,17 @@ resolve_ssl_dirs | |
| 554 602 | 
             
            # If we happen to need SSL on Windows, we also need gdi32
         | 
| 555 603 | 
             
            if RbConfig::CONFIG['target_os'].downcase =~ /mingw/
         | 
| 556 604 | 
             
              have_library('gdi32') or raise
         | 
| 605 | 
            +
              have_library('ole32') or raise
         | 
| 606 | 
            +
              have_library('crypt32') or raise
         | 
| 557 607 | 
             
            end
         | 
| 558 608 |  | 
| 559 | 
            -
             | 
| 560 | 
            -
             | 
| 561 | 
            -
            unless do_ssl
         | 
| 562 | 
            -
              have_library('p4sslstub') or raise
         | 
| 563 | 
            -
            end
         | 
| 564 | 
            -
             | 
| 609 | 
            +
            have_library('crypto') or raise
         | 
| 610 | 
            +
            have_library('ssl') or raise
         | 
| 565 611 | 
             
            have_library('supp') or raise
         | 
| 612 | 
            +
            have_library('p4script_sqlite') or raise
         | 
| 613 | 
            +
            have_library('p4script_curl') or raise
         | 
| 614 | 
            +
            have_library('p4script') or raise
         | 
| 615 | 
            +
            have_library('p4script_c') or raise
         | 
| 566 616 | 
             
            have_library('rpc') or raise
         | 
| 567 617 | 
             
            have_library('client') or raise
         | 
| 568 618 |  | 
| @@ -577,4 +627,4 @@ create_p4rubyconf_header(version_info, $libs) | |
| 577 627 | 
             
            # don't believe we need to rely on actually.
         | 
| 578 628 | 
             
            create_header
         | 
| 579 629 |  | 
| 580 | 
            -
            create_makefile('P4')
         | 
| 630 | 
            +
            create_makefile('P4')
         | 
    
        data/ext/P4/p4.cpp
    CHANGED
    
    | @@ -489,6 +489,21 @@ static VALUE p4_set_ticket_file( VALUE self, VALUE path ) | |
| 489 489 | 
             
                return Qtrue;
         | 
| 490 490 | 
             
            }
         | 
| 491 491 |  | 
| 492 | 
            +
            static VALUE p4_get_trust_file( VALUE self )
         | 
| 493 | 
            +
            {
         | 
| 494 | 
            +
                P4ClientApi *p4;
         | 
| 495 | 
            +
                Data_Get_Struct( self, P4ClientApi, p4 );
         | 
| 496 | 
            +
                return P4Utils::ruby_string( p4->GetTrustFile().Text() );
         | 
| 497 | 
            +
            }
         | 
| 498 | 
            +
             | 
| 499 | 
            +
            static VALUE p4_set_trust_file( VALUE self, VALUE path )
         | 
| 500 | 
            +
            {
         | 
| 501 | 
            +
                P4ClientApi *p4;
         | 
| 502 | 
            +
                Data_Get_Struct( self, P4ClientApi, p4 );
         | 
| 503 | 
            +
                p4->SetTrustFile( StringValuePtr( path ) );
         | 
| 504 | 
            +
                return Qtrue;
         | 
| 505 | 
            +
            }
         | 
| 506 | 
            +
             | 
| 492 507 | 
             
            static VALUE p4_get_user( VALUE self )
         | 
| 493 508 | 
             
            {
         | 
| 494 509 | 
             
                P4ClientApi	*p4;
         | 
| @@ -1181,6 +1196,14 @@ static VALUE p4msg_get_text( VALUE self ) | |
| 1181 1196 | 
             
                return e->GetText();
         | 
| 1182 1197 | 
             
            }
         | 
| 1183 1198 |  | 
| 1199 | 
            +
            static VALUE p4msg_get_dict( VALUE self )
         | 
| 1200 | 
            +
            {
         | 
| 1201 | 
            +
                P4Error *   e = 0;
         | 
| 1202 | 
            +
             | 
| 1203 | 
            +
                Data_Get_Struct( self, P4Error, e );
         | 
| 1204 | 
            +
                return e->GetDict();
         | 
| 1205 | 
            +
            }
         | 
| 1206 | 
            +
             | 
| 1184 1207 | 
             
            static VALUE p4msg_get_id( VALUE self )
         | 
| 1185 1208 | 
             
            {
         | 
| 1186 1209 | 
             
                P4Error *	e = 0;
         | 
| @@ -1256,6 +1279,8 @@ void	Init_P4() | |
| 1256 1279 | 
             
                rb_define_method( cP4, "protocol", 	RUBY_METHOD_FUNC(p4_set_protocol), 2 );
         | 
| 1257 1280 | 
             
                rb_define_method( cP4, "ticket_file", RUBY_METHOD_FUNC(p4_get_ticket_file), 0 );
         | 
| 1258 1281 | 
             
                rb_define_method( cP4, "ticket_file=", RUBY_METHOD_FUNC(p4_set_ticket_file), 1 );
         | 
| 1282 | 
            +
                rb_define_method( cP4, "trust_file", RUBY_METHOD_FUNC(p4_get_trust_file), 0 );
         | 
| 1283 | 
            +
                rb_define_method( cP4, "trust_file=", RUBY_METHOD_FUNC(p4_set_trust_file), 1 );
         | 
| 1259 1284 | 
             
                rb_define_method( cP4, "user", 	RUBY_METHOD_FUNC(p4_get_user)    , 0 );
         | 
| 1260 1285 | 
             
                rb_define_method( cP4, "user=", 	RUBY_METHOD_FUNC(p4_set_user)    , 1 );
         | 
| 1261 1286 | 
             
                rb_define_method( cP4, "version", 	RUBY_METHOD_FUNC(p4_get_version) , 0 );
         | 
| @@ -1355,6 +1380,7 @@ void	Init_P4() | |
| 1355 1380 | 
             
                rb_define_method( cP4Msg, "msgid", RUBY_METHOD_FUNC(p4msg_get_id), 0);
         | 
| 1356 1381 | 
             
                rb_define_method( cP4Msg, "severity", RUBY_METHOD_FUNC(p4msg_get_severity), 0);
         | 
| 1357 1382 | 
             
                rb_define_method( cP4Msg, "generic", RUBY_METHOD_FUNC(p4msg_get_generic), 0);
         | 
| 1383 | 
            +
                rb_define_method( cP4Msg, "dictionary", RUBY_METHOD_FUNC(p4msg_get_dict), 0);
         | 
| 1358 1384 | 
             
                rb_define_method( cP4Msg, "to_s", RUBY_METHOD_FUNC(p4msg_get_text), 0);
         | 
| 1359 1385 |  | 
| 1360 1386 | 
             
                //	P4::Progress class.
         | 
    
        data/ext/P4/p4clientapi.cpp
    CHANGED
    
    | @@ -92,9 +92,19 @@ P4ClientApi::P4ClientApi() : ui( &specMgr ) | |
| 92 92 | 
             
                const char *t;
         | 
| 93 93 |  | 
| 94 94 | 
             
                henv.GetTicketFile( ticketFile );
         | 
| 95 | 
            -
             | 
| 95 | 
            +
             | 
| 96 | 
            +
                if( (t = enviro->Get("P4TICKETS")) )
         | 
| 97 | 
            +
            	   ticketFile = t;
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                //
         | 
| 100 | 
            +
                // Load the current trust file. Start with the default, and then
         | 
| 101 | 
            +
                // override it if P4TRUST is set.
         | 
| 102 | 
            +
                //
         | 
| 103 | 
            +
             | 
| 104 | 
            +
                henv.GetTrustFile( trustFile );
         | 
| 105 | 
            +
             | 
| 96 106 | 
             
                if( (t = enviro->Get("P4TICKETS")) )
         | 
| 97 | 
            -
             | 
| 107 | 
            +
                    trustFile = t;
         | 
| 98 108 |  | 
| 99 109 | 
             
                //
         | 
| 100 110 | 
             
                // Load the current P4CHARSET if set.
         | 
| @@ -132,7 +142,7 @@ P4ClientApi::GetEnviroFile() | |
| 132 142 | 
             
                return enviro->GetEnviroFile();
         | 
| 133 143 | 
             
            }
         | 
| 134 144 |  | 
| 135 | 
            -
            void | 
| 145 | 
            +
            void
         | 
| 136 146 | 
             
            P4ClientApi::SetApiLevel( int level )
         | 
| 137 147 | 
             
            {
         | 
| 138 148 | 
             
                StrBuf	b;
         | 
| @@ -192,7 +202,14 @@ P4ClientApi::SetTicketFile( const char *p ) | |
| 192 202 | 
             
                ticketFile = p;
         | 
| 193 203 | 
             
            }
         | 
| 194 204 |  | 
| 195 | 
            -
            void | 
| 205 | 
            +
            void
         | 
| 206 | 
            +
            P4ClientApi::SetTrustFile( const char *p )
         | 
| 207 | 
            +
            {
         | 
| 208 | 
            +
                client.SetTrustFile( p );
         | 
| 209 | 
            +
                trustFile = p;
         | 
| 210 | 
            +
            }
         | 
| 211 | 
            +
             | 
| 212 | 
            +
            void
         | 
| 196 213 | 
             
            P4ClientApi::SetDebug( int d )
         | 
| 197 214 | 
             
            {
         | 
| 198 215 | 
             
                debug = d;
         | 
| @@ -241,7 +258,7 @@ P4ClientApi::SetEnv( const char *var, const char *val ) | |
| 241 258 | 
             
            // connect to the Perforce server.
         | 
| 242 259 | 
             
            //
         | 
| 243 260 |  | 
| 244 | 
            -
            VALUE | 
| 261 | 
            +
            VALUE
         | 
| 245 262 | 
             
            P4ClientApi::Connect()
         | 
| 246 263 | 
             
            {
         | 
| 247 264 | 
             
                if ( P4RDB_COMMANDS )
         | 
| @@ -288,7 +305,7 @@ P4ClientApi::ConnectOrReconnect() | |
| 288 305 | 
             
            //
         | 
| 289 306 | 
             
            // Disconnect session
         | 
| 290 307 | 
             
            //
         | 
| 291 | 
            -
            VALUE | 
| 308 | 
            +
            VALUE
         | 
| 292 309 | 
             
            P4ClientApi::Disconnect()
         | 
| 293 310 | 
             
            {
         | 
| 294 311 | 
             
                if ( P4RDB_COMMANDS )
         | 
| @@ -306,6 +323,9 @@ P4ClientApi::Disconnect() | |
| 306 323 | 
             
                // Clear the specdef cache.
         | 
| 307 324 | 
             
                specMgr.Reset();
         | 
| 308 325 |  | 
| 326 | 
            +
                // Clear out any results from the last command
         | 
| 327 | 
            +
                ui.Reset();
         | 
| 328 | 
            +
             | 
| 309 329 | 
             
                return Qtrue;
         | 
| 310 330 | 
             
            }
         | 
| 311 331 |  | 
| @@ -322,7 +342,7 @@ P4ClientApi::Connected() | |
| 322 342 | 
             
                return Qfalse;
         | 
| 323 343 | 
             
            }
         | 
| 324 344 |  | 
| 325 | 
            -
            void | 
| 345 | 
            +
            void
         | 
| 326 346 | 
             
            P4ClientApi::Tagged( int enable )
         | 
| 327 347 | 
             
            {
         | 
| 328 348 | 
             
                if( enable )
         | 
| @@ -418,7 +438,7 @@ P4ClientApi::IsIgnored( const char *path ) | |
| 418 438 | 
             
            // is raised.
         | 
| 419 439 | 
             
            //
         | 
| 420 440 |  | 
| 421 | 
            -
            VALUE | 
| 441 | 
            +
            VALUE
         | 
| 422 442 | 
             
            P4ClientApi::Run( const char *cmd, int argc, char * const *argv )
         | 
| 423 443 | 
             
            {
         | 
| 424 444 | 
             
                // Save the entire command string for our error messages. Makes it
         | 
| @@ -523,7 +543,7 @@ P4ClientApi::RunCmd( const char *cmd, ClientUser *ui, int argc, char * const *ar | |
| 523 543 |  | 
| 524 544 | 
             
            //
         | 
| 525 545 | 
             
            // Parses a string supplied by the user into a hash. To do this we need
         | 
| 526 | 
            -
            // the specstring from the server. We try to cache those as we see them, | 
| 546 | 
            +
            // the specstring from the server. We try to cache those as we see them,
         | 
| 527 547 | 
             
            // but the user may not have executed any commands to allow us to cache
         | 
| 528 548 | 
             
            // them so we may have to fetch the spec first.
         | 
| 529 549 | 
             
            //
         | 
| @@ -551,7 +571,7 @@ P4ClientApi::ParseSpec( const char * type, const char *form ) | |
| 551 571 | 
             
                Error e;
         | 
| 552 572 | 
             
                VALUE v;
         | 
| 553 573 | 
             
                v = specMgr.StringToSpec( type, form, &e );
         | 
| 554 | 
            -
             | 
| 574 | 
            +
             | 
| 555 575 | 
             
                if ( e.Test() )
         | 
| 556 576 | 
             
                {
         | 
| 557 577 | 
             
            	if( exceptionLevel )
         | 
| @@ -562,7 +582,7 @@ P4ClientApi::ParseSpec( const char * type, const char *form ) | |
| 562 582 |  | 
| 563 583 | 
             
                return v;
         | 
| 564 584 | 
             
            }
         | 
| 565 | 
            -
             | 
| 585 | 
            +
             | 
| 566 586 |  | 
| 567 587 | 
             
            //
         | 
| 568 588 | 
             
            // Converts a hash supplied by the user into a string using the specstring
         | 
| @@ -588,14 +608,14 @@ P4ClientApi::FormatSpec( const char * type, VALUE hash ) | |
| 588 608 | 
             
            	}
         | 
| 589 609 | 
             
                }
         | 
| 590 610 |  | 
| 591 | 
            -
                // Got a specdef so now we can attempt to convert. | 
| 611 | 
            +
                // Got a specdef so now we can attempt to convert.
         | 
| 592 612 | 
             
                StrBuf	buf;
         | 
| 593 613 | 
             
                Error	e;
         | 
| 594 614 |  | 
| 595 615 | 
             
                specMgr.SpecToString( type, hash, buf, &e );
         | 
| 596 616 | 
             
                if( !e.Test() )
         | 
| 597 617 | 
             
            	return P4Utils::ruby_string( buf.Text() );
         | 
| 598 | 
            -
             | 
| 618 | 
            +
             | 
| 599 619 | 
             
                if( exceptionLevel )
         | 
| 600 620 | 
             
                {
         | 
| 601 621 | 
             
            	StrBuf m;
         | 
| @@ -631,7 +651,7 @@ P4ClientApi::SpecFields( const char * type ) | |
| 631 651 |  | 
| 632 652 | 
             
                return specMgr.SpecFields( type );
         | 
| 633 653 | 
             
            }
         | 
| 634 | 
            -
             | 
| 654 | 
            +
             | 
| 635 655 | 
             
            //
         | 
| 636 656 | 
             
            // Raises an exception or returns Qfalse on bad input
         | 
| 637 657 | 
             
            //
         | 
| @@ -697,13 +717,13 @@ P4ClientApi::Except( const char *func, const char *msg ) | |
| 697 717 | 
             
                StrBuf	errors;
         | 
| 698 718 | 
             
                StrBuf	warnings;
         | 
| 699 719 | 
             
                int		terminate = 0;
         | 
| 700 | 
            -
             | 
| 720 | 
            +
             | 
| 701 721 | 
             
                m << "[" << func << "] " << msg;
         | 
| 702 722 |  | 
| 703 723 | 
             
                // Now append any errors and warnings to the text
         | 
| 704 724 | 
             
                ui.GetResults().FmtErrors( errors );
         | 
| 705 725 | 
             
                ui.GetResults().FmtWarnings( warnings );
         | 
| 706 | 
            -
             | 
| 726 | 
            +
             | 
| 707 727 | 
             
                if( errors.Length() )
         | 
| 708 728 | 
             
                {
         | 
| 709 729 | 
             
            	m << "\n" << errors;
         | 
| @@ -740,4 +760,3 @@ P4ClientApi::Except( const char *func, Error *e ) | |
| 740 760 | 
             
                e->Fmt( &m );
         | 
| 741 761 | 
             
                Except( func, m.Text() );
         | 
| 742 762 | 
             
            }
         | 
| 743 | 
            -
             | 
    
        data/ext/P4/p4clientapi.h
    CHANGED
    
    | @@ -85,6 +85,7 @@ public: | |
| 85 85 | 
             
                void SetProg( const char *p )	{ prog = p;			}
         | 
| 86 86 | 
             
                void SetProtocol( const char *var, const char *val );
         | 
| 87 87 | 
             
                void SetTicketFile( const char *p );
         | 
| 88 | 
            +
                void SetTrustFile( const char *p );
         | 
| 88 89 | 
             
                void SetUser( const char *u )	{ client.SetUser( u );		}
         | 
| 89 90 | 
             
                void SetVersion( const char *v )	{ version = v;			}
         | 
| 90 91 |  | 
| @@ -102,6 +103,7 @@ public: | |
| 102 103 | 
             
                const StrPtr &GetPort()		{ return client.GetPort();	}
         | 
| 103 104 | 
             
                const StrPtr &GetProg()		{ return prog;			}
         | 
| 104 105 | 
             
                const StrPtr &GetTicketFile()	{ return ticketFile;		}
         | 
| 106 | 
            +
                const StrPtr &GetTrustFile()   { return trustFile;        }
         | 
| 105 107 | 
             
                const StrPtr &GetUser()		{ return client.GetUser();	}
         | 
| 106 108 | 
             
                const StrPtr &GetVersion()		{ return version;		}
         | 
| 107 109 |  | 
| @@ -234,6 +236,7 @@ private: | |
| 234 236 | 
             
                StrBuf		prog;
         | 
| 235 237 | 
             
                StrBuf		version;
         | 
| 236 238 | 
             
                StrBuf		ticketFile;
         | 
| 239 | 
            +
                StrBuf      trustFile;
         | 
| 237 240 | 
             
                int			depth;
         | 
| 238 241 | 
             
                int			debug;
         | 
| 239 242 | 
             
                int			exceptionLevel;
         | 
| @@ -244,4 +247,3 @@ private: | |
| 244 247 | 
             
                int			maxScanRows;
         | 
| 245 248 | 
             
                int			maxLockTime;
         | 
| 246 249 | 
             
            };
         | 
| 247 | 
            -
             | 
    
        data/ext/P4/p4error.cpp
    CHANGED
    
    | @@ -88,6 +88,21 @@ P4Error::GetText() | |
| 88 88 | 
             
                return P4Utils::ruby_string( t.Text(), t.Length() );
         | 
| 89 89 | 
             
            }
         | 
| 90 90 |  | 
| 91 | 
            +
            VALUE
         | 
| 92 | 
            +
            P4Error::GetDict()
         | 
| 93 | 
            +
            {
         | 
| 94 | 
            +
                VALUE dictHash = rb_hash_new();
         | 
| 95 | 
            +
                StrDict* pDict = error.GetDict();
         | 
| 96 | 
            +
                StrRef key, val;
         | 
| 97 | 
            +
                // suppress -Wpointer-arith
         | 
| 98 | 
            +
                for (int i=0;pDict->GetVar(i,key,val) != 0;i++) {
         | 
| 99 | 
            +
                  rb_hash_aset( dictHash,
         | 
| 100 | 
            +
                    P4Utils::ruby_string(key.Text(), key.Length()),
         | 
| 101 | 
            +
                    P4Utils::ruby_string(val.Text(), val.Length()));
         | 
| 102 | 
            +
                }
         | 
| 103 | 
            +
                return dictHash;
         | 
| 104 | 
            +
            }
         | 
| 105 | 
            +
             | 
| 91 106 | 
             
            VALUE
         | 
| 92 107 | 
             
            P4Error::Inspect()
         | 
| 93 108 | 
             
            {
         | 
    
        data/ext/P4/p4error.h
    CHANGED
    
    
    
        data/ext/P4/p4result.cpp
    CHANGED
    
    
    
        data/ext/P4/specmgr.cpp
    CHANGED
    
    | @@ -63,21 +63,6 @@ struct defaultspec { | |
| 63 63 | 
             
                        "unlocked/locked;;"
         | 
| 64 64 | 
             
                    "View;code:311;type:wlist;words:2;len:64;;"
         | 
| 65 65 | 
             
                },
         | 
| 66 | 
            -
                {
         | 
| 67 | 
            -
                    "changeX",
         | 
| 68 | 
            -
                    "Change;code:201;rq;ro;fmt:L;seq:1;len:10;;"
         | 
| 69 | 
            -
                    "Date;code:202;type:date;ro;fmt:R;seq:3;len:20;;"
         | 
| 70 | 
            -
                    "Client;code:203;ro;fmt:L;seq:2;len:32;;"
         | 
| 71 | 
            -
                    "User;code:204;ro;fmt:L;seq:4;len:32;;"
         | 
| 72 | 
            -
                    "Status;code:205;ro;fmt:R;seq:5;len:10;;"
         | 
| 73 | 
            -
                    "Type;code:211;seq:6;type:select;fmt:L;len:10;"
         | 
| 74 | 
            -
                        "val:public/restricted;;"
         | 
| 75 | 
            -
                    "ImportedBy;code:212;type:line;ro;fmt:L;len:32;;"
         | 
| 76 | 
            -
                    "Identity;code:213;type:line;;"
         | 
| 77 | 
            -
                    "Description;code:206;type:text;rq;;"
         | 
| 78 | 
            -
                    "Jobs;code:209;type:wlist;words:2;len:32;;"
         | 
| 79 | 
            -
                    "Files;code:210;type:llist;len:64;;"
         | 
| 80 | 
            -
                },
         | 
| 81 66 | 
             
                {
         | 
| 82 67 | 
             
                    "change",
         | 
| 83 68 | 
             
                    "Change;code:201;rq;ro;fmt:L;seq:1;len:10;;"
         | 
| @@ -92,6 +77,7 @@ struct defaultspec { | |
| 92 77 | 
             
                    "Description;code:206;type:text;rq;seq:7;;"
         | 
| 93 78 | 
             
                    "JobStatus;code:207;fmt:I;type:select;seq:9;;"
         | 
| 94 79 | 
             
                    "Jobs;code:208;type:wlist;seq:8;len:32;;"
         | 
| 80 | 
            +
                    "Stream;code:214;type:line;len:64;;"
         | 
| 95 81 | 
             
                    "Files;code:210;type:llist;len:64;;"
         | 
| 96 82 | 
             
                },
         | 
| 97 83 | 
             
                {
         | 
| @@ -115,47 +101,12 @@ struct defaultspec { | |
| 115 101 | 
             
                    "Stream;code:314;type:line;len:64;;"
         | 
| 116 102 | 
             
                    "StreamAtChange;code:316;type:line;len:64;;"
         | 
| 117 103 | 
             
                    "ServerID;code:315;type:line;ro;len:64;;"
         | 
| 118 | 
            -
                    "Type;code:318;type:select;len:10;val: | 
| 104 | 
            +
                    "Type;code:318;type:select;len:10;val:"
         | 
| 105 | 
            +
                        "writeable/readonly/graph/partitioned;;"
         | 
| 119 106 | 
             
                    "Backup;code:319;type:select;len:10;val:enable/disable;;"
         | 
| 120 107 | 
             
                    "View;code:311;type:wlist;words:2;len:64;;"
         | 
| 121 108 | 
             
                    "ChangeView;code:317;type:llist;len:64;;"
         | 
| 122 109 | 
             
                },
         | 
| 123 | 
            -
                {
         | 
| 124 | 
            -
                    "clientX",
         | 
| 125 | 
            -
                    "Client;code:301;rq;ro;seq:1;len:32;;"
         | 
| 126 | 
            -
                    "Update;code:302;type:date;ro;seq:2;fmt:L;len:20;;"
         | 
| 127 | 
            -
                    "Access;code:303;type:date;ro;seq:4;fmt:L;len:20;;"
         | 
| 128 | 
            -
                    "Owner;code:304;seq:3;fmt:R;len:32;;"
         | 
| 129 | 
            -
                    "Host;code:305;seq:5;fmt:R;len:32;;"
         | 
| 130 | 
            -
                    "Description;code:306;type:text;len:128;;"
         | 
| 131 | 
            -
                    "Root;code:307;rq;type:line;len:64;;"
         | 
| 132 | 
            -
                    "AltRoots;code:308;type:llist;len:64;;"
         | 
| 133 | 
            -
                    "Options;code:309;type:line;len:64;val:"
         | 
| 134 | 
            -
                        "noallwrite/allwrite,noclobber/clobber,nocompress/compress,"
         | 
| 135 | 
            -
                        "unlocked/locked,nomodtime/modtime,normdir/rmdir;;"
         | 
| 136 | 
            -
                    "SubmitOptions;code:313;type:select;fmt:L;len:25;val:"
         | 
| 137 | 
            -
                        "submitunchanged/submitunchanged+reopen/revertunchanged/"
         | 
| 138 | 
            -
                        "revertunchanged+reopen/leaveunchanged/leaveunchanged+reopen;;"
         | 
| 139 | 
            -
                    "LineEnd;code:310;type:select;fmt:L;len:12;val:"
         | 
| 140 | 
            -
                        "local/unix/mac/win/share;;"
         | 
| 141 | 
            -
                    "View;code:311;type:wlist;words:2;len:64;;"
         | 
| 142 | 
            -
                },
         | 
| 143 | 
            -
                {
         | 
| 144 | 
            -
                    "clientSpecing021",
         | 
| 145 | 
            -
                    "Client;code:301;rq;ro;len:32;;"
         | 
| 146 | 
            -
                    "Update;code:302;type:date;ro;len:20;;"
         | 
| 147 | 
            -
                    "Access;code:303;type:date;ro;len:20;;"
         | 
| 148 | 
            -
                    "Owner;code:304;len:32;;"
         | 
| 149 | 
            -
                    "Host;code:305;len:32;;"
         | 
| 150 | 
            -
                    "Description;code:306;type:text;len:128;;"
         | 
| 151 | 
            -
                    "Root;code:307;rq;type:line;len:64;;"
         | 
| 152 | 
            -
                    "AltRoots;code:308;type:text;len:64;;"
         | 
| 153 | 
            -
                    "Options;code:309;type:line;len:64;val:"
         | 
| 154 | 
            -
                        "noallwrite/allwrite,noclobber/clobber,nocompress/compress,"
         | 
| 155 | 
            -
                        "unlocked/locked,nomodtime/modtime,normdir/rmdir;;"
         | 
| 156 | 
            -
                    "LineEnd;code:310;type:select;len:12;val:local/unix/mac/win/share;;"
         | 
| 157 | 
            -
                    "View;code:311;type:wlist;words:2;len:64;;"
         | 
| 158 | 
            -
                },
         | 
| 159 110 | 
             
                {
         | 
| 160 111 | 
             
                    "depot",
         | 
| 161 112 | 
             
                    "Depot;code:251;rq;ro;len:32;;"
         | 
| @@ -175,11 +126,13 @@ struct defaultspec { | |
| 175 126 | 
             
                    "MaxResults;code:402;type:word;len:12;;"
         | 
| 176 127 | 
             
                    "MaxScanRows;code:403;type:word;len:12;;"
         | 
| 177 128 | 
             
                    "MaxLockTime;code:407;type:word;len:12;;"
         | 
| 129 | 
            +
            	"MaxOpenFiles;code:413;type:word;len:12;;"
         | 
| 178 130 | 
             
                    "Timeout;code:406;type:word;len:12;;"
         | 
| 179 131 | 
             
                    "PasswordTimeout;code:409;type:word;len:12;;"
         | 
| 180 132 | 
             
                    "LdapConfig;code:410;type:line;len:128;;"
         | 
| 181 133 | 
             
                    "LdapSearchQuery;code:411;type:line;len:128;;"
         | 
| 182 134 | 
             
                    "LdapUserAttribute;code:412;type:line;len:128;;"
         | 
| 135 | 
            +
            	"LdapUserDNAttribute;code:414;type:line;len:128;;"
         | 
| 183 136 | 
             
                    "Subgroups;code:404;type:wlist;len:32;opt:default;;"
         | 
| 184 137 | 
             
                    "Owners;code:408;type:wlist;len:32;opt:default;;"
         | 
| 185 138 | 
             
                    "Users;code:405;type:wlist;len:32;opt:default;;"
         | 
| @@ -247,36 +200,62 @@ struct defaultspec { | |
| 247 200 | 
             
                    "Clients;code:458;len:8;;"
         | 
| 248 201 | 
             
                    "Users;code:459;len:8;;"
         | 
| 249 202 | 
             
                    "Files;code:460;len:8;;"
         | 
| 203 | 
            +
            	"Repos;code:462;len:8;;"
         | 
| 250 204 | 
             
                },
         | 
| 251 205 | 
             
                {
         | 
| 252 206 | 
             
                    "protect",
         | 
| 253 | 
            -
             | 
| 207 | 
            +
            	"SubPath;code:502;ro;len:64;;"
         | 
| 208 | 
            +
            	"Update;code:503;type:date;ro;fmt:L;len:20;;"
         | 
| 209 | 
            +
                    "Protections;code:501;fmt:C;type:wlist;words:5;opt:default;z;len:64;;"
         | 
| 254 210 | 
             
                },
         | 
| 255 211 | 
             
                {
         | 
| 256 212 | 
             
                    "remote",
         | 
| 257 | 
            -
                    "RemoteID;code:851;rq;ro;len:32;;"
         | 
| 213 | 
            +
                    "RemoteID;code:851;rq;ro;fmt:L;len:32;;"
         | 
| 258 214 | 
             
                    "Address;code:852;rq;type:line;len:32;;"
         | 
| 259 215 | 
             
                    "Owner;code:853;fmt:R;len:32;;"
         | 
| 260 216 | 
             
                    "RemoteUser;code:861;fmt:R;len:32;;"
         | 
| 261 217 | 
             
                    "Options;code:854;type:line;len:32;val:"
         | 
| 262 | 
            -
                        "unlocked/ | 
| 218 | 
            +
                        "unlocked/locked,nocompress/compress,copyrcs/nocopyrcs;;"
         | 
| 263 219 | 
             
                    "Update;code:855;type:date;ro;fmt:L;len:20;;"
         | 
| 264 220 | 
             
                    "Access;code:856;type:date;ro;fmt:L;len:20;;"
         | 
| 265 221 | 
             
                    "Description;code:857;type:text;len:128;;"
         | 
| 266 222 | 
             
                    "LastFetch;code:858;fmt:L;len:10;;"
         | 
| 267 223 | 
             
                    "LastPush;code:859;fmt:L;len:10;;"
         | 
| 268 224 | 
             
                    "DepotMap;code:860;type:wlist;words:2;len:64;;"
         | 
| 225 | 
            +
                    "ArchiveLimits;code:862;type:wlist;words:2;len:64;;"
         | 
| 269 226 | 
             
                },
         | 
| 270 227 | 
             
                {
         | 
| 271 | 
            -
                    " | 
| 272 | 
            -
             | 
| 273 | 
            -
             | 
| 274 | 
            -
             | 
| 275 | 
            -
             | 
| 276 | 
            -
             | 
| 277 | 
            -
             | 
| 278 | 
            -
             | 
| 279 | 
            -
             | 
| 228 | 
            +
                    "repo",
         | 
| 229 | 
            +
            	"Repo;code:1001;rq;ro;len:128;;"
         | 
| 230 | 
            +
            	"Owner;code:1002;len:32;;"
         | 
| 231 | 
            +
            	"Created;code:1003;type:date;ro;fmt:L;len:20;;"
         | 
| 232 | 
            +
            	"Pushed;code:1004;type:date;ro;fmt:L;len:20;;"
         | 
| 233 | 
            +
            	"ForkedFrom;code:1005;ro;len:128;;"
         | 
| 234 | 
            +
            	"Description;code:1006;type:text;len:128;;"
         | 
| 235 | 
            +
            	"DefaultBranch;code:1007;len:32;;"
         | 
| 236 | 
            +
            	"MirroredFrom;code:1008;len:32;;"
         | 
| 237 | 
            +
            	"Options;code:1009;type:select;len:10;val:lfs/nolfs;;"
         | 
| 238 | 
            +
            	"GconnMirrorServerId;code:1010;len:32;;"
         | 
| 239 | 
            +
                },
         | 
| 240 | 
            +
                {
         | 
| 241 | 
            +
                    "server",
         | 
| 242 | 
            +
                    "ServerID;code:751;rq;ro;len:32;;"
         | 
| 243 | 
            +
            	"Type;code:752;rq;len:32;;"
         | 
| 244 | 
            +
            	"Name;code:753;type:line;len:32;;"
         | 
| 245 | 
            +
            	"Address;code:754;type:line;len:32;;"
         | 
| 246 | 
            +
            	"ExternalAddress;code:755;type:line;len:32;;"
         | 
| 247 | 
            +
            	"Services;code:756;rq;len:128;;"
         | 
| 248 | 
            +
            	"Options;code:764;type:line;len:32;val:"
         | 
| 249 | 
            +
            	    "nomandatory/mandatory;;"
         | 
| 250 | 
            +
            	"ReplicatingFrom;code:765;type:line;len:32;;"
         | 
| 251 | 
            +
            	"Description;code:757;type:text;len:128;;"
         | 
| 252 | 
            +
            	"User;code:761;type:line;len:64;;"
         | 
| 253 | 
            +
            	"AllowedAddresses;code:763;type:wlist;len:64;;"
         | 
| 254 | 
            +
            	"UpdateCachedRepos;code:766;type:wlist;len:64;;"
         | 
| 255 | 
            +
            	"ClientDataFilter;code:758;type:wlist;len:64;;"
         | 
| 256 | 
            +
            	"RevisionDataFilter;code:759;type:wlist;len:64;;"
         | 
| 257 | 
            +
            	"ArchiveDataFilter;code:760;type:wlist;len:64;;"
         | 
| 258 | 
            +
            	"DistributedConfig;code:762;type:text;len:128;;"
         | 
| 280 259 | 
             
                },
         | 
| 281 260 | 
             
                {
         | 
| 282 261 | 
             
                    "spec",
         | 
| @@ -293,28 +272,28 @@ struct defaultspec { | |
| 293 272 | 
             
                    "Stream;code:701;rq;ro;len:64;;"
         | 
| 294 273 | 
             
                    "Update;code:705;type:date;ro;fmt:L;len:20;;"
         | 
| 295 274 | 
             
                    "Access;code:706;type:date;ro;fmt:L;len:20;;"
         | 
| 296 | 
            -
                    "Owner;code:704;len:32;;"
         | 
| 297 | 
            -
                    "Name;code:703;rq;type:line;len:32;;"
         | 
| 275 | 
            +
                    "Owner;code:704;len:32;open:isolate;;"
         | 
| 276 | 
            +
                    "Name;code:703;rq;type:line;len:32;open:isolate;;"
         | 
| 298 277 | 
             
                    "Parent;code:702;rq;len:64;open:isolate;;"
         | 
| 299 278 | 
             
                    "Type;code:708;rq;len:32;open:isolate;;"
         | 
| 300 | 
            -
                    "Description;code:709;type:text;len:128;;"
         | 
| 279 | 
            +
                    "Description;code:709;type:text;len:128;open:isolate;;"
         | 
| 301 280 | 
             
                    "Options;code:707;type:line;len:64;val:"
         | 
| 302 281 | 
             
                        "allsubmit/ownersubmit,unlocked/locked,"
         | 
| 303 282 | 
             
                        "toparent/notoparent,fromparent/nofromparent,"
         | 
| 304 | 
            -
                        "mergedown/mergeany;;"
         | 
| 305 | 
            -
                    "Paths;code:710;rq;type:wlist;words:2;maxwords:3;len:64;open: | 
| 306 | 
            -
                    "Remapped;code:711;type:wlist;words:2;len:64;open: | 
| 307 | 
            -
                    "Ignored;code:712;type:wlist;words:1;len:64;open: | 
| 283 | 
            +
                        "mergedown/mergeany;open:isolate;;"
         | 
| 284 | 
            +
                    "Paths;code:710;rq;type:wlist;words:2;maxwords:3;len:64;open:propagate;;"
         | 
| 285 | 
            +
                    "Remapped;code:711;type:wlist;words:2;len:64;open:propagate;;"
         | 
| 286 | 
            +
                    "Ignored;code:712;type:wlist;words:1;len:64;open:propagate;;"
         | 
| 308 287 | 
             
                    "View;code:713;type:wlist;words:2;len:64;;"
         | 
| 309 288 | 
             
                    "ChangeView;code:714;type:llist;ro;len:64;;"
         | 
| 310 289 | 
             
                },
         | 
| 311 290 | 
             
                {
         | 
| 312 291 | 
             
                    "triggers",
         | 
| 313 | 
            -
                    "Triggers;code:551;type:wlist;words:4;len:64;opt:default;"
         | 
| 292 | 
            +
                    "Triggers;code:551;type:wlist;words:4;len:64;opt:default;z;;"
         | 
| 314 293 | 
             
                },
         | 
| 315 294 | 
             
                {
         | 
| 316 295 | 
             
                   "typemap",
         | 
| 317 | 
            -
                    "TypeMap;code:601;type:wlist;words:2;len:64;opt:default;"
         | 
| 296 | 
            +
                    "TypeMap;code:601;type:wlist;words:2;len:64;opt:default;z;;"
         | 
| 318 297 | 
             
                },
         | 
| 319 298 | 
             
                {
         | 
| 320 299 | 
             
                    "user",
         | 
| @@ -326,23 +305,10 @@ struct defaultspec { | |
| 326 305 | 
             
                    "FullName;code:655;fmt:R;type:line;rq;len:32;;"
         | 
| 327 306 | 
             
                    "JobView;code:656;type:line;len:64;;"
         | 
| 328 307 | 
             
                    "Password;code:657;len:32;;"
         | 
| 329 | 
            -
                    "AuthMethod;code:662;fmt:L;len:10;val: | 
| 308 | 
            +
                    "AuthMethod;code:662;fmt:L;len:10;val:"
         | 
| 309 | 
            +
                        "perforce/perforce+2fa/ldap/ldap+2fa;;"
         | 
| 330 310 | 
             
                    "Reviews;code:658;type:wlist;len:64;;"
         | 
| 331 311 | 
             
                },
         | 
| 332 | 
            -
                {
         | 
| 333 | 
            -
                    "server",
         | 
| 334 | 
            -
                    "ServerID;code:751;rq;ro;len:32;;"
         | 
| 335 | 
            -
                    "Type;code:752;rq;len:32;;"
         | 
| 336 | 
            -
                    "Name;code:753;type:line;len:32;;"
         | 
| 337 | 
            -
                    "Address;code:754;type:line;len:32;;"
         | 
| 338 | 
            -
                    "ExternalAddress;code:755;type:line;len:32;;"
         | 
| 339 | 
            -
                    "Services;code:756;rq;len:128;;"
         | 
| 340 | 
            -
                    "Description;code:757;type:text;len:128;;"
         | 
| 341 | 
            -
                    "User;code:761;type:line;len:64;;"
         | 
| 342 | 
            -
                    "ClientDataFilter;code:758;type:wlist;len:64;;"
         | 
| 343 | 
            -
                    "RevisionDataFilter;code:759;type:wlist;len:64;;"
         | 
| 344 | 
            -
                    "ArchiveDataFilter;code:760;type:wlist;len:64;;"
         | 
| 345 | 
            -
                },
         | 
| 346 312 | 
             
                { 0, 0 }
         | 
| 347 313 | 
             
            };
         | 
| 348 314 |  |