p4ruby 2022.1.2405581 → 2023.1.2446234

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29dbc8b35e55180912ead9fe35105f9074dca0168fa836ea55ec1e410ae15c31
4
- data.tar.gz: d0db67529a92e0758f0a3ff91fd3efde117818a3089776cd9b304996702b62a4
3
+ metadata.gz: a87aae6d511b90cf6cd088c8b6d3d412dea04eb512cad610109de79cc27900c0
4
+ data.tar.gz: 6c9e1736821a434331896232cbd3505fdbbdbbae9d1ad6ffee5dfdf4b178f324
5
5
  SHA512:
6
- metadata.gz: 9c15355e1b738d5313497e6f31a7138e2042c89e116cf294f3528924e4666f818363d6c49d5740ba50e069c2b198a524f90dcbabf6ca627ae963f3c4b23a7750
7
- data.tar.gz: 27a3f37752037e1616372bc822595d30c76ec41ee5f91d360acac42df8205f71f8c2f9ada5af7a96a2ecd5b9b66736ef96d78beb65422035588e27abd4430a34
6
+ metadata.gz: 6bbfe519147104faf73f2c152023eae1b33dfeaece629d3fd2fe5e6be6cd79589c0a3e8fdac5710298b5eab31f6e50e048d31149df94bb46a99406da09cc6f54
7
+ data.tar.gz: 2aa239c4d91a682570a7c77ea6874c09a29f09b513725e3f45eac4f94c005a76f00671482c3a12e0a96946dd22134e2da2170fc1fc4387c1e7fa524ef37ed99c
data/LICENSE.txt CHANGED
@@ -32,7 +32,7 @@ this program.
32
32
 
33
33
  P4/P4API License
34
34
  -----------------------
35
- Copyright (c) 1995-2022, Perforce Software, Inc.
35
+ Copyright (c) 1995-2023, Perforce Software, Inc.
36
36
  All rights reserved.
37
37
 
38
38
  Redistribution and use in source and binary forms, with or without
data/ext/P4/extconf.rb CHANGED
@@ -3,10 +3,10 @@
3
3
  $:.push File.expand_path("../../../lib", __FILE__)
4
4
 
5
5
  require 'mkmf'
6
- require 'net/ftp'
7
6
  require 'P4/version'
8
7
  require 'rbconfig'
9
8
  require 'openssl'
9
+ require 'net/http'
10
10
 
11
11
  # Set this to the main version directory we look up in ftp.perforce.com for the P4API
12
12
  # This is ignored if you specify the version on the command line.
@@ -266,9 +266,9 @@ class P4ApiVersion
266
266
  # subdirectory. Look there if we can't find it in the API root
267
267
  #
268
268
  ver_file = dir + "/Version"
269
- unless File.exists?(ver_file)
269
+ unless File.exist?(ver_file)
270
270
  ver_file = dir + "/sample/Version"
271
- return nil unless File.exists?(ver_file)
271
+ return nil unless File.exist?(ver_file)
272
272
  end
273
273
 
274
274
  re = Regexp.new('^RELEASE = (\d+)\s+(\d+)\s+(\w*\S*)\s*;')
@@ -390,7 +390,7 @@ def resolve_p4api_dir
390
390
  end
391
391
 
392
392
  if !p4api_dir && !with_config('p4api-dir') && enable_config('p4api-download', true)
393
- download_api_via_ftp
393
+ download_api_via_https
394
394
  unzip_file
395
395
  p4api_dir = downloaded_p4api_dir
396
396
  dir_config('p4api', "#{p4api_dir}/include", "#{p4api_dir}/lib")
@@ -468,7 +468,7 @@ def platform_dir_name
468
468
  "bin.#{p4_platform_label}"
469
469
  end
470
470
 
471
- def ftp_download_dir(version)
471
+ def download_dir(version)
472
472
  "perforce/#{version}/#{platform_dir_name}"
473
473
  end
474
474
 
@@ -484,7 +484,9 @@ def filename
484
484
  filename = 'p4api-openssl1.1.1.zip'
485
485
  when /1.0/
486
486
  filename = 'p4api-openssl1.0.2.zip'
487
- end
487
+ when /3.0/
488
+ filename = 'p4api-openssl3.zip'
489
+ end
488
490
  end
489
491
  elsif RbConfig::CONFIG['target_os'].downcase =~ /darwin19|darwin[2-9][0-9]/
490
492
  filename = 'p4api-openssl1.1.1.tgz'
@@ -496,69 +498,30 @@ def filename
496
498
  filename = 'p4api-glibc2.3-openssl1.1.1.tgz'
497
499
  when /1.0/
498
500
  filename = 'p4api-glibc2.3-openssl1.0.2.tgz'
501
+ when /3.0/
502
+ filename = 'p4api-glibc2.3-openssl3.tgz'
499
503
  end
500
504
  end
501
505
  end
502
506
  return filename
503
507
  end
