From 65c18807350b2bedff0546b839fd5cd0004a6d4f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 19 May 2011 17:42:22 -0500 Subject: [PATCH 1/5] Bail early if we don't have a valid lockfile path This addresses FS#24292. If one does the bad thing of not checking pm_errno after calling set_dbpath(), you may not realize the initialization process went wrong and calling trans_init() resulted in a segfault. If we don't have a lockfile path, bail out and have trans_init() fail. Also remove a ALPM_LOG_FUNC call that was causing pm_errno to return "no handle"; this was due to a log call in the handle setup (whereby the log attempts to use a callback attached to the handle). Signed-off-by: Dan McGee --- lib/libalpm/handle.c | 2 -- lib/libalpm/trans.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index d8ce9fd2..586aad1e 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -46,8 +46,6 @@ pmhandle_t *_alpm_handle_new() { pmhandle_t *handle; - ALPM_LOG_FUNC; - CALLOC(handle, 1, sizeof(pmhandle_t), RET_ERR(PM_ERR_MEMORY, NULL)); return(handle); diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 7affbfbd..bf9ef722 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -58,6 +58,8 @@ static int make_lock(pmhandle_t *handle) int fd; char *dir, *ptr; + ASSERT(handle->lockfile != NULL, return -1); + /* create the dir of the lockfile first */ dir = strdup(handle->lockfile); ptr = strrchr(dir, '/'); @@ -110,7 +112,6 @@ int SYMEXPORT alpm_trans_init(pmtransflag_t flags, /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); - ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1)); /* lock db */ From e711e5b9501adcb692c65e7d358ae5b0e5bcfb57 Mon Sep 17 00:00:00 2001 From: Pang Yan Han Date: Tue, 24 May 2011 11:25:13 +0800 Subject: [PATCH 2/5] alpm_list: fix typo in doxygen comment Signed-off-by: Pang Yan Han Signed-off-by: Dan McGee --- lib/libalpm/alpm_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c index f0619bcd..42ef367a 100644 --- a/lib/libalpm/alpm_list.c +++ b/lib/libalpm/alpm_list.c @@ -287,7 +287,7 @@ alpm_list_t SYMEXPORT *alpm_list_msort(alpm_list_t *list, size_t n, alpm_list_fn /** * @brief Remove an item from the list. - * item is not freed; this is the responsiblity of the caller. + * item is not freed; this is the responsibility of the caller. * * @param haystack the list to remove the item from * @param item the item to remove from the list From 1855b3073a33874a80d64e40296050641d63cd63 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 1 Jun 2011 11:46:13 -0500 Subject: [PATCH 3/5] doc: add a few more escapes and fix usage of {} These addditional attributes come from the git asciidoc.conf file. Also, fix a place where we used {treename} without escaping the braces, causing the generated manpage to be missing text. Signed-off-by: Dan McGee --- doc/asciidoc.conf | 4 ++++ doc/pacman.conf.5.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf index 3ea510d8..e2e72672 100644 --- a/doc/asciidoc.conf +++ b/doc/asciidoc.conf @@ -17,7 +17,11 @@ plus=+ caret=^ startsb=[ endsb=] +backslash=\ tilde=~ +apostrophe=' +backtick=` +litdd=-- ifdef::backend-docbook[] [linkman-inlinemacro] diff --git a/doc/pacman.conf.5.txt b/doc/pacman.conf.5.txt index bfa07458..9f1d1846 100644 --- a/doc/pacman.conf.5.txt +++ b/doc/pacman.conf.5.txt @@ -215,7 +215,7 @@ directory with these packages so pacman can find it when run with '\--refresh'. The above command will generate a compressed database named '/home/pkgs/custom.db.tar.gz'. Note that the database must be of the form -'{treename}.db.tar.gz', where '{treename}' is the name of the section defined in +'\{treename\}.db.tar.gz', where '\{treename\}' is the name of the section defined in the configuration file. That's it! Now configure your custom section in the configuration file as shown in the config example above. Pacman will now use your package repository. If you add new packages to the repository, remember to From ac1726788c4bf9ae335df9f69f14a5f80208c413 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 1 Jun 2011 12:10:32 -0500 Subject: [PATCH 4/5] doc: update Makefile for new asciidoc resource location Signed-off-by: Dan McGee --- doc/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 00a0e88d..afb8e8f2 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -86,9 +86,9 @@ html: $(HTML_DOCS) website: html bsdtar czf website.tar.gz $(HTML_DOCS) \ -C /etc/asciidoc/stylesheets/ \ - xhtml11.css xhtml11-manpage.css xhtml11-quirks.css \ + asciidoc.css asciidoc-manpage.css \ -C /etc/asciidoc/javascripts/ \ - asciidoc-xhtml11.js \ + asciidoc.js \ -C /etc/asciidoc/ \ images From aad57cc06ac60dc8fdcff9bea811e990d64f74d3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 1 Jun 2011 12:11:31 -0500 Subject: [PATCH 5/5] doc: fix attribute substitution in monospaced text When I switched all paths to use `` formatting, I didn't realize substitution didn't work in these quote marks. Use ++ instead to ensure attributes are substituted where appropriate. Signed-off-by: Dan McGee --- doc/makepkg.8.txt | 2 +- doc/pacman.8.txt | 4 ++-- doc/pacman.conf.5.txt | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index c59800c6..57d6f6eb 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -53,7 +53,7 @@ Options in linkman:makepkg.conf[5]. *\--config* :: - Use an alternate config file instead of the `{sysconfdir}/makepkg.conf` + Use an alternate config file instead of the +{sysconfdir}/makepkg.conf+ default. *-d, \--nodeps*:: diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt index a66bd4a9..a4d41d0e 100644 --- a/doc/pacman.8.txt +++ b/doc/pacman.8.txt @@ -117,7 +117,7 @@ Options ------- *-b, \--dbpath* :: Specify an alternative database location (a typical default is - `{localstatedir}/lib/pacman`). This should not be used unless you know what you are + +{localstatedir}/lib/pacman+). This should not be used unless you know what you are doing. *NOTE*: if specified, this is an absolute path and the root path is not automatically prepended. @@ -138,7 +138,7 @@ Options *\--cachedir* :: Specify an alternative package cache location (a typical default is - `{localstatedir}/cache/pacman/pkg`). Multiple cache directories can be specified, + +{localstatedir}/cache/pacman/pkg+). Multiple cache directories can be specified, and they are tried in the order they are passed to pacman. *NOTE*: this is an absolute path, the root path is not automatically prepended. diff --git a/doc/pacman.conf.5.txt b/doc/pacman.conf.5.txt index 9f1d1846..dcaeed7f 100644 --- a/doc/pacman.conf.5.txt +++ b/doc/pacman.conf.5.txt @@ -35,7 +35,7 @@ NoUpgrade = etc/passwd etc/group etc/shadow NoUpgrade = etc/fstab [core] -Include = {sysconfdir}/pacman.d/core +Include = /etc/pacman.d/core [custom] Server = file:///home/pkgs @@ -57,13 +57,13 @@ Options *DBPath =* path/to/db/dir:: Overrides the default location of the toplevel database directory. A - typical default is `{localstatedir}/lib/pacman/`. Most users will not need to set + typical default is +{localstatedir}/lib/pacman/+. Most users will not need to set this option. *NOTE*: if specified, this is an absolute path and the root path is not automatically prepended. *CacheDir =* path/to/cache/dir:: Overrides the default location of the package cache directory. A typical - default is `{localstatedir}/cache/pacman/pkg/`. Multiple cache directories can be + default is +{localstatedir}/cache/pacman/pkg/+. Multiple cache directories can be specified, and they are tried in the order they are listed in the config file. If a file is not found in any cache directory, it will be downloaded to the first cache directory with write access. *NOTE*: this is an absolute @@ -72,7 +72,7 @@ Options *LogFile =* '/path/to/file':: Overrides the default location of the pacman log file. A typical default - is `{localstatedir}/log/pacman.log`. This is an absolute path and the root directory + is +{localstatedir}/log/pacman.log+. This is an absolute path and the root directory is not prepended. *HoldPkg =* package ...:: @@ -149,7 +149,7 @@ Options *UseSyslog*:: Log action messages through syslog(). This will insert log entries into - `{localstatedir}/log/messages` or equivalent. + +{localstatedir}/log/messages+ or equivalent. *ShowSize*:: Display the size of individual packages for '\--sync' and '\--query' modes.