[calm - Cygwin server-side packaging maintenance script] branch master, updated. 94a6727d1d0ed4dfee9aa30bd483e86ce9235882
jturney@sourceware.org
jturney@sourceware.org
Tue Mar 22 15:03:00 GMT 2016
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=94a6727d1d0ed4dfee9aa30bd483e86ce9235882
commit 94a6727d1d0ed4dfee9aa30bd483e86ce9235882
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Tue Mar 22 11:42:15 2016 +0000
Remove forced capitalization of first word of sdesc
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=a81fd6e7333086c74c2c58830b9fabe05a70890d
commit a81fd6e7333086c74c2c58830b9fabe05a70890d
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Mon Feb 22 13:39:12 2016 +0000
Drop special handling of ':' in sdesc
No longer warn if ':' is in sdesc
Warn if sdesc appears to start with 'package:'
Don't remove text up to ':' from sdesc in setup.ini
Update tests
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=dcef6fb05728458944e44ea42beb82dadc5ce6ba
commit dcef6fb05728458944e44ea42beb82dadc5ce6ba
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Tue Mar 22 10:46:09 2016 +0000
Update package listing base directory .htacess
Deal with access to /packages/index.html by redirecting to
package_list.html, rather than letting the server index a very large
directory
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=ae7e5004fe150d36333e34d638bf0b89f10e10be
commit ae7e5004fe150d36333e34d638bf0b89f10e10be
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Mon Mar 21 23:23:39 2016 +0000
Use correct uid/gid in mkmaintdir
Diff:
---
TODO | 1 -
hint.py | 5 ----
mkmaintdir | 12 ++++++---
package.py | 25 ++++++++------------
pkg2html.py | 13 ++++------
testdata/x86.hints/release/proj/expected | 3 +-
.../x86.hints/release/proj/libproj-devel/expected | 3 +-
testdata/x86.hints/release/proj/libproj1/expected | 3 +-
8 files changed, 26 insertions(+), 39 deletions(-)
diff --git a/TODO b/TODO
index 92ff9ab..d782f11 100644
--- a/TODO
+++ b/TODO
@@ -3,7 +3,6 @@
* more than 2 versions possible (and automatically vault 'old' versions, where we have some mechanism to explicity say what is old)
* enable .xz compressed setup.ini (setup.exe checks for it and presumably can handle it)
* automatically suppress 'empty source' packages from setup.ini ?
-* deal with htdocs/package/index.html by redirecting to package_list.html, rather than letting the server index the directory
* run more often, option to not do anything if no uploads (to avoid reading the release area if we don't need to), lockfile to avoid colliding runs
* work out some way to package it as a replacement for genini
* write 'move' lines in report more compactly, don't need the full path on every line
diff --git a/hint.py b/hint.py
index 27a75bb..4751466 100755
--- a/hint.py
+++ b/hint.py
@@ -202,11 +202,6 @@ def setup_hint_parse(fn):
if not (value.startswith('"') and value.endswith('"')):
errors.append("%s value '%s' should be quoted" % (key, value))
- # validate that sdesc doesn't contain ':', as that prefix is removed
- if key == 'sdesc':
- if ':' in value:
- warnings.append("sdesc contains ':'")
-
# warn if sdesc ends with a '.'
if key == 'sdesc':
if re.search(r'\."$', value):
diff --git a/mkmaintdir b/mkmaintdir
index 233eb4f..cadeaa6 100755
--- a/mkmaintdir
+++ b/mkmaintdir
@@ -51,10 +51,14 @@ import maintainers
#
#
-# cygwin_uid = pwd.getpwnam('cygwin').pw_uid
-# cygstage_gid = grp.getgrnam('cygstage').gr_gid
-cygwin_uid = pwd.getpwnam('jon').pw_uid
-cygstage_gid = grp.getgrnam('None').gr_gid
+cygwin_uid = pwd.getpwnam('cygwin').pw_uid
+cygstage_gid = grp.getgrnam('cygstage').gr_gid
+
+# different values to be used when we are not running on sourceware.org, but my
+# test system...
+if os.uname()[1] == 'tambora':
+ cygwin_uid = pwd.getpwnam('jon').pw_uid
+ cygstage_gid = grp.getgrnam('None').gr_gid
#
diff --git a/package.py b/package.py
index ef2832c..0b1313a 100755
--- a/package.py
+++ b/package.py
@@ -203,6 +203,15 @@ def read_package(packages, basedir, dirpath, files, strict=False):
if p in past_mistakes.self_source:
packages[p].hints['self-source'] = ''
+ # don't allow a redundant 'package-initial-substring:' at start of sdesc
+ if 'sdesc' in hints:
+ sdesc = re.sub(r'^"|"$', '', hints['sdesc'])
+ colon = sdesc.find(':')
+ if colon > -1:
+ if sdesc[:colon] == p[:colon]:
+ logging.warning("package '%s' sdesc starts with '%s:'; this is redundant as the UI will show both the package name and sdesc" % (p, sdesc[:colon]))
+ warnings = True
+
elif (len(files) > 0) and (relpath.count(os.path.sep) > 0):
logging.warning("no setup.hint in %s but files: %s" % (dirpath, ', '.join(files)))
@@ -494,21 +503,7 @@ def write_setup_ini(args, packages):
# write package data
print("\n@ %s" % p, file=f)
- # for historical reasons, we adjust sdesc slightly:
- #
- # - strip anything up to and including first ':'
- # - capitalize first letter
- # whilst preserving any leading quote
- #
- # these are both bad ideas, due to sdesc's which start with a
- # lower-case command name, or contain perl or ruby module names like
- # 'Net::HTTP'
- sdesc = packages[p].hints['sdesc']
- sdesc = re.sub('^("?)(.*?)("?)$', r'\2', sdesc)
- if ':' in sdesc:
- sdesc = re.sub(r'^[^:]+:\s*', '', sdesc)
- sdesc = '"' + upper_first_character(sdesc) + '"'
- print("sdesc: %s" % sdesc, file=f)
+ print("sdesc: %s" % packages[p].hints['sdesc'], file=f)
if 'ldesc' in packages[p].hints:
print("ldesc: %s" % packages[p].hints['ldesc'], file=f)
diff --git a/pkg2html.py b/pkg2html.py
index 7f593c4..1335352 100755
--- a/pkg2html.py
+++ b/pkg2html.py
@@ -65,10 +65,10 @@ def update_package_listings(args, packages):
#
# write base directory .htaccess, if needed
#
- # XXX: we should probably force trying to access the base directory to
- # redirect to the package list page, as having the server index this
- # directory makes this URL very expensive to serve if someone stumbles onto
- # it by accident)
+ # force trying to access the base directory to redirect to the package list
+ # page, as having the server index this directory containing lots of
+ # subdirectories makes this URL very expensive to serve if someone stumbles
+ # onto it by accident)
#
htaccess = os.path.join(base, '.htaccess')
@@ -77,10 +77,7 @@ def update_package_listings(args, packages):
if not args.dryrun:
with open(htaccess, 'w') as f:
- print(textwrap.dedent('''\
- Options Indexes FollowSymLinks Includes
- IndexOptions FancyIndexing DescriptionWidth=* SuppressSize SuppressLastModified IconHeight=10 IconWidth=10
- AddIcon /icons/ball.gray.gif ^^DIRECTORY^^'''),
+ print('Redirect temp /packages/%s/index.html https://cygwin.com/packages/package_list.html' % (args.arch),
file=f)
toremove = glob.glob(os.path.join(base, '*', '*'))
diff --git a/testdata/x86.hints/release/proj/expected b/testdata/x86.hints/release/proj/expected
index aad8c0a..40db455 100644
--- a/testdata/x86.hints/release/proj/expected
+++ b/testdata/x86.hints/release/proj/expected
@@ -2,5 +2,4 @@
'requires': 'libproj1',
'sdesc': '""The PROJ Cartographic Projections Software (utilities)"\n'
'ldesc: "Cartographic projection library and utilities"',
- 'parse-errors': ['embedded quote at line 3', 'key sdesc has multi-line value'],
- 'parse-warnings': ["sdesc contains ':'"]}
+ 'parse-errors': ['embedded quote at line 3', 'key sdesc has multi-line value']}
diff --git a/testdata/x86.hints/release/proj/libproj-devel/expected b/testdata/x86.hints/release/proj/libproj-devel/expected
index e7ec670..620f019 100644
--- a/testdata/x86.hints/release/proj/libproj-devel/expected
+++ b/testdata/x86.hints/release/proj/libproj-devel/expected
@@ -3,5 +3,4 @@
'sdesc': '""The PROJ Cartographic Projections Software (devel)"\n'
'ldesc: "Cartographic projection library and utilities"',
'external-source': 'proj',
- 'parse-errors': ['embedded quote at line 3', 'key sdesc has multi-line value'],
- 'parse-warnings': ["sdesc contains ':'"]}
+ 'parse-errors': ['embedded quote at line 3', 'key sdesc has multi-line value']}
diff --git a/testdata/x86.hints/release/proj/libproj1/expected b/testdata/x86.hints/release/proj/libproj1/expected
index e032ce6..cc05b73 100644
--- a/testdata/x86.hints/release/proj/libproj1/expected
+++ b/testdata/x86.hints/release/proj/libproj1/expected
@@ -3,5 +3,4 @@
'sdesc': '""The PROJ Cartographic Projections Software (runtime)"\n'
'ldesc: "Cartographic projection library and utilities"',
'external-source': 'proj',
- 'parse-errors': ['embedded quote at line 3', 'key sdesc has multi-line value'],
- 'parse-warnings': ["sdesc contains ':'"]}
+ 'parse-errors': ['embedded quote at line 3', 'key sdesc has multi-line value']}
More information about the Cygwin-apps-cvs
mailing list