504
508
 
505
-
506
- def remote_files_matching(ftp, dir, regex)
507
- ftp.ls(dir.to_s).map { |entry|
508
- if match = entry.match(regex)
509
- yield match
510
- else
511
- nil
512
- end
513
- }.reject { |entry|
514
- entry.nil?
515
- }
516
- end
517
-
518
- def find_latest_with_p4api(ftp, versions)
519
- versions.reverse_each { |v|
520
- begin
521
- remote_files_matching(ftp, "r#{v}/#{platform_dir_name}/", /p4api/) do
522
- return v
523
- end
524
- rescue
525
- next
526
- end
527
- }
528
- end
529
-
530
- def find_latest_version_dir(ftp)
531
- ftp.chdir('perforce')
532
-
533
- # Capture all versions
534
- versions = remote_files_matching(ftp, '.', /r(1\d\.\d)/) { |m| m.captures.first }.sort
535
-
536
- version = find_latest_with_p4api(ftp, versions)
537
-
538
- ftp.chdir('..')
539
-
540
- "r#{version}"
541
- end
542
-
543
- # Downloads the C++ P4API via FTP to the local directory, then 'initializes' it
509
+ #############################################
510
+ # Downloads the C++ P4API via HTTPS to the local directory, then 'initializes' it
544
511
  # by unpacking it.
545
- def download_api_via_ftp
546
- ftp = Net::FTP.new('ftp.perforce.com')
547
- ftp.passive=true
548
- ftp.login
549
-
550
- # At one point, we allowed the gem build to just find the most recent p4api build.
551
- # P4Ruby probably shouldn't do that by default.
552
- #version_dir = find_latest_version_dir(ftp)
512
+ def download_api_via_https
553
513
 
554
- dir = ftp_download_dir(p4api_version_dir)
555
- ftp.chdir(dir)
514
+ uri=URI('https://ftp.perforce.com:443')
515
+ dir = download_dir(p4api_version_dir)
556
516
 
557
- puts "downloading #{filename} from #{dir} on ftp.perforce.com"
558
- ftp.getbinaryfile(filename)
517
+ puts "Downloading #{filename} from #{dir} on https://ftp.perforce.com"
559
518
 
560
- ensure
561
- ftp.close if ftp and !ftp.closed?
519
+ Net::HTTP.start(uri.host, uri.port, :use_ssl =>true) do |http|
520
+ resp = http.get("/" + dir + "/" + filename)
521
+ open(filename, "wb") do |file|
522
+ file.write(resp.body)
523
+ end
524
+ end
562
525
  end
563
526
 
564
527
  def unzip_file
data/ext/P4/p4.cpp CHANGED
@@ -1502,6 +1502,11 @@ void Init_P4()
1502
1502
 
1503
1503
  // P4::Progress class.
1504
1504
  cP4Prog = rb_define_class_under( cP4, "Progress", rb_cObject );
1505
+
1506
+ rb_undef_alloc_func(cP4);
1507
+ rb_undef_alloc_func(cP4MD);
1508
+ rb_undef_alloc_func(cP4Map);
1509
+ rb_undef_alloc_func(cP4Msg);
1505
1510
 
1506
1511
  };
1507
1512
 
data/ext/P4/specmgr.cpp CHANGED
@@ -92,7 +92,8 @@ struct defaultspec {
92
92
  "AltRoots;code:308;type:llist;len:64;;"
93
93
  "Options;code:309;type:line;len:64;val:"
94
94
  "noallwrite/allwrite,noclobber/clobber,nocompress/compress,"
95
- "unlocked/locked,nomodtime/modtime,normdir/rmdir;;"
95
+ "unlocked/locked,nomodtime/modtime,normdir/rmdir,"
96
+ "noaltsync/altsync;;"
96
97
  "SubmitOptions;code:313;type:select;fmt:L;len:25;val:"
97
98
  "submitunchanged/submitunchanged+reopen/revertunchanged/"
98
99
  "revertunchanged+reopen/leaveunchanged/leaveunchanged+reopen;;"
@@ -128,6 +129,7 @@ struct defaultspec {
128
129
  "MaxScanRows;code:403;type:word;len:12;;"
129
130
  "MaxLockTime;code:407;type:word;len:12;;"
130
131
  "MaxOpenFiles;code:413;type:word;len:12;;"
132
+ "MaxMemory;code:NNN;type:word;len:12;;"
131
133
  "Timeout;code:406;type:word;len:12;;"
132
134
  "PasswordTimeout;code:409;type:word;len:12;;"
133
135
  "LdapConfig;code:410;type:line;len:128;;"
data/lib/P4/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class P4
2
- Version = VERSION = '2022.1.2405581'
2
+ Version = VERSION = '2023.1.2446234'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2022.1.2405581
4
+ version: 2023.1.2446234
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perforce Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-10 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby extensions to the C++ Perforce API.
14
14
  email: support@perforce.com