File: proto-gem-generate-source.patch

package info (click to toggle)
gitaly 16.11.6%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,623,976 kB
  • sloc: cpp: 33,732; java: 20,579; sh: 5,372; cs: 3,973; javascript: 3,426; python: 3,053; makefile: 2,316; ansic: 1,729; php: 1,455; asm: 1,217; xml: 838; ruby: 452; sql: 431; yacc: 22; sed: 1
file content (68 lines) | stat: -rw-r--r-- 2,408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Description: Remove git usage and do not build gem
  Upstream has updated the script to generate proto sources and it now
 generates and builds the gem in a temporary directory. This patch will
 make sure that source files are generated inplace and gem is not built.
 See https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4982
Author: Mohammed Bilal <mdbilal@disroot.org>
Forwarded: not-needed
Last-Update: 2024-02-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tools/protogem/build-proto-gem
+++ b/tools/protogem/build-proto-gem
@@ -57,18 +57,18 @@
 
     ref = capture!(%w[git rev-parse --short HEAD]).chomp
     version = "#{matches[1]}-#{ref}"
-  else
-    ref = capture!(%w[git describe --tag]).chomp
-    if ref != "v#{version}"
-      abort "Checkout tag v#{version} to publish.\n\t git checkout v#{version}"
-    end
+#  else
+#    ref = capture!(%w[git describe --tag]).chomp
+#    if ref != "v#{version}"
+#      abort "Checkout tag v#{version} to publish.\n\t git checkout v#{version}"
+#    end
   end
 
-  puts 'Testing for changed files'
-  run!(%w[git diff --quiet --exit-code])
+#  puts 'Testing for changed files'
+#  run!(%w[git diff --quiet --exit-code])
 
-  puts 'Testing for staged changes'
-  run!(%w[git diff --quiet --cached --exit-code])
+#  puts 'Testing for staged changes'
+#  run!(%w[git diff --quiet --cached --exit-code])
 
   if options[:working_dir]
     output_dir = File.absolute_path(options[:working_dir])
@@ -82,6 +82,7 @@
   end
 end
 
+
 def generate_sources(output_dir, version)
   proto_output_dir = File.absolute_path(File.join(output_dir, 'ruby', 'proto', 'gitaly'))
 
@@ -124,7 +125,7 @@
         "documentation_uri" => "https://gitlab-org.gitlab.io/gitaly",
       }
 
-      spec.files         = Dir['**/*.rb']
+      spec.files         = Dir.glob("ruby/proto/**/*")
       spec.require_paths = [prefix]
 
       spec.add_dependency "grpc", "~> 1.0"
@@ -134,8 +135,8 @@
   gemspec_path = File.absolute_path(File.join(output_dir, 'gitaly.gemspec'))
   open(gemspec_path, 'w') { |f| f.write(gemspec) }
 
-  run!(['gem', 'build', gemspec_path, '--output', output_path], output_dir)
-  abort "gem not found" unless File.exist?(output_path)
+#  run!(['gem', 'build', gemspec_path, '--output', output_path], output_dir)
+#  abort "gem not found" unless File.exist?(output_path)
 end
 
 def write_version_file(output_dir, version)