aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix noisy find commandHEADv2.4masterRaul E Rangel2023-04-251-2/+4
| | | | | | | | | | | | | | | | | We weren't using nullglob, so the wildcard parameter was incorrectly getting passed to `find`. + pushd /build/arm64-generic//usr/share/sgml/docbook + mapfile -d '' DTDS ++ find xml-dtd-4.3/ xml-dtd-4.5/ -name docbookx.dtd -print0 + mapfile -d '' SIMPLE_DTDS ++ find 'xml-simple-dtd-*/' -name sdocbook.dtd -print0 find: ‘xml-simple-dtd-*/’: No such file or directory + popd Signed-off-by: Raul E Rangel <rrangel@chromium.org> Closes: https://github.com/gentoo/build-docbook-catalog/pull/1 Signed-off-by: Sam James <sam@gentoo.org>
* Fix incorrect cp when using ROOTRaul E Rangel2023-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | We were missing the ROOT prefix on the cp operation: + [[ -r /build/arm64-generic//etc/xml/catalog ]] + xmllint /build/arm64-generic//etc/xml/catalog + [[ ! -r /build/arm64-generic//etc/xml/catalog ]] + verb 'Found XML Catalog root /etc/xml/catalog' + false + verb ' Cleaning existing /etc/xml/docbook delegates from /etc/xml/catalog' + false + cp /etc/xml/catalog /etc/xml/catalog.tmp + clean_catalog file:///etc/xml/docbook /etc/xml/catalog.tmp + local list f regex=file:///etc/xml/docbook catalog=/build/arm64-generic//etc/xml/catalog.tmp ++ grep -E --only-matching file:///etc/xml/docbook /build/arm64-generic//etc/xml/catalog.tmp ++ sort -u grep: /build/arm64-generic//etc/xml/catalog.tmp: No such file or directory Signed-off-by: Raul E Rangel <rrangel@chromium.org> Signed-off-by: Sam James <sam@gentoo.org>
* Honour ROOT when deleting existing catalog2.3Marvin Schmidt2022-01-271-1/+1
| | | | | | | | The condition checked for `${ROOT}${ROOTCATALOG}`, but then deleted the catalog file outside of ROOT (`${ROOTCATALOG}`). Fix this by adding the missing `${ROOT}` Signed-off-by: Sam James <sam@gentoo.org>
* Place the locks in a subdirectory of /etc/xmlv2.2Andreas K. Hüttel2022-01-181-2/+2
| | | | | | | | | | | | | | | | * $ROOT/run is not mounted in stage1root during stage1 build, which leads to build failures * Even if we mount it, we don't have /run/lock in there then (applies also to stage2 and stage3). * On systemd installs we could workaround via running systemd-tmpfiles, but * On openrc installs /run/lock is created inside openrc, inaccessible for a chroot. * Crossdev users do not mount /run either. While all these things could be worked around somehow, that amounts to a lot of effort for no gain. Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* add eprefix to lockdir #816747v2.1Mike Frysinger2021-10-081-1/+2
| | | | | Bug: https://bugs.gentoo.org/816747 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tweak usage output to make --root argument clearerMike Frysinger2021-10-041-4/+4
| | | | | | Show that the --root option takes an explicit argument. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add explicit check & error message for /run/lockMike Frysinger2021-10-041-1/+6
| | | | | | | | If the system is missing its lock dir, show an explicit error message instead of confusing bash "file does not exist" errors. Bug: https://bugs.gentoo.org/816303 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* update README & dist processv2.0Mike Frysinger2021-10-023-43/+9
| | | | | | Now that we're in git, we can simplify things a lot. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* make file updates atomicMike Frysinger2021-10-021-20/+31
| | | | | | | | | | | While we have locks against other invocations of build-docbook-catalog to keep them from clobbering each other (write locks), we didn't have any locks for users of the databases (read locks). Rewriting the files in place causes those readers to get partially written files and then fail (due to missing entries). Closes: https://bugs.gentoo.org/773517 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add a --debug optionMike Frysinger2021-10-021-1/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* do not try to lint missing filesMike Frysinger2021-10-021-2/+2
| | | | | | This avoids spurious warnings of corruption when the files don't exist. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* switch locking to flockMike Frysinger2021-10-021-7/+5
| | | | | | | | | If the tool gets killed while holding its lock, the files stay locked, and future runs hang waiting for the lock, until a dev manually clears things. Switch to flock as it provides a process-based lock and the kernel will release it automatically when we exit. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* switch to arraysMike Frysinger2021-10-021-16/+17
| | | | | | | | The files we work with are supposed to be simple so this shouldn't super matter, but now that newer bash and tools have options to easily work with these, might as well switch over to fix quoting. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fix bad let conversionMike Frysinger2021-10-021-4/+4
| | | | | | | Previous commit changing away from let and to += left a var behind. Fix that up. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* use `grep -E` instead of `egrep`Mike Frysinger2021-10-021-2/+2
| | | | | | This makes shellcheck happy and is easy enough to do. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* switch from old `let` to newer `: $((...))` syntaxMike Frysinger2021-10-021-6/+6
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* handle corrupt catalogs gracefullyMike Frysinger2021-10-021-0/+10
| | | | | | | | If the files get corrupted for any reason (i.e. are not valid XML), the current code gets wedged and is unable to recover until the user deletes or fixes them. Instead, let's throw them away and start over. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Prepend ROOT with "/." when "//" redirects to network (as in Cygwin).v1.21Michael Haubenwallner2016-05-231-1/+2
| | | | Signed-off-by: Michael Haubenwallner <haubi@gentoo.org>
* merge prefix patchesv1.20Christoph Junghans2013-09-282-8/+16
| | | | Signed-off-by: Christoph Junghans <ottxor@gentoo.org>
* Don't install /etc/xml/.keep. Bug 437004.v1.19.1Mike Gilbert2012-10-021-3/+2
| | | | Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* add locking to /etc/xml dir to avoid multiple runs trashing each otherv1.19Mike Frysinger2012-03-281-5/+12
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add $ROOT support #389243 by Zdenek BehanMike Frysinger2012-03-281-28/+45
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* use $DOCBOOKDIR rather than hardcoding the full path twiceMike Frysinger2012-03-281-2/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* be consistent in variable style: ${foo} rather than $fooMike Frysinger2012-03-281-8/+8
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add quotes to path vars to be consistent, and to be defensive in case of ↵Mike Frysinger2012-03-271-13/+13
| | | | | | spaces/etc... Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add a new multi_xmlcatalog_add helper to simplify logic related to calling ↵Mike Frysinger2012-03-271-27/+62
| | | | | | `xmlcatalog --noout --add` Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* attempt to create /etc/xml if it does not exist so `rm -rf /etc/xml && ↵Mike Frysinger2012-03-271-3/+8
| | | | | | build-docbook-catalog` works Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* drop hardcoded full paths as there is no need for that -- $PATH works just fineMike Frysinger2012-03-271-3/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* check to see if DOCBOOKDIR exists before running `find` to avoid ugly errors ↵Mike Frysinger2012-03-271-3/+8
| | | | | | with missing dirs Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* use `local` rather than `typeset` to better match current Gentoo styleMike Frysinger2012-03-271-11/+11
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* document new `make dist` workflow, and add our cvs infoMike Frysinger2012-03-271-11/+9
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add a makefile to simplify build/install stepsMike Frysinger2012-03-271-0/+24
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add -h/--help optionsMike Frysinger2012-03-271-5/+22
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add an error() helperMike Frysinger2012-03-271-9/+14
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* eat trailing whitespaceMike Frysinger2011-11-011-5/+5
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Add support for simple-dtds, thanks to Yaakov S in bug #290680.v1.6Diego Pettenò2011-03-291-3/+29
| | | | Signed-off-by: Diego Pettenò <flameeyes@gentoo.org>
* Improve support for local resolver, patch by Jiri Tyr in bug #194485.v1.5Diego Pettenò2009-08-231-3/+4
| | | | Signed-off-by: Diego Pettenò <flameeyes@gentoo.org>
* Fix support for other XSL types by further delegating the catalogs.v1.4Diego Pettenò2008-09-221-12/+8
| | | | Signed-off-by: Diego Pettenò <flameeyes@gentoo.org>
* Extend build-docbook-catalog to support different types of xsl stylesheets ↵v1.3Diego Pettenò2008-09-221-17/+23
| | | | | | | | | | | | | | | (which include xsl-ns for Docbook 5). Be ready to support xsl-xalan and xsl-saxon even if they are not available in Portage too. Also, assume that the directories are unversioned, as the new ebuilds don't version them anymore. The script could be deprecated, for what concerns XSL stylesheets, by using an eclass instead. Signed-off-by: Diego Pettenò <flameeyes@gentoo.org>
* quiet down the script unless --verbose is specifiedv1.2Aron Griffis2004-07-221-15/+34
| | | | Signed-off-by: Aron Griffis <agriffis@gentoo.org>
* see bug 52725v1.1Aron Griffis2004-06-302-0/+298
Signed-off-by: Aron Griffis <agriffis@gentoo.org>