[Git][debian-gis-team/osm2pgsql][master] Replace manpage.patch with upstream changes.
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Sun Feb 13 13:48:34 GMT 2022
Bas Couwenberg pushed to branch master at Debian GIS Project / osm2pgsql
Commits:
46b6408b by Bas Couwenberg at 2022-02-13T14:41:41+01:00
Replace manpage.patch with upstream changes.
- - - - -
5 changed files:
- debian/changelog
- debian/control
- − debian/patches/manpage.patch
- + debian/patches/pr1641-osm2pgsql-replication-manpage.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+osm2pgsql (1.6.0+ds-2) UNRELEASED; urgency=medium
+
+ * Replace manpage.patch with upstream changes.
+
+ -- Bas Couwenberg <sebastic at debian.org> Sun, 13 Feb 2022 14:34:14 +0100
+
osm2pgsql (1.6.0+ds-1) unstable; urgency=medium
* New upstream release.
=====================================
debian/control
=====================================
@@ -22,6 +22,7 @@ Build-Depends: debhelper-compat (= 12),
liblua5.3-dev,
lua5.3,
python3,
+ python3-argparse-manpage,
python3-psycopg2,
python3-pyosmium
Standards-Version: 4.6.0
=====================================
debian/patches/manpage.patch deleted
=====================================
@@ -1,48 +0,0 @@
-Description: Improve manpage issues reported by lintian.
- * bad-whatis-entry
- * groff-message: warning: macro '<foo>'' not defined
-Author: Bas Couwenberg <sebastic at debian.org>
-Forwarded: https://github.com/openstreetmap/osm2pgsql/pull/1626
-
---- a/docs/osm2pgsql-replication.1
-+++ b/docs/osm2pgsql-replication.1
-@@ -1,6 +1,6 @@
- .TH osm2pgsql-replication "1" Manual
- .SH NAME
--osm2pgsql-replication
-+osm2pgsql-replication - osm2pgsql database updater
- .SH SYNOPSIS
- .B osm2pgsql-replication
- [-h] {init,update,status} ...
-@@ -269,25 +269,25 @@ With the '\-\-json' option, the status i
- .br
-
- .br
--'status' is 0 if there were no problems getting the status. 1 & 2 for
-+\(cqstatus\(cq is 0 if there were no problems getting the status. 1 & 2 for
- .br
- improperly set up replication. 3 for network issues. If status ≠ 0, then
- .br
--the 'error' key is an error message (as string). 'status' is used as the
-+the \(cqerror\(cq key is an error message (as string). \(cqstatus\(cq is used
- .br
--exit code.
-+as the exit code.
- .br
-
- .br
--'server' is the replication server's current status. 'sequence' is it's
-+\(cqserver\(cq is the replication server\(cqs current status. \(cqsequence\(cq is it\(cqs
- .br
--sequence number, 'timestamp' the time of that, and 'age_sec' the age of the
-+sequence number, \(cqtimestamp\(cq the time of that, and \(cqage_sec\(cq the age of the
- .br
- data in seconds.
- .br
-
- .br
--'local' is the status of your server.
-+\(cqlocal\(cq is the status of your server.
-
-
- .TP
=====================================
debian/patches/pr1641-osm2pgsql-replication-manpage.patch
=====================================
@@ -0,0 +1,357 @@
+Subject: Integrate building of osm2pgsql-replication manpage into cmake
+Author: Sarah Hoffmann <lonvia at denofr.de>
+Origin: https://github.com/openstreetmap/osm2pgsql/pull/1641
+Bug: https://github.com/openstreetmap/osm2pgsql/pull/1626
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -336,6 +336,5 @@ add_subdirectory(docs)
+ if (ENABLE_INSTALL)
+ install(TARGETS osm2pgsql DESTINATION bin)
+ install(PROGRAMS scripts/osm2pgsql-replication DESTINATION bin)
+- install(FILES docs/osm2pgsql-replication.1 DESTINATION share/man/man1)
+ install(FILES default.style empty.style DESTINATION share/osm2pgsql)
+ endif()
+--- a/docs/CMakeLists.txt
++++ b/docs/CMakeLists.txt
+@@ -1,10 +1,13 @@
+-
+ message(STATUS "Looking for pandoc")
+ find_program(PANDOC pandoc)
++message(STATUS "Looking for argparse-manpage")
++find_program(ARGPARSE_MANPAGE argparse-manpage)
++
++set(MANPAGE_TARGETS "")
+
+ if(PANDOC)
+ message(STATUS "Looking for pandoc - found")
+- message(STATUS " Manual page can be built using 'man' target")
++ message(STATUS " osm2pgsql manual page can be built using 'man' target")
+ set(PANDOC_MAN_OPTIONS
+ -s
+ -t man
+@@ -21,12 +24,33 @@ if(PANDOC)
+ COMMENT "Building manpage osm2pgsql.1"
+ VERBATIM)
+
+- add_custom_target(man DEPENDS osm2pgsql.1 VERBATIM)
++ list(APPEND MANPAGE_TARGETS osm2pgsql.1)
+ else()
+ message(STATUS "Looking for pandoc - not found")
+- message(STATUS " Manual page can not be built")
++ message(STATUS " osm2pgsql manual page can not be built")
++endif()
++
++if(ARGPARSE_MANPAGE)
++ message(STATUS "Looking for argparse-manpage - found")
++ message(STATUS " osm2pgsql-replication manual page can be built using 'man' target")
++
++ add_custom_command(OUTPUT osm2pgsql-replication.1
++ COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/manpage_from_python.py --version ${PROJECT_VERSION} --description "osm2pgsql database updater" ${CMAKE_SOURCE_DIR}/scripts/osm2pgsql-replication > ${CMAKE_CURRENT_BINARY_DIR}/osm2pgsql-replication.1
++ DEPENDS ${CMAKE_SOURCE_DIR}/scripts/osm2pgsql-replication manpage_from_python.py
++ COMMENT "Building manpage osm2pgsql-replication.1"
++ VERBATIM)
++
++ list(APPEND MANPAGE_TARGETS osm2pgsql-replication.1)
++else()
++ message(STATUS "Looking for argparse-manpage - not found")
++ message(STATUS " osm2pgsql-replication page can not be built")
++endif()
++
++if(MANPAGE_TARGETS)
++ add_custom_target(man DEPENDS ${MANPAGE_TARGETS} VERBATIM)
+ endif()
+
+-if (ENABLE_INSTALL)
++if(ENABLE_INSTALL)
+ install(FILES osm2pgsql.1 DESTINATION share/man/man1)
++ install(FILES osm2pgsql-replication.1 DESTINATION share/man/man1)
+ endif()
+--- /dev/null
++++ b/docs/manpage_from_python.py
+@@ -0,0 +1,49 @@
++""" Create a man page for osm2pgsql helper scripts in python.
++"""
++from argparse import ArgumentParser, RawDescriptionHelpFormatter
++import re
++
++from build_manpages.manpage import Manpage
++from build_manpages.build_manpage import get_parser_from_file
++
++SEE_ALSO = [
++ "osm2pgsql website (https://osm2pgsql.org)",
++ "osm2pgsql manual (https://osm2pgsql.org/doc/manual.html)"
++]
++
++def create_manpage_for(args):
++ """ Create a man page for the given script.
++ """
++ parser = get_parser_from_file(args.script, 'get_parser', 'function')
++ parser.man_short_description = args.description
++ parser._manpage = [
++ {'heading': 'SEE ALSO',
++ 'content': '\n'.join(f"* {s}" for s in SEE_ALSO)}
++ ]
++
++ manpage = str(Manpage(parser))
++ manpage = re.sub(r'.TH.*',
++ f'.TH "{parser.prog.upper()}" "1" "{args.version}" "" ""',
++ manpage)
++ # Correct quoting for single quotes. See groff manpage.
++ manpage = manpage.replace('`', '\\(cq')
++
++ return manpage
++
++
++if __name__ == "__main__":
++ parser = ArgumentParser(usage='%(prog)s [options] <script>',
++ formatter_class=RawDescriptionHelpFormatter,
++ description=__doc__)
++ parser.add_argument('--version', default="Manual",
++ help='Version of the software')
++ parser.add_argument('--description',
++ help='Short description added to the name')
++ parser.add_argument('script',
++ help='Name of the script to generate the manpage for.')
++
++ args = parser.parse_args()
++
++ manpage = create_manpage_for(args)
++
++ print(manpage)
+--- a/scripts/osm2pgsql-replication
++++ b/scripts/osm2pgsql-replication
+@@ -15,7 +15,7 @@ or the newest object in the database. Th
+ in the database. Subsequent runs download newly available data and apply
+ it to the database.
+
+-See the help of the 'init' and 'update' command for more information on
++See the help of the `init` and `update` command for more information on
+ how to use %(prog)s.
+ """
+
+@@ -160,7 +160,7 @@ def status(conn, args):
+ 2021-08-17 15:20:28 [INFO]: Local database's most recent data is 5 day(s) 20 hour(s) 59 minute(s) old
+
+
+- With the '--json' option, the status is printed as a json object.
++ With the `--json` option, the status is printed as a json object.
+
+ {
+ "server": {
+@@ -178,16 +178,16 @@ def status(conn, args):
+ }
+
+
+- 'status' is 0 if there were no problems getting the status. 1 & 2 for
++ `status` is 0 if there were no problems getting the status. 1 & 2 for
+ improperly set up replication. 3 for network issues. If status ≠ 0, then
+- the 'error' key is an error message (as string). 'status' is used as the
++ the `error` key is an error message (as string). `status` is used as the
+ exit code.
+
+- 'server' is the replication server's current status. 'sequence' is it's
+- sequence number, 'timestamp' the time of that, and 'age_sec' the age of the
++ `server` is the replication server's current status. `sequence` is it's
++ sequence number, `timestamp` the time of that, and 'age_sec' the age of the
+ data in seconds.
+
+- 'local' is the status of your server.
++ `local` is the status of your server.
+ """
+
+ results = {}
+@@ -263,7 +263,7 @@ def init(conn, args):
+ There are two ways to initialise the replication process: if you have imported
+ from a file that contains replication source information, then the
+ initialisation process can use this and set up replication from there.
+- Use the command '%(prog)s --osm-file <filename>' for this.
++ Use the command `%(prog)s --osm-file <filename>` for this.
+
+ If the file has no replication information or you don't have the initial
+ import file anymore then replication can be set up according to
+@@ -271,7 +271,7 @@ def init(conn, args):
+ newest way in the database and then queries the OSM API when the way was
+ created. The date is used as the start date for replication. In this mode
+ the minutely diffs from the OSM servers are used as a source. You can change
+- this with the '--server' parameter.
++ this with the `--server` parameter.
+ """
+ if args.osm_file is None:
+ date = compute_database_date(conn, args.prefix)
+@@ -315,17 +315,17 @@ def update(conn, args):
+ """\
+ Download newly available data and apply it to the database.
+
+- The data is downloaded in chunks of '--max-diff-size' MB. Each chunk is
++ The data is downloaded in chunks of `--max-diff-size` MB. Each chunk is
+ saved in a temporary file and imported with osm2pgsql from there. The
+ temporary file is normally deleted afterwards unless you state an explicit
+- location with '--diff-file'. Once the database is up to date with the
++ location with `--diff-file`. Once the database is up to date with the
+ replication source, the update process exits with 0.
+
+- Any additional arguments to osm2pgsql need to be given after '--'. Database
++ Any additional arguments to osm2pgsql need to be given after `--`. Database
+ and the prefix parameter are handed through to osm2pgsql. They do not need
+- to be repeated. '--append' and '--slim' will always be added as well.
++ to be repeated. `--append` and `--slim` will always be added as well.
+
+- Use the '--post-processing' parameter to execute a script after osm2pgsql has
++ Use the `--post-processing` parameter to execute a script after osm2pgsql has
+ run successfully. If the updates consists of multiple runs because the
+ maximum size of downloaded data was reached, then the script is executed
+ each time that osm2pgsql has run. When the post-processing fails, then
+--- a/docs/osm2pgsql-replication.1
++++ b/docs/osm2pgsql-replication.1
+@@ -1,6 +1,6 @@
+-.TH osm2pgsql-replication "1" Manual
++.TH "OSM2PGSQL-REPLICATION" "1" "1.6.0" "" ""
+ .SH NAME
+-osm2pgsql-replication
++osm2pgsql-replication \- osm2pgsql database updater
+ .SH SYNOPSIS
+ .B osm2pgsql-replication
+ [-h] {init,update,status} ...
+@@ -19,7 +19,7 @@ it to the database.
+ .br
+
+ .br
+-See the help of the 'init' and 'update' command for more information on
++See the help of the \(cqinit\(cq and \(cqupdate\(cq command for more information on
+ .br
+ how to use osm2pgsql\-replication.
+ .SH OPTIONS
+@@ -51,7 +51,7 @@ from a file that contains replication so
+ .br
+ initialisation process can use this and set up replication from there.
+ .br
+-Use the command '%(prog)s \-\-osm\-file <filename>' for this.
++Use the command \(cq%(prog)s \-\-osm\-file <filename>\(cq for this.
+ .br
+
+ .br
+@@ -67,7 +67,7 @@ created. The date is used as the start d
+ .br
+ the minutely diffs from the OSM servers are used as a source. You can change
+ .br
+-this with the '\-\-server' parameter.
++this with the \(cq\-\-server\(cq parameter.
+
+
+
+@@ -114,27 +114,27 @@ Download newly available data and apply
+ .br
+
+ .br
+-The data is downloaded in chunks of '\-\-max\-diff\-size' MB. Each chunk is
++The data is downloaded in chunks of \(cq\-\-max\-diff\-size\(cq MB. Each chunk is
+ .br
+ saved in a temporary file and imported with osm2pgsql from there. The
+ .br
+ temporary file is normally deleted afterwards unless you state an explicit
+ .br
+-location with '\-\-diff\-file'. Once the database is up to date with the
++location with \(cq\-\-diff\-file\(cq. Once the database is up to date with the
+ .br
+ replication source, the update process exits with 0.
+ .br
+
+ .br
+-Any additional arguments to osm2pgsql need to be given after '\-\-'. Database
++Any additional arguments to osm2pgsql need to be given after \(cq\-\-\(cq. Database
+ .br
+ and the prefix parameter are handed through to osm2pgsql. They do not need
+ .br
+-to be repeated. '\-\-append' and '\-\-slim' will always be added as well.
++to be repeated. \(cq\-\-append\(cq and \(cq\-\-slim\(cq will always be added as well.
+ .br
+
+ .br
+-Use the '\-\-post\-processing' parameter to execute a script after osm2pgsql has
++Use the \(cq\-\-post\-processing\(cq parameter to execute a script after osm2pgsql has
+ .br
+ run successfully. If the updates consists of multiple runs because the
+ .br
+@@ -233,7 +233,7 @@ Sample output:
+ .br
+
+ .br
+-With the '\-\-json' option, the status is printed as a json object.
++With the \(cq\-\-json\(cq option, the status is printed as a json object.
+ .br
+
+ .br
+@@ -269,25 +269,25 @@ With the '\-\-json' option, the status i
+ .br
+
+ .br
+-'status' is 0 if there were no problems getting the status. 1 & 2 for
++\(cqstatus\(cq is 0 if there were no problems getting the status. 1 & 2 for
+ .br
+ improperly set up replication. 3 for network issues. If status ≠ 0, then
+ .br
+-the 'error' key is an error message (as string). 'status' is used as the
++the \(cqerror\(cq key is an error message (as string). \(cqstatus\(cq is used as the
+ .br
+ exit code.
+ .br
+
+ .br
+-'server' is the replication server's current status. 'sequence' is it's
++\(cqserver\(cq is the replication server's current status. \(cqsequence\(cq is it's
+ .br
+-sequence number, 'timestamp' the time of that, and 'age_sec' the age of the
++sequence number, \(cqtimestamp\(cq the time of that, and 'age_sec' the age of the
+ .br
+ data in seconds.
+ .br
+
+ .br
+-'local' is the status of your server.
++\(cqlocal\(cq is the status of your server.
+
+
+ .TP
+@@ -322,7 +322,8 @@ Database server port
+ \fB\-p\fR PREFIX, \fB\-\-prefix\fR PREFIX
+ Prefix for table names (default 'planet_osm')
+
+-.SH DISTRIBUTION
+-The latest version of osm2pgsql\-replication may be downloaded from
+-.UR osm2pgsql.org
+-.UE
++.SH SEE ALSO
++* osm2pgsql website (https://osm2pgsql.org)
++.br
++* osm2pgsql manual (https://osm2pgsql.org/doc/manual.html)
++
+--- a/CONTRIBUTING.md
++++ b/CONTRIBUTING.md
+@@ -59,20 +59,17 @@ User documentation is available on [the
+ is stored in `docs/`. Pages on the OpenStreetMap wiki are known to be
+ unreliable and outdated.
+
+-The [osm2pgsql man page](docs/osm2pgsql.1) can be built from [source](docs/osm2pgsql.md)
+-with `make man`. The [osm2pgsql-replication man page](docs/osm2pgsql-replication.1)
+-has been built with:
++The man pages for [osm2pgsql](docs/osm2pgsql.1) and
++[osm2pgsql-replication](docs/osm2pgsql-replication.1) can be built from source
++with `make man`.
+
+- argparse-manpage --pyfile scripts/osm2pgsql-replication --function get_parser --project-name osm2pgsql-replication --url osm2pgsql.org > docs/osm2pgsql-replication.1
+-
+-This command can be installed with:
++They need pandoc and argparse-manpage for the conversion. These tools can be
++installed with:
+
+ ```sh
+-sudo apt-get install python3-argparse-manpage
++sudo apt-get install pandoc python3-argparse-manpage
+ ```
+
+-Remove the `.SH AUTHORS` section which this command adds.
+-
+ Results should be checked into the repository.
+
+ ## Platforms targeted
=====================================
debian/patches/series
=====================================
@@ -1 +1 @@
-manpage.patch
+pr1641-osm2pgsql-replication-manpage.patch
View it on GitLab: https://salsa.debian.org/debian-gis-team/osm2pgsql/-/commit/46b6408baa22e69b6b5afe1f242bff08f869c84c
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/osm2pgsql/-/commit/46b6408baa22e69b6b5afe1f242bff08f869c84c
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20220213/3fd47614/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list