Skip to content

Instantly share code, notes, and snippets.

@dnaeon
dnaeon / gist:1160823
Created August 21, 2011 16:34
new pkg search and info
### INFO
tsunami# pkg info -x apache
apache-2.2.17_1: Version 2.2.x of Apache web server with prefork MPM.
tsunami# pkg info -x ap
apache-2.2.17_1: Version 2.2.x of Apache web server with prefork MPM.
apg-2.3.0b_2: An automated password generator
@dnaeon
dnaeon / gist:1160912
Created August 21, 2011 17:51
print repository in print_info()
tsunami# pkg search -fx apg
/!\ WARNING WARNING WARNING /!\
/!\ WORKING ON MULTIPLE REPOSITORIES /!\
/!\ THIS FEATURE IS STILL CONSIDERED EXPERIMENTAL /!\
/!\ YOU HAVE BEEN WARNED /!\
Name : apg
Version : 2.3.0b_2
Origin : security/apg
Prefix : /usr/local
@dnaeon
dnaeon / gist:1167691
Created August 24, 2011 09:43
pkg help / desc
tsunami# pkg
usage: pkg [-d] [-j <jail name or id>|-c <chroot path>] <command> [<args>]
Global options supported:
-d: Increment debug level
Commands supported:
add Registers a package and installs it on the system
autoremove Removes orphan packages
backup Backup and restore the local package database
@dnaeon
dnaeon / gist:1167834
Created August 24, 2011 11:25
main.c patch
diff --git a/pkg/main.c b/pkg/main.c
index ce03bef..c85d89e 100644
--- a/pkg/main.c
+++ b/pkg/main.c
@@ -37,27 +37,28 @@ static int exec_help(int, char **);
static struct commands {
const char * const name;
+ const char * const desc;
int (*exec)(int argc, char **argv);
@dnaeon
dnaeon / gist:1167997
Created August 24, 2011 12:57
somepatch
tsunami# pkg
usage: pkg [-d] [-j <jail name or id>|-c <chroot path>] <command> [<args>]
Global options supported:
-d Increment debug level
-j Execute pkg(1) inside a jail(8)
-c Execute pkg(1) inside a chroot(8)
Commands supported:
add Registers a package and installs it on the system
@dnaeon
dnaeon / gist:1197138
Created September 6, 2011 09:43
get-jail-info
#include <sys/param.h>
#include <sys/jail.h>
#include <sys/uio.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <jail.h>
#include <stdio.h>
@dnaeon
dnaeon / gist:1208272
Created September 10, 2011 12:47
pkg query - diff
diff --git a/pkg/query.c b/pkg/query.c
index 69bb6c7..ad6786e 100644
--- a/pkg/query.c
+++ b/pkg/query.c
@@ -12,6 +12,38 @@
#include "query.h"
+static struct query_flags {
+ const char flag;
diff --git a/libpkg/pkg_config.c b/libpkg/pkg_config.c
index 25acb71..d8a330b 100644
--- a/libpkg/pkg_config.c
+++ b/libpkg/pkg_config.c
@@ -21,6 +21,7 @@ static struct _config {
{ "PKG_CACHEDIR", "/var/cache/pkg", NULL},
{ "PORTSDIR", "/usr/ports", NULL },
{ "PUBKEY", "/etc/ssl/pkg.pub", NULL },
+ { "ASSUME_ALWAYS_YES", "false", NULL },
@dnaeon
dnaeon / gist:1455128
Created December 10, 2011 13:10
pw_make/gr_make
pkgdb.c:1179:22: warning: implicit declaration of function 'pw_make' is invalid in C99 [-Wimplicit-function-declaration]
strlcpy(u->uidstr, pw_make(pwd), sizeof(u->uidstr));
^
pkgdb.c:1179:22: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *'
strlcpy(u->uidstr, pw_make(pwd), sizeof(u->uidstr));
^~~~~~~~~~~~
/usr/include/string.h:90:59: note: passing argument to parameter here
size_t strlcpy(char * __restrict, const char * __restrict, size_t);
^
pkgdb.c:1207:22: warning: implicit declaration of function 'gr_make' is invalid in C99 [-Wimplicit-function-declaration]
@dnaeon
dnaeon / gist:1476196
Created December 14, 2011 11:21
RFC-6206 - bundles 1.2.0.3
smx@root> list| grep 1.2.0.3
[ 122] [Active ] [ ] [ ] [ 60] Apache ServiceMix :: Bundles :: xmlresolver (1.2.0.3)
[ 407] [Active ] [ ] [ ] [ 60] melexis libth01 (1.2.0.3)
[ 408] [Active ] [ ] [ ] [ 60] dto (1.2.0.3)
[ 409] [Resolved ] [ ] [ ] [ 60] Electronic Wafermapping :: Dao (1.2.0.3)
[ 411] [Active ] [ ] [Started] [ 60] Electronic Wafermapping :: Template engine (1.2.0.3)
[ 412] [Active ] [ ] [ ] [ 60] converter (1.2.0.3)
[ 413] [Active ] [ ] [ ] [ 60] Collection plan import :: Lot Converter (1.2.0.3)
[ 414] [Active ] [ ] [Started] [ 60] Electronic Wafermapping :: Wafermap store (1.2.0.3)
[ 415] [Active ] [ ] [Started] [ 60] Electronic Wafermapping :: Wmdb interface (1.2.0.3)