Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
devflow
Commits
42868817
Commit
42868817
authored
Jun 05, 2013
by
Christos Stavrakakis
Browse files
Add dist codename in debian version and changelog
parent
a09634f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
devflow/autopkg.py
View file @
42868817
...
...
@@ -132,10 +132,8 @@ def main():
help
=
"Use this keyid for gpg signing"
)
parser
.
add_option
(
"--dist"
,
dest
=
"dist"
,
default
=
"unstable"
,
help
=
"If running in snapshot mode, automatically set"
" the changelog distribution to this value"
" (default=unstable)."
)
default
=
None
,
help
=
"Force distribution in Debian changelog"
),
parser
.
add_option
(
"-S"
,
"--source-only"
,
dest
=
"source_only"
,
default
=
False
,
...
...
@@ -250,16 +248,23 @@ def main():
"--new-version=%s"
%
debian_version
)
print_green
(
"Successfully ran '%s'"
%
" "
.
join
(
dch
.
cmd
))
if
options
.
dist
is
not
None
:
distribution
=
options
.
dist
elif
mode
==
"release"
:
distribution
=
utils
.
get_distribution_codename
()
else
:
distribution
=
"unstable"
f
=
open
(
"debian/changelog"
,
'r+'
)
lines
=
f
.
readlines
()
lines
[
0
]
=
lines
[
0
].
replace
(
"UNRELEASED"
,
distribution
)
lines
[
2
]
=
lines
[
2
].
replace
(
"UNRELEASED"
,
"%s build"
%
mode
)
f
.
seek
(
0
)
f
.
writelines
(
lines
)
f
.
close
()
if
mode
==
"release"
:
call
(
"vim debian/changelog"
)
else
:
f
=
open
(
"debian/changelog"
,
'r+'
)
lines
=
f
.
readlines
()
lines
[
0
]
=
lines
[
0
].
replace
(
"UNRELEASED"
,
options
.
dist
)
lines
[
2
]
=
lines
[
2
].
replace
(
"UNRELEASED"
,
"Snapshot build"
)
f
.
seek
(
0
)
f
.
writelines
(
lines
)
f
.
close
()
# Add changelog to INDEX
repo
.
git
.
add
(
"debian/changelog"
)
...
...
devflow/utils.py
View file @
42868817
...
...
@@ -33,6 +33,7 @@
import
os
import
git
import
sh
from
collections
import
namedtuple
from
configobj
import
ConfigObj
...
...
@@ -193,3 +194,10 @@ def undebianize(branch):
return
branch
.
replace
(
"debian-"
,
""
)
else
:
return
branch
def
get_distribution_codename
():
output
=
sh
.
lsb_release
(
"-c"
)
_
,
codename
=
output
.
split
(
"
\t
"
)
codename
=
codename
.
strip
()
return
codename
devflow/versioning.py
View file @
42868817
...
...
@@ -299,8 +299,9 @@ def debian_version_from_python_version(pyver):
"""
version
=
pyver
.
replace
(
"_"
,
"~"
).
replace
(
"rc"
,
"~rc"
)
minor
=
get_revision
(
version
)
return
version
+
"-"
+
str
(
minor
)
minor
=
str
(
get_revision
(
version
))
codename
=
utils
.
get_distribution_codename
()
return
version
+
"-"
+
minor
+
"~"
+
codename
def
get_revision
(
version
):
...
...
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