dtk-common 0.5.12 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/dtk-common/version.rb +1 -1
- data/lib/gitolite/grit/adapter.rb +1 -1
- data/lib/gitolite/grit/file_access.rb +14 -8
- data/lib/gitolite/manager.rb +21 -1
- data/lib/gitolite/repo.rb +10 -1
- data/lib/gitolite/utils.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWEwN2NmNjgzMDljMTg5NmY0NmRjMmVmZDUzYzU5NmYwOWFiMDlkZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjljN2ExMDlhNmM4NDM5ZjBiNDQ3OTdlZDMwZjZjMTc4N2M3ZDA2ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGE1YWM0ZGFiMGM4ZDAxZTdkYmJlMjlmYjJmZGNlZGVhMTgwMTA5Mzg5YzMz
|
10
|
+
NDhiZmUzYWYyZTgyZmU3M2RmMjQ3OWMwYzcyYmUxZGJmNzY1M2ExNDgxNmMw
|
11
|
+
ZWU4OGU4NDBlNzllNzJiNDdhYjY3NjNkNDcwMTE4NWM1NmRhZjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmFlNmFmZTQ0YzA3NmQ2OGIzYjdiYzg2NTE5MDg2MDM3NjNhMzI1MWMyN2Y1
|
14
|
+
Njg5Nzk3MTU5MWUzNjcxMDFiZGJhOWQ5NTBiNWIyMjljZjA0MmZiMGExMjk4
|
15
|
+
MjllNDJkOTliMWQwYjRlNDE5ZmIwMjA0Mjc0YTlmYmM5MmYyNWM=
|
data/lib/dtk-common/version.rb
CHANGED
@@ -2,6 +2,8 @@ module Gitolite
|
|
2
2
|
module Git
|
3
3
|
class FileAccess < Adapter
|
4
4
|
|
5
|
+
|
6
|
+
|
5
7
|
def add_file(file_rel_path,content)
|
6
8
|
content ||= String.new
|
7
9
|
file_path = qualified_path(file_rel_path)
|
@@ -33,15 +35,19 @@ module Gitolite
|
|
33
35
|
"#{@repo_dir}/#{file_rel_path}"
|
34
36
|
end
|
35
37
|
|
38
|
+
Change_dir_mutex = Mutex.new
|
39
|
+
|
36
40
|
def chdir_and_checkout(branch=nil,&block)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
Change_dir_mutex.synchronize do
|
42
|
+
branch ||= @branch
|
43
|
+
Dir.chdir(@repo_dir) do
|
44
|
+
current_head = @grit_repo.head.name
|
45
|
+
git_command(:checkout,branch) unless current_head == branch
|
46
|
+
return unless block
|
47
|
+
yield
|
48
|
+
unless current_head == branch
|
49
|
+
git_command(:checkout,current_head)
|
50
|
+
end
|
45
51
|
end
|
46
52
|
end
|
47
53
|
end
|
data/lib/gitolite/manager.rb
CHANGED
@@ -51,6 +51,10 @@ module Gitolite
|
|
51
51
|
key_path
|
52
52
|
end
|
53
53
|
|
54
|
+
def create_user_depracated(username, rsa_pub_key)
|
55
|
+
create_user(username, rsa_pub_key, 'default')
|
56
|
+
end
|
57
|
+
|
54
58
|
def delete_user(username)
|
55
59
|
key_path = @configuration.user_key_path(username)
|
56
60
|
|
@@ -87,6 +91,17 @@ module Gitolite
|
|
87
91
|
true
|
88
92
|
end
|
89
93
|
|
94
|
+
def rename_pub_key!(old_username, new_username, rsa_pub_key_name, rsa_pub_key_value)
|
95
|
+
file_name = "#{old_username}@#{rsa_pub_key_name}"
|
96
|
+
new_file_name = "#{new_username}@#{rsa_pub_key_name}"
|
97
|
+
|
98
|
+
key_path = @configuration.user_key_path(file_name)
|
99
|
+
new_key_path = @configuration.user_key_path(new_file_name)
|
100
|
+
|
101
|
+
remove_file(key_path, "Rename public key (#{rsa_pub_key_name}) from old user (#{old_username}) to new (#{new_username}) - REMOVE")
|
102
|
+
add_commit_file(new_key_path, rsa_pub_key_value, "Rename public key (#{rsa_pub_key_name}) from old user (#{old_username}) to new (#{new_username}) - ADD")
|
103
|
+
end
|
104
|
+
|
90
105
|
def delete_user_group!(group_name)
|
91
106
|
group_path = @configuration.user_group_path(group_name)
|
92
107
|
|
@@ -122,6 +137,7 @@ module Gitolite
|
|
122
137
|
end
|
123
138
|
|
124
139
|
# only to help with migration, to be deleted later TODO: Delete
|
140
|
+
# Depracated: To be removed
|
125
141
|
def migrate_to_multiple_pub_keys()
|
126
142
|
all_pub_keys = users_public_keys()
|
127
143
|
base_path = @configuration.keydir_path
|
@@ -137,7 +153,7 @@ module Gitolite
|
|
137
153
|
remove_file(pub_key_path, "Migrating user ('#{file_name}') to new annotation, temporary removing user")
|
138
154
|
|
139
155
|
# create user
|
140
|
-
|
156
|
+
create_user_depracated(file_name, pub_content)
|
141
157
|
end
|
142
158
|
end
|
143
159
|
puts "End migration of pub keys"
|
@@ -180,6 +196,10 @@ module Gitolite
|
|
180
196
|
@commit_messages << commit_msg
|
181
197
|
end
|
182
198
|
|
199
|
+
def file_content(file_path)
|
200
|
+
gitolite_admin_repo().file_content(file_path)
|
201
|
+
end
|
202
|
+
|
183
203
|
def extract_file_name(full_path_name, file_path, file_extension)
|
184
204
|
if full_path_name =~ Regexp.new("^#{file_path}/(.+)\.#{file_extension}")
|
185
205
|
$1
|
data/lib/gitolite/repo.rb
CHANGED
@@ -10,7 +10,6 @@ module Gitolite
|
|
10
10
|
|
11
11
|
GIOLITE_ALL_GROUP = '@all'
|
12
12
|
|
13
|
-
|
14
13
|
#
|
15
14
|
# We check if there are users in addition to tenant with line,
|
16
15
|
# (repo_conf.rights_hash.values.flatten.size > 1)
|
@@ -54,6 +53,16 @@ module Gitolite
|
|
54
53
|
end
|
55
54
|
end
|
56
55
|
|
56
|
+
def rights_for_username(username)
|
57
|
+
@rights_hash.each do |k,v|
|
58
|
+
if v.include?(username)
|
59
|
+
return k
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
return nil
|
64
|
+
end
|
65
|
+
|
57
66
|
def remove_username(username)
|
58
67
|
@rights_hash.each do |k,v|
|
59
68
|
if v.include?(username)
|
data/lib/gitolite/utils.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dtk-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rich PELAVIN
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|