PERFORCE change 185063 for review
David Forsythe
dforsyth at FreeBSD.org
Mon Oct 25 02:01:59 UTC 2010
http://p4web.freebsd.org/@@185063?ac=10
Change 185063 by dforsyth at skunk on 2010/10/25 02:01:05
Small naming fixes. Apparently I broke pkg_info a lot of pkg_info output,
so started fixing that. Also add reqby.
Affected files ...
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/database.c#6 edit
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/file.c#4 edit
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/file.h#4 edit
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/freebsd_plist.c#5 edit
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg.c#8 edit
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg.h#7 edit
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg_internal.h#6 edit
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg_pkg.h#7 edit
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/reqby.c#1 add
.. //depot/projects/soc2010/dforsyth_libpkg/libpkg/reqby.h#1 add
.. //depot/projects/soc2010/dforsyth_libpkg/pkg_install/pkg_info/pkg_info.c#4 edit
Differences ...
==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/database.c#6 (text+ko) ====
@@ -144,7 +144,7 @@
/* Do the add and set up pkg. */
if (db->add(db, pkg, name, origin, comment, description) != PKG_OK) {
- pkg_free(pkg);
+ pkg_release(pkg);
return (NULL);
}
==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/file.c#4 (text+ko) ====
@@ -13,6 +13,12 @@
return (calloc(1, sizeof(struct pkg_file)));
}
+void
+pkg_file_release(struct pkg_file *file)
+{
+ free(file);
+}
+
const char *
pkg_file_prefix(struct pkg_file *file)
{
==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/file.h#4 (text+ko) ====
@@ -29,6 +29,7 @@
TAILQ_HEAD(pkg_file_list, pkg_file);
struct pkg_file *pkg_file_alloc(void);
+void pkg_file_release(struct pkg_file *);
const char *pkg_file_prefix(struct pkg_file *);
const char *pkg_file_pathname(struct pkg_file *);
@@ -38,6 +39,9 @@
const struct stat *pkg_file_stat(struct pkg_file *);
+/* These only set the fields in the immediate object, they don't touch the db.
+ * */
+
void _pkg_file_set_prefix(struct pkg_file *, const char *);
void _pkg_file_set_pathname(struct pkg_file *,
const char *);
==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/freebsd_plist.c#5 (text+ko) ====
==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg.c#8 (text+ko) ====
@@ -24,18 +24,11 @@
struct pkg *
pkg_alloc(void)
{
- struct pkg *pkg;
-
- pkg = calloc(1, sizeof(*pkg));
- if (pkg == NULL) {
- return (NULL);
- }
-
- return (pkg);
+ return (calloc(1, sizeof(struct pkg)));
}
void
-pkg_free(struct pkg *pkg)
+pkg_release(struct pkg *pkg)
{
free(pkg);
}
==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg.h#7 (text+ko) ====
==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg_internal.h#6 (text+ko) ====
@@ -67,6 +67,6 @@
TAILQ_HEAD(pkg_list, pkg);
struct pkg *pkg_alloc(void);
-void pkg_free(struct pkg *);
+void pkg_release(struct pkg *);
#endif
==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg_pkg.h#7 (text+ko) ====
@@ -37,16 +37,23 @@
const char *, int);
void _pkg_append_file(struct pkg *,
struct pkg_file *);
+void pkg_file_finish(struct pkg *pkg,
+ struct pkg_file *file);
struct pkg_depend *pkg_add_depend(struct pkg *, const char *,
const char *);
void _pkg_append_depend(struct pkg *,
struct pkg_depend *);
+void pkg_depend_finish(struct pkg *pkg,
+ struct pkg_depend *);
+
struct pkg_conflict *pkg_add_conflict(struct pkg *, const char *,
const char *);
void _pkg_append_conflict(struct pkg *,
struct pkg_conflict *);
+void pkg_conflict_finish(struct pkg *,
+ struct pkg_conflict *);
struct pkg_file_list *pkg_files(struct pkg *); /* This should take a
prefix argument. */
==== //depot/projects/soc2010/dforsyth_libpkg/pkg_install/pkg_info/pkg_info.c#4 (text+ko) ====
@@ -559,10 +559,6 @@
printf("%s%s:", _c->info_prefix, pkg_name(pkg));
if (_c->show_flags & SHOW_PLIST)
- if (!_c->quiet)
- printf("%sPacking list:\n", _c->info_prefix);
-
- if (_c->show_flags & SHOW_PLIST)
/* TODO: Write a show plist function for this flag
* because the output is jacked in this case. */
if (!_c->quiet)
@@ -596,7 +592,7 @@
pkg_depend_origin(depend));
}
/* Separator. */
- printf("\n");
+ // printf("\n");
}
if (_c->show_flags & SHOW_REQBY) {
@@ -662,7 +658,7 @@
files = pkg_files(pkg);
TAILQ_FOREACH(file, files, next) {
if (last_prefix == NULL)
- pkg_file_prefix(file);
+ last_prefix = pkg_file_prefix(file);
else {
/* Check to see is the prefix has
* changes. */
More information about the p4-projects
mailing list