diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-11-06 11:22:04 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-11-06 11:22:04 +0100 |
commit | c4b867da688c78e2fcd92bc997c94eb69bba6a09 (patch) | |
tree | 7c64c4ce9bc8662ab6ee85e9d09863acc0791772 /adk | |
parent | 6190e6a77966f308486bb626e576e7c832d9e456 (diff) |
depmaker: revert my changes, this breaks to much
Diffstat (limited to 'adk')
-rw-r--r-- | adk/tools/depmaker.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/adk/tools/depmaker.c b/adk/tools/depmaker.c index 8fc16c6de..f89985833 100644 --- a/adk/tools/depmaker.c +++ b/adk/tools/depmaker.c @@ -70,7 +70,7 @@ static char *parse_line(char *package, char *pkgvar, char *string, int checksym, char *key, *value, *dep, *key_sym, *pkgdeps, *depvar; char temp[MAXLINE]; - int i, skip; + int i; string[strlen(string)-1] = '\0'; if ((key = strtok(string, ":=")) == NULL) { @@ -120,7 +120,6 @@ static char *parse_line(char *package, char *pkgvar, char *string, int checksym, exit(EXIT_FAILURE); } - skip=0; value = strtok(NULL, "=\t"); dep = strtok(value, " "); while (dep != NULL) { @@ -163,27 +162,24 @@ static char *parse_line(char *package, char *pkgvar, char *string, int checksym, if (snprintf(key_sym, MAXLINE, "ADK_HOST_BUILD_%s", depvar) < 0) perror("Can not create string variable."); - if (check_symbol(key_sym) != 0) - skip=1; - + if (check_symbol(key_sym) != 0) { + free(key_sym); + free(depvar); + return(NULL); + } free(key_sym); free(depvar); } } if (*prefixp == 0) { *prefixp = 1; - if (skip == 0) { - if (snprintf(temp, MAXLINE, "%s-compile: %s-compile", package, dep) < 0) - perror("Can not create string variable."); - strncat(pkgdeps, temp, strlen(temp)); - } + if (snprintf(temp, MAXLINE, "%s-compile: %s-compile", package, dep) < 0) + perror("Can not create string variable."); } else { - if (skip == 0) { - if (snprintf(temp, MAXLINE, " %s-compile", dep) < 0) - perror("Can not create string variable."); - strncat(pkgdeps, temp, strlen(temp)); - } + if (snprintf(temp, MAXLINE, " %s-compile", dep) < 0) + perror("Can not create string variable."); } + strncat(pkgdeps, temp, strlen(temp)); dep = strtok(NULL, " "); } return(pkgdeps); @@ -258,7 +254,7 @@ int main() { string = strstr(buf, "PKG_BUILDDEP:="); if (string != NULL) { - tmp = parse_line(pkgdirp->d_name, pkgvar, string, 2, 0, 0, &prefix); + tmp = parse_line(pkgdirp->d_name, pkgvar, string, 0, 0, 0, &prefix); if (tmp != NULL) { strncat(pkgdeps, tmp, strlen(tmp)); } @@ -266,7 +262,7 @@ int main() { string = strstr(buf, "PKG_BUILDDEP+="); if (string != NULL) { - tmp = parse_line(pkgdirp->d_name, pkgvar, string, 2, 0, 0, &prefix); + tmp = parse_line(pkgdirp->d_name, pkgvar, string, 0, 0, 0, &prefix); if (tmp != NULL) strncat(pkgdeps, tmp, strlen(tmp)); } |