Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
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
Thomas Gambier
slapos
Commits
3599de61
Commit
3599de61
authored
May 30, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perl: make post-make-hook script compatible with Python 3
parent
17931bed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
+12
-16
component/perl/buildout.cfg
component/perl/buildout.cfg
+1
-1
component/perl/perl-create-libs-symlink.py
component/perl/perl-create-libs-symlink.py
+11
-15
No files found.
component/perl/buildout.cfg
View file @
3599de61
...
@@ -25,4 +25,4 @@ configure-command =
...
@@ -25,4 +25,4 @@ configure-command =
-Dusethreads
-Dusethreads
environment =
environment =
PATH=${patch:location}/bin:%(PATH)s
PATH=${patch:location}/bin:%(PATH)s
post-make-hook = ${:_profile_base_location_}/perl-create-libs-symlink.py#
28d12de5c9c7985e65233d56817e3bec
:post_make_hook
post-make-hook = ${:_profile_base_location_}/perl-create-libs-symlink.py#
943453b7d3ff8d49ed12d44a7f7076ee
:post_make_hook
component/perl/perl-create-libs-symlink.py
View file @
3599de61
from
zc.buildout
import
UserError
import
fnmatch
import
fnmatch
import
os
import
os
import
pprint
def
post_make_hook
(
options
,
buildout
):
def
post_make_hook
(
options
,
buildout
):
location
=
options
[
'location'
]
location
=
options
[
'location'
]
matches
=
[]
matches
=
[
os
.
path
.
join
(
root
,
filename
)
for
root
,
dirnames
,
filenames
in
os
.
walk
(
location
):
for
root
,
dirnames
,
filenames
in
os
.
walk
(
location
)
for
filename
in
fnmatch
.
filter
(
filenames
,
'libperl.a'
):
for
filename
in
fnmatch
.
filter
(
filenames
,
'libperl.a'
)]
matches
.
append
(
os
.
path
.
join
(
root
,
filename
))
if
not
matches
:
nr_matches
=
len
(
matches
)
raise
UserError
(
"ERROR - no libperl.* found!"
)
if
nr_matches
==
0
:
if
len
(
matches
)
>
1
:
print
"ERROR - no libperl.* found!"
print
(
"WARNING - several libperl.a found, taking only the first one:"
,
exit
"
\
n
"
.
join
(
matches
))
elif
nr_matches
>
1
:
print
"WARNING - several libperl.a found, taking only the first one:"
,
"
\
n
"
.
join
(
matches
)
# matches[0] is a prefix of "location"
# matches[0] is a prefix of "location"
# For the symlink, we want the relative path.
# For the symlink, we want the relative path.
...
@@ -24,4 +20,4 @@ def post_make_hook(options, buildout):
...
@@ -24,4 +20,4 @@ def post_make_hook(options, buildout):
if
os
.
path
.
islink
(
simlink_location
):
if
os
.
path
.
islink
(
simlink_location
):
os
.
unlink
(
simlink_location
)
os
.
unlink
(
simlink_location
)
os
.
symlink
(
rel_link
,
simlink_location
)
os
.
symlink
(
rel_link
,
simlink_location
)
print
"Created symlink
\
"
libs-c
\
"
to"
,
rel_link
print
(
"Created symlink
\
"
libs-c
\
"
to"
,
rel_link
)
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