[arch-dev-public] devtools: double slashes in mkarchroot
Jürgen Hötzel
juergen at hoetzel.info
Mon Sep 22 07:41:15 EDT 2008
Hi
On Sun, Sep 21, 2008 at 03:16:02PM +0300, Roman Kyrylych wrote:
> Hi all!
>
> Got to chrooting today, to get my packaging process correct.
> Here's what I've got:
>
> [root at vostro ~]# echo $CHROOT_SHELL
> /chroot64
> [root at vostro ~]# mkarchroot $CHROOT_SHELL/root base base-devel sudo
> mounting sysfs : /sys
> mounting procfs : /proc
> binding device nodes : /dev
> binding pacman cache : /var/cache/pacman
> installing packages:
> base
> base-devel
> sudo
> Root : /chroot64/root/
> Conf File : /etc/pacman.conf
> DB Path : /chroot64/root//var/lib/pacman/
> Cache Dirs: /var/cache/pacman/pkg/
> Lock File : /chroot64/root//var/lib/pacman/db.lck
> Log File : /chroot64/root//var/log/pacman.log
> Targets : base base-devel sudo
>
> Notice the //
> I've looked into the source, but haven't found what causes / to appear
> after /chroot64/root
I also ran in this issue. libalpm always ensures that paths end with
"/". Dan, can you check the fix?
Jürgen
-------------- next part --------------
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 155f8da..37e586e 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -262,11 +262,11 @@ static void setlibpaths(void)
cleanup(ret);
}
if(!config->dbpath) {
- snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), DBPATH);
+ snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), DBPATH + 1);
config->dbpath = strdup(path);
}
if(!config->logfile) {
- snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), LOGFILE);
+ snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), LOGFILE + 1);
config->logfile = strdup(path);
}
}
More information about the arch-dev-public
mailing list