diff options
author | 2009-08-23 06:06:49 +0000 | |
---|---|---|
committer | 2009-08-23 06:06:49 +0000 | |
commit | 16f950771387cba76565a872198503da4948b597 (patch) | |
tree | 89df1b23c7fd70f20fd53cd8a7f3e4a7f139c322 | |
parent | - Refactor fetching logic (Zdenek Behan <behanz[@]seznam[dot]cz>). bug 266455 (diff) | |
download | portage-utils-16f950771387cba76565a872198503da4948b597.tar.gz portage-utils-16f950771387cba76565a872198503da4948b597.tar.bz2 portage-utils-16f950771387cba76565a872198503da4948b597.zip |
- old patch that needs pushing. I think it fixed the -rX problem with qpkg
-rw-r--r-- | main.c | 7 | ||||
-rw-r--r-- | qpkg.c | 14 |
2 files changed, 13 insertions, 8 deletions
@@ -1,7 +1,7 @@ /* * Copyright 2005-2008 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.162 2009/03/24 20:53:24 grobian Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.163 2009/08/23 06:07:07 solar Exp $ * * Copyright 2005-2008 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2008 Mike Frysinger - <vapier@gentoo.org> @@ -946,6 +946,11 @@ void cache_free(portage_cache *cache) free(cache); } +char *atom_to_pvr(depend_atom *atom); +char *atom_to_pvr(depend_atom *atom) { + return (atom->PR_int == 0 ? atom->P : atom->PVR ); +} + char *grab_vdb_item(const char *, const char *, const char *); char *grab_vdb_item(const char *item, const char *CATEGORY, const char *PF) { @@ -1,7 +1,7 @@ /* * Copyright 2005-2007 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qpkg.c,v 1.26 2007/11/04 09:51:58 solar Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qpkg.c,v 1.27 2009/08/23 06:06:49 solar Exp $ * * Copyright 2005-2007 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org> @@ -24,7 +24,7 @@ static const char *qpkg_opts_help[] = { "alternate package directory", COMMON_OPTS_HELP }; -static const char qpkg_rcsid[] = "$Id: qpkg.c,v 1.26 2007/11/04 09:51:58 solar Exp $"; +static const char qpkg_rcsid[] = "$Id: qpkg.c,v 1.27 2009/08/23 06:06:49 solar Exp $"; #define qpkg_usage(ret) usage(ret, QPKG_FLAGS, qpkg_long_opts, qpkg_opts_help, lookup_applet_idx("qpkg")) extern char pretend; @@ -206,11 +206,11 @@ int qpkg_make(depend_atom *atom) struct stat st; if (pretend) { - printf(" %s-%s %s/%s:\n", GREEN, NORM, atom->CATEGORY, atom->P); + printf(" %s-%s %s/%s:\n", GREEN, NORM, atom->CATEGORY, atom_to_pvr(atom)); return 0; } - snprintf(buf, sizeof(buf), "%s/%s/%s/CONTENTS", portvdb, atom->CATEGORY, atom->P); + snprintf(buf, sizeof(buf), "%s/%s/%s/CONTENTS", portvdb, atom->CATEGORY, atom_to_pvr(atom)); if ((fp = fopen(buf, "r")) == NULL) return -1; @@ -245,7 +245,7 @@ int qpkg_make(depend_atom *atom) fclose(out); fclose(fp); - printf(" %s-%s %s/%s: ", GREEN, NORM, atom->CATEGORY, atom->P); + printf(" %s-%s %s/%s: ", GREEN, NORM, atom->CATEGORY, atom_to_pvr(atom)); fflush(stdout); snprintf(tbz2, sizeof(tbz2), "%s/bin.tar.bz2", tmpdir); @@ -255,7 +255,7 @@ int qpkg_make(depend_atom *atom) pclose(fp); snprintf(xpak, sizeof(xpak), "%s/inf.xpak", tmpdir); - snprintf(buf, sizeof(buf), "%s/%s/%s", portvdb, atom->CATEGORY, atom->P); + snprintf(buf, sizeof(buf), "%s/%s/%s", portvdb, atom->CATEGORY, atom_to_pvr(atom)); xpak_argv[0] = buf; xpak_argv[1] = NULL; xpak_create(xpak, 1, xpak_argv); @@ -267,7 +267,7 @@ int qpkg_make(depend_atom *atom) unlink(xpak); unlink(tbz2); - snprintf(tbz2, sizeof(tbz2), "%s/%s.tbz2", qpkg_get_bindir(), atom->P); + snprintf(tbz2, sizeof(tbz2), "%s/%s.tbz2", qpkg_get_bindir(), atom_to_pvr(atom)); if (rename(buf, tbz2)) { warnp("could not move '%s' to '%s'", buf, tbz2); return 1; |