Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Gambier
slapos.package
Commits
99e7030a
Commit
99e7030a
authored
Jul 20, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move to python3
parent
ed735991
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
obs/re6st/make
obs/re6st/make
+7
-7
obs/re6st/make.py
obs/re6st/make.py
+4
-4
No files found.
obs/re6st/make
View file @
99e7030a
...
@@ -135,15 +135,15 @@ class task(_task):
...
@@ -135,15 +135,15 @@ class task(_task):
return
task_gen
return
task_gen
def
__init__
(
self
,
run
,
depends
,
provides
=
(),
def
__init__
(
self
,
run
,
depends
,
provides
=
(),
__str_or_task
=
(
basestring
,
_task
)):
__str_or_task
=
(
str
,
_task
)):
self
.
run
=
run
self
.
run
=
run
self
.
depends
=
[]
self
.
depends
=
[]
f
=
[]
f
=
[]
for
x
in
(
depends
,)
if
isinstance
(
depends
,
__str_or_task
)
else
depends
:
for
x
in
(
depends
,)
if
isinstance
(
depends
,
__str_or_task
)
else
depends
:
(
f
if
isinstance
(
x
,
basestring
)
else
self
.
depends
).
append
(
x
)
(
f
if
isinstance
(
x
,
str
)
else
self
.
depends
).
append
(
x
)
f
and
self
.
depends
.
append
(
files
(
*
f
))
f
and
self
.
depends
.
append
(
files
(
*
f
))
self
.
provides
=
((
provides
,)
self
.
provides
=
((
provides
,)
if
isinstance
(
provides
,
basestring
)
or
callable
(
provides
)
if
isinstance
(
provides
,
str
)
or
callable
(
provides
)
else
provides
)
else
provides
)
self
.
why
=
self
,
self
.
why
=
self
,
...
@@ -177,10 +177,10 @@ class task(_task):
...
@@ -177,10 +177,10 @@ class task(_task):
if
deps
:
if
deps
:
self
.
why
=
[
dep
for
dep
,
itime
in
deps
if
_otime
<
itime
]
self
.
why
=
[
dep
for
dep
,
itime
in
deps
if
_otime
<
itime
]
if
self
.
why
:
if
self
.
why
:
print
"# Processing %s: %s -> %s"
%
(
self
,
print
(
"# Processing %s: %s -> %s"
%
(
self
,
", "
.
join
(
map
(
str
,
self
.
depends
)),
", "
.
join
(
map
(
str
,
self
.
depends
)),
", "
.
join
(
"<%s>"
%
x
.
__name__
if
callable
(
x
)
else
x
", "
.
join
(
"<%s>"
%
x
.
__name__
if
callable
(
x
)
else
x
for
x
in
self
.
provides
or
"?"
))
for
x
in
self
.
provides
or
"?"
))
)
if
not
dry_run
:
if
not
dry_run
:
try
:
try
:
self
.
run
(
self
)
self
.
run
(
self
)
...
@@ -222,8 +222,8 @@ def main():
...
@@ -222,8 +222,8 @@ def main():
tasks
=
{
"__file__"
:
f
.
name
}
tasks
=
{
"__file__"
:
f
.
name
}
exec
(
compile
(
f
.
read
(),
f
.
name
,
"exec"
),
tasks
)
exec
(
compile
(
f
.
read
(),
f
.
name
,
"exec"
),
tasks
)
if
args
.
list
:
if
args
.
list
:
print
" "
.
join
(
sorted
(
k
for
k
,
v
in
tasks
.
iteritems
()
print
(
" "
.
join
(
sorted
(
k
for
k
,
v
in
tasks
.
iteritems
()
if
isinstance
(
v
,
_task
)))
if
isinstance
(
v
,
_task
)))
)
return
return
for
t
in
args
.
task
:
for
t
in
args
.
task
:
if
not
isinstance
(
tasks
.
get
(
t
),
_task
):
if
not
isinstance
(
tasks
.
get
(
t
),
_task
):
...
...
obs/re6st/make.py
View file @
99e7030a
...
@@ -40,9 +40,9 @@
...
@@ -40,9 +40,9 @@
# If this way of packaging is reused for other software, postinst scripts
# If this way of packaging is reused for other software, postinst scripts
# should be implemented.
# should be implemented.
import
os
,
rfc822
,
shutil
,
ssl
,
time
,
urllib
import
os
,
email
,
shutil
,
ssl
,
time
,
urllib
.
request
from
glob
import
glob
from
glob
import
glob
from
cStringIO
import
StringIO
from
io
import
StringIO
from
subprocess
import
check_call
from
subprocess
import
check_call
from
make
import
*
from
make
import
*
from
debian.changelog
import
Changelog
from
debian.changelog
import
Changelog
...
@@ -86,7 +86,7 @@ def bootstrap(task):
...
@@ -86,7 +86,7 @@ def bootstrap(task):
try
:
try
:
os
.
utime
(
task
.
outputs
[
1
],
None
)
os
.
utime
(
task
.
outputs
[
1
],
None
)
except
OSError
:
except
OSError
:
bootstrap
=
urllib
.
urlopen
(
BOOTSTRAP_URL
).
read
()
bootstrap
=
urllib
.
request
.
urlopen
(
BOOTSTRAP_URL
).
read
()
mkdir
(
BUILD
+
"/download-cache"
)
mkdir
(
BUILD
+
"/download-cache"
)
with
cwd
(
BUILD
):
with
cwd
(
BUILD
):
rmtree
(
"extends-cache"
)
rmtree
(
"extends-cache"
)
...
@@ -205,7 +205,7 @@ def deb(task):
...
@@ -205,7 +205,7 @@ def deb(task):
b
[
"Conflicts"
]
=
b
[
"Provides"
]
=
b
[
"Replaces"
]
=
"re6stnet"
b
[
"Conflicts"
]
=
b
[
"Provides"
]
=
b
[
"Replaces"
]
=
"re6stnet"
patched_control
=
StringIO
(
"%s
\
n
%s"
%
(
s
,
b
))
patched_control
=
StringIO
(
"%s
\
n
%s"
%
(
s
,
b
))
open
(
task
.
outputs
[
1
],
"w"
).
write
(
str
(
d
))
open
(
task
.
outputs
[
1
],
"w"
).
write
(
str
(
d
))
date
=
rfc822
.
parsedate_tz
(
Changelog
(
open
(
dch
.
output
)).
date
)
date
=
email
.
utils
.
parsedate_tz
(
Changelog
(
open
(
dch
.
output
)).
date
)
mtime
=
time
.
mktime
(
date
[:
9
])
-
date
[
9
]
mtime
=
time
.
mktime
(
date
[:
9
])
-
date
[
9
]
# Unfortunately, OBS does not support symlinks.
# Unfortunately, OBS does not support symlinks.
with
make_tar_gz
(
task
.
outputs
[
0
],
mtime
,
dereference
=
True
)
as
t
:
with
make_tar_gz
(
task
.
outputs
[
0
],
mtime
,
dereference
=
True
)
as
t
:
...
...
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