Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
orbea
Tor
Commits
00bc18b8
Commit
00bc18b8
authored
6 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'tor-github/pr/653'
parents
0ce4d23a
7e1f8934
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile.am
+1
-1
1 addition, 1 deletion
Makefile.am
changes/ticket27761
+4
-0
4 additions, 0 deletions
changes/ticket27761
scripts/maint/lintChanges.py
+56
-0
56 additions, 0 deletions
scripts/maint/lintChanges.py
with
61 additions
and
1 deletion
Makefile.am
+
1
−
1
View file @
00bc18b8
...
...
@@ -421,7 +421,7 @@ endif
check-changes
:
if
USEPYTHON
@if
test
-d
"$(top_srcdir)/changes"
;
then
\
$(PYTHON)
$(top_srcdir)/scripts/maint/lintChanges.py
$(top_srcdir)/changes;
\
PACKAGE_VERSION
=
$(
PACKAGE_VERSION
)
$(
PYTHON
)
$(
top_srcdir
)
/scripts/maint/lintChanges.py
$(
top_srcdir
)
/changes
;
\
fi
endif
...
...
This diff is collapsed.
Click to expand it.
changes/ticket27761
0 → 100644
+
4
−
0
View file @
00bc18b8
o Minor features (changelogs):
- Check that bugfix versions in changes files look like Tor versions
from the versions spec. Warn when bugfixes claim to be on a future
release. Closes ticket 27761.
This diff is collapsed.
Click to expand it.
scripts/maint/lintChanges.py
+
56
−
0
View file @
00bc18b8
...
...
@@ -35,6 +35,36 @@ NEEDS_SUBCATEGORIES = set([
"
Major features
"
,
])
def
split_tor_version
(
version
):
'''
Return the initial numeric components of the Tor version as a list of ints.
For versions earlier than 0.1.0, returns MAJOR, MINOR, and MICRO.
For versions 0.1.0 and later, returns MAJOR, MINOR, MICRO, and PATCHLEVEL if present.
If the version is malformed, returns None.
'''
version_match
=
re
.
match
(
'
([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?
'
,
version
)
if
version_match
is
None
:
return
None
version_groups
=
version_match
.
groups
()
if
version_groups
is
None
:
return
None
if
len
(
version_groups
)
<
3
:
return
None
if
len
(
version_groups
)
!=
5
:
return
None
version_components
=
version_groups
[
0
:
3
]
version_components
+=
version_groups
[
4
:
5
]
try
:
version_list
=
[
int
(
v
)
for
v
in
version_components
if
v
is
not
None
]
except
ValueError
:
return
None
return
version_list
def
lintfile
(
fname
):
have_warned
=
[]
...
...
@@ -87,6 +117,32 @@ def lintfile(fname):
warn
(
"
Bugfix does not say
'
Fixes bug X; bugfix on Y
'"
)
elif
re
.
search
(
'
tor-([0-9]+)
'
,
contents
):
warn
(
"
Do not prefix versions with
'
tor-
'
. (
'
0.1.2
'
, not
'
tor-0.1.2
'
.)
"
)
else
:
bugfix_match
=
re
.
search
(
'
bugfix on ([0-9]+\.[0-9]+\.[0-9]+)
'
,
contents
)
if
bugfix_match
is
None
:
warn
(
"
Versions must have at least 3 digits. (
'
0.1.2
'
,
'
0.3.4.8
'
, or
'
0.3.5.1-alpha
'
.)
"
)
elif
bugfix_match
.
group
(
0
)
is
None
:
warn
(
"
Versions must have at least 3 digits. (
'
0.1.2
'
,
'
0.3.4.8
'
, or
'
0.3.5.1-alpha
'
.)
"
)
else
:
bugfix_match
=
re
.
search
(
'
bugfix on ([0-9a-z][-.0-9a-z]+[0-9a-z])
'
,
contents
)
bugfix_group
=
bugfix_match
.
groups
()
if
bugfix_match
is
not
None
else
None
bugfix_version
=
bugfix_group
[
0
]
if
bugfix_group
is
not
None
else
None
package_version
=
os
.
environ
.
get
(
'
PACKAGE_VERSION
'
,
None
)
if
bugfix_version
is
None
:
# This should be unreachable, unless the patterns are out of sync
warn
(
"
Malformed bugfix version.
"
)
elif
package_version
is
not
None
:
# If $PACKAGE_VERSION isn't set, skip this check
bugfix_split
=
split_tor_version
(
bugfix_version
)
package_split
=
split_tor_version
(
package_version
)
if
bugfix_split
is
None
:
# This should be unreachable, unless the patterns are out of sync
warn
(
"
Malformed bugfix version:
'
{}
'
.
"
.
format
(
bugfix_version
))
elif
package_split
is
None
:
# This should be unreachable, unless the patterns are out of sync, or the package versioning scheme has changed
warn
(
"
Malformed $PACKAGE_VERSION:
'
{}
'
.
"
.
format
(
package_version
))
elif
bugfix_split
>
package_split
:
warn
(
"
Bugfixes must be made on earlier versions (or this version). (Bugfix on version:
'
{}
'
, current tor package version:
'
{}
'
.)
"
.
format
(
bugfix_version
,
package_version
))
return
have_warned
!=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment