Skip to content

Instantly share code, notes, and snippets.

@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: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: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:1160798
Created August 21, 2011 16:11
print_info() - common interface for printing information from 'search' and 'info'
diff --git a/pkg/info.c b/pkg/info.c
index 6206f80..e554788 100644
--- a/pkg/info.c
+++ b/pkg/info.c
@@ -2,7 +2,6 @@
#include <err.h>
#include <inttypes.h>
-#include <libutil.h>
#include <pkg.h>
@dnaeon
dnaeon / gist:1140389
Created August 11, 2011 18:37
pkgdb.c - patch
# git diff
diff --git a/libpkg/pkgdb.c b/libpkg/pkgdb.c
index 93484e1..84df484 100644
--- a/libpkg/pkgdb.c
+++ b/libpkg/pkgdb.c
@@ -703,7 +703,9 @@ pkgdb_query_remote(struct pkgdb *db, const char *pattern)
"arch, osversion, maintainer, www, pkgsize, "
"flatsize AS newflatsize, cksum, path AS repopath "
"FROM remote.packages "
- "WHERE origin = ?1";
@dnaeon
dnaeon / gist:1140379
Created August 11, 2011 18:34
pkgng - empty jobs
tsunami# pkg info -x apg
apg-2.3.0b_2: An automated password generator
tsunami# pkg install -x apg
The following packages will be installed:
apg-2.3.0b_2
Proceed with installing packages [y/N]: y
@dnaeon
dnaeon / gist:1139944
Created August 11, 2011 15:31
pkgng - progress meter
jail-test# pkg update
http://tsunami:8000/repo.txz 100% 44KB 43.9KB/s 43.9KB/s 00:00
jail-test# pkg install -x apache
The following packages will be installed:
perl-threaded-5.10.1_3
pcre-8.12
gdbm-1.8.3_3
db42-4.2.52_5
apr-ipv6-devrandom-gdbm-db42-1.4.2.1.3.10
# jls name
1
2
3
4
5
6
7
8
10
@dnaeon
dnaeon / gist:1118638
Created August 1, 2011 17:56
pkgdb_open - leak
The following packages will be installed:
apg-2.3.0b_2
Installing apg-2.3.0b_2... done
==14049==
==14049== HEAP SUMMARY:
==14049== in use at exit: 180,527 bytes in 124 blocks
==14049== total heap usage: 2,523 allocs, 2,399 frees, 9,561,760 bytes allocated
==14049==
==14049== Searching for pointers to 124 not-freed blocks
==14049== Checked 769,136 bytes
@dnaeon
dnaeon / gist:1116796
Created July 31, 2011 13:28
test sql
SELECT rowid, origin, name, version, comment, desc, arch, arch, osversion, maintainer, www, flatsize, pkgsize, cksum, path, dbname FROM ( SELECT rowid, origin, name, version, comment, desc, arch, arch, osversion, maintainer, www, flatsize, pkgsize, cksum, path, 'dnaeon-test' AS dbname FROM 'dnaeon-test'.packages WHERE name LIKE ?1 UNION SELECT rowid, origin, name, version, comment, desc, arch, arch, osversion, maintainer, www, flatsize, pkgsize, cksum, path, 'dnaeon' AS dbname FROM 'dnaeon'.packages WHERE name LIKE ?1 );