Skip to content

Commit

Permalink
various misc patches submitted by Jeremy Reed
Browse files Browse the repository at this point in the history
  • Loading branch information
imilh committed Jun 13, 2012
1 parent 63dfe55 commit d382b05
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 22 deletions.
4 changes: 3 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.19 2012/05/30 09:27:12 imilh Exp $
# $Id: Makefile.in,v 1.20 2012/06/13 13:50:16 imilh Exp $

PROG= pkgin
VERSION= @PACKAGE_VERSION@
Expand Down Expand Up @@ -79,6 +79,8 @@ CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES
CPPFLAGS+= -DCHECK_MACHINE_ARCH=\"${MACHINE_ARCH}\"
CPPFLAGS+= -Iexternal -I. -I${LOCALBASE}/include

LDFLAGS+= @LDFLAGS@

LDADD+= -L${LOCALBASE}/lib @RPATH@,${LOCALBASE}/lib \
-lbz2 -lz -larchive @LIBS@
LDADD+= -lsqlite3
Expand Down
2 changes: 2 additions & 0 deletions external/automatic.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions external/decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
#include "config.h"
#endif

#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif

#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
Expand Down
2 changes: 2 additions & 0 deletions external/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif
#if HAVE_ERR_H
#include <err.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions external/dewey.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif

#if HAVE_CTYPE_H
#include <ctype.h>
Expand Down
2 changes: 2 additions & 0 deletions external/fexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions external/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
Expand Down
6 changes: 2 additions & 4 deletions external/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
Expand Down Expand Up @@ -69,10 +71,6 @@

#include "path.h"

#ifndef __UNCONST
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
#endif

/* Macros */
#define SUCCESS (0)
#define FAIL (-1)
Expand Down
2 changes: 2 additions & 0 deletions external/opattern.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions external/pkgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions external/var.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_NBCOMPAT_H
#include <nbcompat.h>
#endif
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
Expand Down
3 changes: 2 additions & 1 deletion fsops.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: fsops.c,v 1.2 2012/04/15 11:48:56 imilh Exp $ */
/* $Id: fsops.c,v 1.3 2012/06/13 13:50:17 imilh Exp $ */

/*
* Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -32,6 +32,7 @@

#include "pkgin.h"
#include <dirent.h>
#include <sys/statvfs.h>

#define FILE_OFFSET_BITS 64 /* needed for large filesystems on sunos */

Expand Down
11 changes: 10 additions & 1 deletion htdocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ <h3>Disclaimer</h3>
<a name="req"><h3>Prerequisites</h3></a>

<p>
<i>pkgin</i> is developed using the C language. It uses <code>sqlite3</code> as a package database backend, in order to provide good speed on older architectures. <i>SQLite</i> is included in <i>pkgin's</i> source tree so you don't have to install it by yourself, it will simply be built along with <i>pkgin</i>.
<i>pkgin</i> is developed using the C language. It uses <code>sqlite3</code> as a package database backend, in order to provide good speed on older architectures.
</p>
<p>If you wish to build <i>pkgin</i> from sources, the following dependencies must be met
<ul>
<li><code>databases/sqlite3</code></li>
<li><code>pkgtools/libnbcompat</code> (yes, even for <i>NetBSD</i>)</li>
<li><code>net/libfetch</code></li>
<li><code>archivers/libarchive</code></li>
</ul>
Since <i>NetBSD</i> 6.0, all of those are provided as part of the base system, except for <code>libnbcompat</code>.
</p>
<p>
<code>Pkgin</code> is available via CVS, <a href="http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/pkgin/">pkgsrc-wip</a> and is available in <a href="http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/pkgtools/pkgin/">pkgsrc</a> as <code>pkgtools/pkgin</code>.
</p>
Expand Down
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.29 2012/05/28 10:56:27 imilh Exp $ */
/* $Id: main.c,v 1.30 2012/06/13 13:50:17 imilh Exp $ */

