Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f836ae22
Commit
f836ae22
authored
Jun 23, 2021
by
Mathieu Parent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Debian regexp to ::Packages::Debian
Changelog: changed
parent
8d33f75e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
app/models/packages/debian.rb
app/models/packages/debian.rb
+4
-0
lib/api/concerns/packages/debian_package_endpoints.rb
lib/api/concerns/packages/debian_package_endpoints.rb
+4
-7
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+3
-3
No files found.
app/models/packages/debian.rb
View file @
f836ae22
...
...
@@ -2,6 +2,10 @@
module
Packages
module
Debian
DISTRIBUTION_REGEX
=
%r{[a-z0-9][a-z0-9.-]*}i
.
freeze
COMPONENT_REGEX
=
DISTRIBUTION_REGEX
.
freeze
ARCHITECTURE_REGEX
=
%r{[a-z0-9][-a-z0-9]*}
.
freeze
def
self
.
table_name_prefix
'packages_debian_'
end
...
...
lib/api/concerns/packages/debian_package_endpoints.rb
View file @
f836ae22
...
...
@@ -6,20 +6,17 @@ module API
module
DebianPackageEndpoints
extend
ActiveSupport
::
Concern
DISTRIBUTION_REGEX
=
%r{[a-z0-9][a-z0-9.-]*}i
.
freeze
COMPONENT_REGEX
=
%r{[a-z0-9][a-z0-9.-]*}i
.
freeze
ARCHITECTURE_REGEX
=
%r{[a-z0-9][-a-z0-9]*}
.
freeze
LETTER_REGEX
=
%r{(lib)?[a-z0-9]}
.
freeze
PACKAGE_REGEX
=
API
::
NO_SLASH_URL_PART_REGEX
DISTRIBUTION_REQUIREMENTS
=
{
distribution:
DISTRIBUTION_REGEX
distribution:
::
Packages
::
Debian
::
DISTRIBUTION_REGEX
}.
freeze
COMPONENT_ARCHITECTURE_REQUIREMENTS
=
{
component:
COMPONENT_REGEX
,
architecture:
ARCHITECTURE_REGEX
component:
::
Packages
::
Debian
::
COMPONENT_REGEX
,
architecture:
::
Packages
::
Debian
::
ARCHITECTURE_REGEX
}.
freeze
COMPONENT_LETTER_SOURCE_PACKAGE_REQUIREMENTS
=
{
component:
COMPONENT_REGEX
,
component:
::
Packages
::
Debian
::
COMPONENT_REGEX
,
letter:
LETTER_REGEX
,
source_package:
PACKAGE_REGEX
}.
freeze
...
...
lib/gitlab/regex.rb
View file @
f836ae22
...
...
@@ -118,15 +118,15 @@ module Gitlab
def
debian_architecture_regex
# See official parser: https://git.dpkg.org/cgit/dpkg/dpkg.git/tree/lib/dpkg/arch.c?id=9e0c88ec09475f4d1addde9cdba1ad7849720356#n43
# But we limit to lower case
@debian_architecture_regex
||=
%r{
\A
[a-z0-9][-a-z0-9]*
\z
}
.
freeze
@debian_architecture_regex
||=
%r{
\A
#{
::
Packages
::
Debian
::
ARCHITECTURE_REGEX
}
\z
}
.
freeze
end
def
debian_distribution_regex
@debian_distribution_regex
||=
%r{
\A
[a-z0-9][a-z0-9
\.
-]*
\z
}i
.
freeze
@debian_distribution_regex
||=
%r{
\A
#{
::
Packages
::
Debian
::
DISTRIBUTION_REGEX
}
\z
}i
.
freeze
end
def
debian_component_regex
@debian_component_regex
||=
%r{
#{
debian_distribution_regex
}
}
.
freeze
@debian_component_regex
||=
%r{
\A
#{
::
Packages
::
Debian
::
COMPONENT_REGEX
}
\z
}
.
freeze
end
def
helm_channel_regex
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment