Deleted Added
full compact
deps.c (96076) deps.c (96392)
1/*
2 * FreeBSD install - a package for the installation and maintainance
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 6 unchanged lines hidden (view full) ---

15 * 14 March 2001
16 *
17 * Routines used to do various operations with dependencies
18 * among installed packages.
19 *
20 */
21
22#include <sys/cdefs.h>
1/*
2 * FreeBSD install - a package for the installation and maintainance
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 6 unchanged lines hidden (view full) ---

15 * 14 March 2001
16 *
17 * Routines used to do various operations with dependencies
18 * among installed packages.
19 *
20 */
21
22#include <sys/cdefs.h>
23__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/lib/deps.c 96076 2002-05-05 21:03:25Z sobomax $");
23__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/lib/deps.c 96392 2002-05-11 04:17:55Z alfred $");
24
25#include "lib.h"
26#include <err.h>
27#include <stdio.h>
28
29/*
30 * Sort given NULL-terminated list of installed packages (pkgs) in
31 * such a way that if package A depends on package B then after

--- 148 unchanged lines hidden (view full) ---

180 if (strict == TRUE)
181 warnx("package '%s' is recorded in the '%s' but isn't "
182 "actually installed", fbuf, fname);
183 continue;
184 }
185 retval++;
186 rb_entry = malloc(sizeof(*rb_entry));
187 if (rb_entry == NULL) {
24
25#include "lib.h"
26#include <err.h>
27#include <stdio.h>
28
29/*
30 * Sort given NULL-terminated list of installed packages (pkgs) in
31 * such a way that if package A depends on package B then after

--- 148 unchanged lines hidden (view full) ---

180 if (strict == TRUE)
181 warnx("package '%s' is recorded in the '%s' but isn't "
182 "actually installed", fbuf, fname);
183 continue;
184 }
185 retval++;
186 rb_entry = malloc(sizeof(*rb_entry));
187 if (rb_entry == NULL) {
188 warnx("%s(): malloc() failed", __FUNCTION__);
188 warnx("%s(): malloc() failed", __func__);
189 retval = -1;
190 break;
191 }
192 strlcpy(rb_entry->pkgname, fbuf, sizeof(rb_entry->pkgname));
193 STAILQ_INSERT_TAIL(&rb_list, rb_entry, link);
194 }
195 fclose(fp);
196
197 return retval;
198}
189 retval = -1;
190 break;
191 }
192 strlcpy(rb_entry->pkgname, fbuf, sizeof(rb_entry->pkgname));
193 STAILQ_INSERT_TAIL(&rb_list, rb_entry, link);
194 }
195 fclose(fp);
196
197 return retval;
198}