diff options
Diffstat (limited to 'usr.sbin/pkg_install/lib/plist.c')
-rw-r--r-- | usr.sbin/pkg_install/lib/plist.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c index c60e589..e46d6de 100644 --- a/usr.sbin/pkg_install/lib/plist.c +++ b/usr.sbin/pkg_install/lib/plist.c @@ -42,6 +42,18 @@ add_plist(Package *p, plist_t type, const char *arg) p->tail->next = tmp; p->tail = tmp; } + switch (type) { + case PLIST_NAME: + p->name = tmp->name; + break; + + case PLIST_ORIGIN: + p->origin = tmp->name; + break; + + default: + break; + } } void @@ -210,9 +222,13 @@ plist_cmd(const char *s, char **arg) return PLIST_CHOWN; else if (!strcmp(cmd, "group")) return PLIST_CHGRP; - else if (!strcmp(cmd, "comment")) + else if (!strcmp(cmd, "comment")) { + if (!strncmp(*arg, "ORIGIN:", 7)) { + *arg += 7; + return PLIST_ORIGIN; + } return PLIST_COMMENT; - else if (!strcmp(cmd, "ignore")) + } else if (!strcmp(cmd, "ignore")) return PLIST_IGNORE; else if (!strcmp(cmd, "ignore_inst")) return PLIST_IGNORE_INST; |