Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
a3623b85
Commit
a3623b85
authored
Dec 24, 2007
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added
parent
2c829935
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
inst/generate_externals.py
inst/generate_externals.py
+70
-0
No files found.
inst/generate_externals.py
0 → 100644
View file @
a3623b85
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
""" Generate svn:external files (with help of the KGS)
Written by Andreas Jung, 2007
"""
# Requires some local files that contain the current
# list of externals on a per-directory basis:
#
# svn propget svn:externals lib/python/ >inst/lib_python.txt
# svn propget svn:externals lib/python/zope >inst/lib_python_zope.txt
# svn propget svn:externals lib/python/zope/app >inst/lib_python_zope_app.txt
import
sys
import
urllib2
from
ConfigParser
import
ConfigParser
,
NoOptionError
error
=
sys
.
stderr
# download current KGS index
kgs_url
=
'http://download.zope.org/zope3.4/versions.cfg'
open
(
'kgs.ini'
,
'w'
).
write
(
urllib2
.
urlopen
(
kgs_url
).
read
())
CP
=
ConfigParser
()
CP
.
read
(
'kgs.ini'
)
for
name
,
prefix
in
((
'lib_python'
,
None
),
(
'lib_python_zope'
,
'zope'
),
(
'lib_python_zope_app'
,
'zope.app'
)):
outname
=
name
+
'.ext'
print
>>
error
,
'Generating externals file %s'
%
outname
fp
=
open
(
outname
,
'w'
)
for
line
in
open
(
name
+
'.txt'
):
line
=
line
.
strip
()
if
not
line
:
continue
module
,
url
=
line
.
split
(
' '
,
1
)
module
=
module
.
strip
()
url
=
url
.
strip
()
# generate full module name as it appear in the KGS idnex
full_mod_name
=
module
if
prefix
:
full_mod_name
=
'%s.%s'
%
(
prefix
,
module
)
try
:
tag
=
CP
.
get
(
'versions'
,
full_mod_name
)
n
=
'/'
.
join
(
full_mod_name
.
split
(
'.'
))
url
=
'svn://svn.zope.org/repos/main/%s/tags/%s/src/%s'
%
(
full_mod_name
,
tag
,
n
)
ok
=
True
except
NoOptionError
:
ok
=
False
print
>>
error
,
'WARN: KGS incomplete - %s not found'
%
full_mod_name
if
not
ok
:
print
>>
fp
,
'# warning: KGS incomplete, using old URL for %s'
%
module
print
>>
fp
,
'%-20s %s'
%
(
module
,
url
)
fp
.
close
()
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