/*
* Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -111,7 +111,7 @@ main(int argc, char *argv[])
argv += optind;

if (argc < 1) {
fprintf(stderr, MSG_MISSING_CMD);
fprintf(stderr, "%s\n", MSG_MISSING_CMD);
usage();
/* NOTREACHED */
}
Expand Down
10 changes: 9 additions & 1 deletion pkgin.1
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,17 @@ space separated repositories in order to override
.Sh FILES
.Bl -tag -width Ds -compact
.It /usr/pkg/etc/pkgin/repositories.conf
This file contains a list of repositories that
This file contains a list of repository URIs that
.Nm
will use.
It may contain macros
.Va $arch
to define the machine hardware platform
and
.Va $osrelease
to define the release version for the operating system
(as reported by
.Xr uname 3 ) .
.El
.Sh EXAMPLES
.Pp
Expand Down
8 changes: 6 additions & 2 deletions repositories.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# $Id: repositories.conf,v 1.2 2011/09/16 10:17:42 imilh Exp $
# $Id: repositories.conf,v 1.3 2012/06/13 13:50:17 imilh Exp $
#
# Pkgin repositories list
#
# Simply add repositories one below the other
# Simply add repositories URIs one below the other
#
# WARNING: order matters, duplicates will not be added, if two
# repositories hold the same package, it will be fetched from
# the first one listed in this file.
#
# This file format supports the following macros:
# $arch to define the machine hardware platform
# $osrelease to define the release version for the operating system
#
# Remote ftp repository
#
# ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/$arch/5.1/All
Expand Down
7 changes: 4 additions & 3 deletions summary.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: summary.c,v 1.31 2012/05/28 12:25:14 imilh Exp $ */
/* $Id: summary.c,v 1.32 2012/06/13 13:50:17 imilh Exp $ */

/*
* Copyright (c) 2009, 2010, 2011, 2012 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -395,6 +395,7 @@ update_col(struct Summary sum, int pkgid, char *line)
}
}

/* default version for (rare and buggy) packages with a version */
#define NOVERSION "-0.0"

static void
Expand Down Expand Up @@ -577,8 +578,9 @@ update_localdb(char **pkgkeep)
*/
if ((nokeeplisthead =
rec_pkglist(NOKEEP_LOCAL_PKGS)) != NULL) {
SLIST_FOREACH(pkglist, nokeeplisthead, next)
SLIST_FOREACH(pkglist, nokeeplisthead, next) {
mark_as_automatic_installed(pkglist->full, 1);
}

free_pkglist(&nokeeplisthead, LIST);
}
Expand Down Expand Up @@ -658,7 +660,6 @@ update_remotedb(void)
cleaned = 1;
}


printf(MSG_PROCESSING_REMOTE_SUMMARY, *prepos);

/* delete remote* associated to this repository */
Expand Down
6 changes: 3 additions & 3 deletions tools.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: tools.c,v 1.3 2011/10/06 15:13:49 imilh Exp $ */
/* $Id: tools.c,v 1.4 2012/06/13 13:50:17 imilh Exp $ */

/*
* Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -191,7 +191,7 @@ exec_list(const char *cmd, const char *match)
return(res);
}

T_Bool
uint8_t
is_listed(const char **list, const char *item)
{
for (; *list != NULL; list++)
Expand Down Expand Up @@ -273,7 +273,7 @@ strreplace(char *str, const char *from, const char *to)
fromlen = strlen(from);
tolen = strlen(to);

for (i = 0, p = str; *p != 0;) {
for (i = 0, p = str; *p != '\0';) {
if (strncmp(p, from, fromlen) == 0) {
strncat(buf, to, tolen);
p += fromlen;
Expand Down
6 changes: 2 additions & 4 deletions tools.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: tools.h,v 1.3 2011/10/06 15:13:49 imilh Exp $ */
/* $Id: tools.h,v 1.4 2012/06/13 13:50:17 imilh Exp $ */

/*
* Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -189,8 +189,6 @@
dst = pdst; \
} while (/* CONSTCOND */ 0)

typedef uint8_t T_Bool;

#ifndef SLIST_FOREACH_MUTABLE /* from DragonFlyBSD */
#define SLIST_FOREACH_MUTABLE(var, head, field, tvar) \
for ((var) = SLIST_FIRST((head)); \
Expand All @@ -206,7 +204,7 @@ extern int min(int, int);
extern int max(int, int);
extern int listlen(const char **);
extern char **exec_list(const char *, const char *);
extern T_Bool is_listed(const char **, const char *);
extern uint8_t is_listed(const char **, const char *);
extern void do_log(const char *, const char *, ...);
extern void trunc_str(char *, char, int);
extern char *safe_snprintf(int, const char *, ...);
Expand Down

0 comments on commit d382b05

Please sign in to comment.