[pacman-dev] [PATCH] Refactor pkg_load/parse_descfile into a new backend file
Dan McGee
dpmcgee at gmail.com
Tue May 13 08:15:59 EDT 2008
On Tue, May 13, 2008 at 4:43 AM, Xavier <shiningxc at gmail.com> wrote:
>
> On Sun, May 11, 2008 at 6:40 PM, Dan McGee <dan at archlinux.org> wrote:
> > alpm_pkg_load() and parse_descfile() are specific to getting information
> > from package files, just as other code is specific to getting information
> > into or out of a package database. Move this code out of package.c, which
> > should eventually only contain operators on the pmpkg_t struct that do not
> > depend at all on where the data came from.
> >
> > Signed-off-by: Dan McGee <dan at archlinux.org>
> > ---
> > lib/libalpm/Makefile.am | 1 +
> > lib/libalpm/be_package.c | 283 ++++++++++++++++++++++++++++++++++++++++++++++
> > lib/libalpm/package.c | 244 +---------------------------------------
> > lib/libalpm/package.h | 1 -
> > 4 files changed, 285 insertions(+), 244 deletions(-)
> > create mode 100644 lib/libalpm/be_package.c
> >
> > diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am
> > index 7b73736..871855e 100644
> > --- a/lib/libalpm/Makefile.am
> > +++ b/lib/libalpm/Makefile.am
> > @@ -26,6 +26,7 @@ libalpm_la_SOURCES = \
> > alpm_list.h alpm_list.c \
> > backup.h backup.c \
> > be_files.c \
> > + be_package.c \
> > cache.h cache.c \
> > conflict.h conflict.c \
> > db.h db.c \
> > diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
> > new file mode 100644
> > index 0000000..4df3228
> > --- /dev/null
> > +++ b/lib/libalpm/be_package.c
> > @@ -0,0 +1,283 @@
> > +/*
> > + * be_package.c
> > + *
> > + * Copyright (c) 2002-2008 by Judd Vinet <jvinet at zeroflux.org>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program. If not, see <http://www.gnu.org/licenses/>.
> > + */
> > +
> > +#include "config.h"
> > +
> > +#include <stdio.h>
> > +#include <stdlib.h>
> > +#include <string.h>
> > +#include <limits.h>
> > +#include <ctype.h>
> > +#include <locale.h> /* setlocale */
> > +
> > +/* libarchive */
> > +#include <archive.h>
> > +#include <archive_entry.h>
> > +
> > +/* libalpm */
> > +#include "alpm_list.h"
> > +#include "util.h"
> > +#include "log.h"
> > +#include "error.h"
> > +#include "package.h"
> > +#include "deps.h" /* _alpm_splitdep */
> > +
>
> What is this error.h file here?
> I don't see any other files who include that header.
> What is weird is I think this built fine on my laptop. But here with
> cygwin I don't have any error.h header so the compilation simply
> failed.
> After removing it, everything works perfectly.
> I'm confused..
Looks like that snuck in from the way-old patch (take a look a the
date). We used to have an error.h that contained not much of anything;
that was removed in commit 4c872594da321aa406cfb306c32c94ce2929d59e
and I obviously missed the bus on this.
The patch is trival- remove it.
-Dan
More information about the pacman-dev
mailing list