Commit 4cbe6a47 authored by Baptiste Daroussin's avatar Baptiste Daroussin
Browse files

plist: remove support for ancient pkg tools time

parent 12d7f45a
Changes from 1.16.99.3 to 1.16.99.4 Changes from 1.16.99.3 to 1.16.99.4
- expose the name of the packages to its scripts lua and shell - expose the name of the packages to its scripts lua and shell
- remove internal support for @*exec - plist: remove internal support for @*exec
- remove support for @ignore - plist: remove support for @ignore
- plist: remove suppot for @dirrm/@dirrmtry
- plist: remove support for @pkgdep
- plist: remove stub support for @stopdaemon
- plist: remove stub support for @display
- plist: remove stub support for @mtree
- plist: remove stub support for @conflict
Changes from 1.16.99.2 to 1.16.99.3 Changes from 1.16.99.2 to 1.16.99.3
- lua update to 5.4.2 - lua update to 5.4.2
......
...@@ -59,7 +59,6 @@ static ucl_object_t *keyword_schema = NULL; ...@@ -59,7 +59,6 @@ static ucl_object_t *keyword_schema = NULL;
static int setprefix(struct plist *, char *, struct file_attr *); static int setprefix(struct plist *, char *, struct file_attr *);
static int dir(struct plist *, char *, struct file_attr *); static int dir(struct plist *, char *, struct file_attr *);
static int dirrm(struct plist *, char *, struct file_attr *);
static int file(struct plist *, char *, struct file_attr *); static int file(struct plist *, char *, struct file_attr *);
static int setmod(struct plist *, char *, struct file_attr *); static int setmod(struct plist *, char *, struct file_attr *);
static int setowner(struct plist *, char *, struct file_attr *); static int setowner(struct plist *, char *, struct file_attr *);
...@@ -68,7 +67,6 @@ static int comment_key(struct plist *, char *, struct file_attr *); ...@@ -68,7 +67,6 @@ static int comment_key(struct plist *, char *, struct file_attr *);
static int config(struct plist *, char *, struct file_attr *); static int config(struct plist *, char *, struct file_attr *);
/* compat with old packages */ /* compat with old packages */
static int name_key(struct plist *, char *, struct file_attr *); static int name_key(struct plist *, char *, struct file_attr *);
static int pkgdep(struct plist *, char *, struct file_attr *);
static int include_plist(struct plist *, char *, struct file_attr *); static int include_plist(struct plist *, char *, struct file_attr *);
static struct action_cmd { static struct action_cmd {
...@@ -77,8 +75,6 @@ static struct action_cmd { ...@@ -77,8 +75,6 @@ static struct action_cmd {
size_t namelen; size_t namelen;
} list_actions[] = { } list_actions[] = {
{ "setprefix", setprefix, 9}, { "setprefix", setprefix, 9},
{ "dirrm", dirrm, 5 },
{ "dirrmtry", dirrm, 7 },
{ "dir", dir, 3 }, { "dir", dir, 3 },
{ "file", file, 4 }, { "file", file, 4 },
{ "setmode", setmod, 6 }, { "setmode", setmod, 6 },
...@@ -88,7 +84,6 @@ static struct action_cmd { ...@@ -88,7 +84,6 @@ static struct action_cmd {
{ "config", config, 6 }, { "config", config, 6 },
/* compat with old packages */ /* compat with old packages */
{ "name", name_key, 4 }, { "name", name_key, 4 },
{ "pkgdep", pkgdep, 6 },
{ NULL, NULL, 0 } { NULL, NULL, 0 }
}; };
...@@ -222,16 +217,6 @@ name_key(struct plist *p, char *line, struct file_attr *a __unused) ...@@ -222,16 +217,6 @@ name_key(struct plist *p, char *line, struct file_attr *a __unused)
return (EPKG_OK); return (EPKG_OK);
} }
static int
pkgdep(struct plist *p, char *line, struct file_attr *a __unused)
{
if (*line != '\0') {
free(p->pkgdep);
p->pkgdep = xstrdup(line);
}
return (EPKG_OK);
}
static int static int
lua_meta(lua_State *L, lua_meta(lua_State *L,
int (*perform)(struct plist *, char *, struct file_attr *)) int (*perform)(struct plist *, char *, struct file_attr *))
...@@ -314,27 +299,6 @@ dir(struct plist *p, char *line, struct file_attr *a) ...@@ -314,27 +299,6 @@ dir(struct plist *p, char *line, struct file_attr *a)
return (ret); return (ret);
} }
static void
warn_deprecated_dir(void)
{
static bool warned_deprecated_dir = false;
if (warned_deprecated_dir)
return;
warned_deprecated_dir = true;
pkg_emit_error("Warning: @dirrm[try] is deprecated, please"
" use @dir");
}
static int
dirrm(struct plist *p, char *line, struct file_attr *a)
{
warn_deprecated_dir();
return (dir(p, line, a));
}
static int static int
meta_file(struct plist *p, char *line, struct file_attr *a, bool is_config) meta_file(struct plist *p, char *line, struct file_attr *a, bool is_config)
{ {
...@@ -486,40 +450,8 @@ setgroup(struct plist *p, char *line, struct file_attr *a __unused) ...@@ -486,40 +450,8 @@ setgroup(struct plist *p, char *line, struct file_attr *a __unused)
} }
static int static int
comment_key(struct plist *p, char *line, struct file_attr *a __unused) comment_key(struct plist *p, char *line__unused , struct file_attr *a __unused)
{ {
char *name, *version, *line_options, *line_options2, *option;
if (strncmp(line, "DEPORIGIN:", 10) == 0) {
line += 10;
name = p->pkgdep;
if (name != NULL) {
version = strrchr(name, '-');
version[0] = '\0';
version++;
pkg_adddep(p->pkg, name, line, version, false);
free(p->pkgdep);
}
p->pkgdep = NULL;
} else if (strncmp(line, "ORIGIN:", 7) == 0) {
line += 7;
free(p->pkg->origin);
p->pkg->origin = xstrdup(line);
} else if (strncmp(line, "OPTIONS:", 8) == 0) {
line += 8;
/* OPTIONS:+OPTION -OPTION */
if (line[0] != '\0') {
line_options2 = line_options = xstrdup(line);
while ((option = strsep(&line_options, " ")) != NULL) {
if ((option[0] == '+' || option[0] == '-') &&
option[1] != '\0' && isupper(option[1]))
pkg_addoption(p->pkg, option + 1,
option[0] == '+' ? "on" : "off");
}
free(line_options2);
}
}
/* ignore md5 will be recomputed anyway */ /* ignore md5 will be recomputed anyway */
return (EPKG_OK); return (EPKG_OK);
} }
...@@ -532,19 +464,12 @@ static struct keyact { ...@@ -532,19 +464,12 @@ static struct keyact {
{ "comment", comment_key }, { "comment", comment_key },
{ "config", config }, { "config", config },
{ "dir", dir }, { "dir", dir },
{ "dirrm", dirrm },
{ "dirrmtry", dirrm },
{ "include", include_plist }, { "include", include_plist },
{ "mode", setmod }, { "mode", setmod },
{ "owner", setowner }, { "owner", setowner },
{ "group", setgroup }, { "group", setgroup },
/* old pkg compat */ /* old pkg compat */
{ "name", name_key }, { "name", name_key },
{ "pkgdep", pkgdep },
{ "mtree", comment_key },
{ "stopdaemon", comment_key },
{ "display", comment_key },
{ "conflicts", comment_key },
{ NULL, NULL }, { NULL, NULL },
}; };
...@@ -1126,7 +1051,6 @@ plist_free(struct plist *p) ...@@ -1126,7 +1051,6 @@ plist_free(struct plist *p)
HASH_FREE(p->keywords, keyword_free); HASH_FREE(p->keywords, keyword_free);
free(p->pkgdep);
free(p->uname); free(p->uname);
free(p->gname); free(p->gname);
free(p->post_patterns.buf); free(p->post_patterns.buf);
......
...@@ -652,8 +652,6 @@ struct plist { ...@@ -652,8 +652,6 @@ struct plist {
char *uname; char *uname;
char *gname; char *gname;
const char *slash; const char *slash;
char *pkgdep;
bool ignore_next;
int64_t flatsize; int64_t flatsize;
hardlinks_t *hardlinks; hardlinks_t *hardlinks;
mode_t perm; mode_t perm;
......
...@@ -9,8 +9,6 @@ tests_init \ ...@@ -9,8 +9,6 @@ tests_init \
create_from_plist_gather_mode \ create_from_plist_gather_mode \
create_from_plist_set_mode \ create_from_plist_set_mode \
create_from_plist_mini \ create_from_plist_mini \
create_from_plist_dirrm \
create_from_plist_ignore \
create_from_plist_fflags create_from_plist_bad_fflags \ create_from_plist_fflags create_from_plist_bad_fflags \
create_from_plist_with_keyword_arguments \ create_from_plist_with_keyword_arguments \
create_from_manifest_and_plist \ create_from_manifest_and_plist \
...@@ -205,47 +203,6 @@ create_from_plist_mini_body() { ...@@ -205,47 +203,6 @@ create_from_plist_mini_body() {
bsdtar tvf test-1.pkg bsdtar tvf test-1.pkg
} }
create_from_plist_dirrm_body() {
mkdir testdir
genmanifest
for dir in dirrm dirrmtry ; do
rm test.plist
genplist "@${dir} testdir"
atf_check \
-o empty \
-e inline:"${PROGNAME}: Warning: @dirrm[try] is deprecated, please use @dir\n" \
pkg create -o ${TMPDIR} -m . -p test.plist -r .
basic_validation
done
}
create_from_plist_ignore_body() {
genmanifest
genplist "@ignore
aline"
atf_check \
-o empty \
-e empty \
pkg create -o ${TMPDIR} -m . -p test.plist -r .
basic_validation
atf_check \
-o inline:"+COMPACT_MANIFEST\n+MANIFEST\n" \
-e empty \
-s exit:0 \
bsdtar tf test-1.pkg
atf_check \
-o empty \
-e inline:"${PROGNAME}: Warning: @ignore is deprecated\n" \
pkg -o DEVELOPER_MODE=yes create -o ${TMPDIR} -m . -p test.plist -r .
}
create_from_plist_fflags_body() { create_from_plist_fflags_body() {
atf_skip_on Linux does not support fflags atf_skip_on Linux does not support fflags
preparetestcredentials "(,,,schg)" preparetestcredentials "(,,,schg)"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment