Esempio n. 1
0
static void
trk_explicit_activate_awaiter(struct pkginfo *aw)
{
	char buf[1024];
	const char *emsg;
	struct pkginfo *pend;

	if (!trk_explicit_f)
		return;

	if (fseek(trk_explicit_f, 0, SEEK_SET))
		ohshite(_("failed to rewind trigger interest file `%.250s'"),
		        trk_explicit_fn.buf);

	while (trk_explicit_fgets(buf, sizeof(buf)) >= 0) {
		char *slash;
		bool noawait = false;
		slash = strchr(buf, '/');
		if (slash && strcmp("/noawait", slash) == 0) {
			noawait = true;
			*slash = '\0';
		}
		emsg = pkg_name_is_illegal(buf, NULL);
		if (emsg)
			ohshit(_("trigger interest file `%.250s' syntax error; "
			         "illegal package name `%.250s': %.250s"),
			       trk_explicit_fn.buf, buf, emsg);
		pend = pkg_db_find(buf);
		trig_record_activation(pend, noawait ? NULL : aw,
		                       trk_explicit_trig);
	}
}
Esempio n. 2
0
void
trig_file_activate(struct fsys_namenode *trig, struct pkginfo *aw)
{
	struct trigfileint *tfi;

	for (tfi = *trigh.namenode_interested(trig); tfi;
	     tfi = tfi->samefile_next)
		trig_record_activation(tfi->pkg, (tfi->options == TRIG_NOAWAIT) ?
		                       NULL : aw, trigh.namenode_name(trig));
}
Esempio n. 3
0
static void
trk_explicit_activate_awaiter(struct pkginfo *aw)
{
	char buf[1024];
	struct pkginfo *pend;

	if (!trk_explicit_f)
		return;

	if (fseek(trk_explicit_f, 0, SEEK_SET))
		ohshite(_("failed to rewind trigger interest file '%.250s'"),
		        trk_explicit_fn.buf);

	while (trk_explicit_fgets(buf, sizeof(buf)) >= 0) {
		struct dpkg_error err;
		char *slash;
		bool noawait = false;
		slash = strchr(buf, '/');
		if (slash && strcmp("/noawait", slash) == 0) {
			noawait = true;
			*slash = '\0';
		}
		if (slash && strcmp("/await", slash) == 0) {
			noawait = false;
			*slash = '\0';
		}

		pend = pkg_spec_parse_pkg(buf, &err);
		if (pend == NULL)
			ohshit(_("trigger interest file '%.250s' syntax error; "
			         "illegal package name '%.250s': %.250s"),
			       trk_explicit_fn.buf, buf, err.str);

		trig_record_activation(pend, noawait ? NULL : aw,
		                       trk_explicit_trig);
	}
}