Date: Sun, 15 Aug 2010 20:40:46 GMT From: Julien Laffaye <jlaffaye@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 182438 for review Message-ID: <201008152040.o7FKekrJ051648@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@182438?ac=10 Change 182438 by jlaffaye@jlaffaye-chulak on 2010/08/15 20:40:27 Cleanup: - style(9) - remove `ENSURE_THAT_ALL_REQUIREMENTS_ARE_MET' conditional code: we are doing the same logic (install dependencies if missing) two lines after... Affected files ... .. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/add.h#8 edit .. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/extract.c#17 edit .. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/perform.c#16 edit Differences ... ==== //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/add.h#8 (text+ko) ==== @@ -41,7 +41,8 @@ extern Boolean KeepPackage; extern Boolean IgnoreDeps; extern add_mode_t AddMode; -extern char PkgTopDir[PATH_MAX]; +extern char PkgTopDir[]; +extern char db_dir_tmp[]; int mkdirs(char *path); int extract_package(struct archive *, Package *, const char *); ==== //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/extract.c#17 (text+ko) ==== @@ -32,7 +32,7 @@ #include "add.h" /* Global used by cleanup() */ -char db_dir_tmp[FILENAME_MAX]; +char db_dir_tmp[PATH_MAX]; /* * Extract and parse the plist of a package archive. @@ -88,7 +88,7 @@ Boolean conflictsfound = FALSE; int code = 0; int errcode = 0; - char db_dir[FILENAME_MAX]; + char db_dir[PATH_MAX]; char cmd[FILENAME_MAX]; char pre_script[FILENAME_MAX] = INSTALL_FNAME; char post_script[FILENAME_MAX]; @@ -164,48 +164,6 @@ warnx("-f specified; proceeding anyway"); } -#if ENSURE_THAT_ALL_REQUIREMENTS_ARE_MET - /* - * Before attempting to do the slave mode bit, ensure that we've - * downloaded & processed everything we need. - * It's possible that we haven't already installed all of our - * dependencies if the dependency list was misgenerated due to - * other dynamic dependencies or if a dependency was added to a - * package without all REQUIRED_BY packages being regenerated. - */ - for (p = pkg ? pkg->head : NULL; p; p = p->next) { - const char *ext; - char *deporigin; - - if (p->type != PLIST_PKGDEP) - continue; - - if (p->next->type == PLIST_DEPORIGIN) - deporigin = p->next->name; - else - deporigin = NULL; - - if (isinstalledpkg(p->name) <= 0 && - !(deporigin != NULL && matchbyorigin(deporigin, NULL) != NULL)){ - char subpkg[FILENAME_MAX], *sep; - - strlcpy(subpkg, pkg, sizeof subpkg); - if ((sep = strrchr(subpkg, '/')) != NULL) { - *sep = '\0'; - if ((sep = strrchr(subpkg, '/')) != NULL) { - *sep = '\0'; - strlcat(subpkg, "/All/", sizeof subpkg); - strlcat(subpkg, p->name, sizeof subpkg); - if ((ext = strrchr(pkg, '.')) == NULL) - ext = ".tbz"; - strlcat(subpkg, ext, sizeof subpkg); - pkg_do(subpkg); - } - } - } - } -#endif - /* Now check the packing list for dependencies */ for (p = pkg->head; p ; p = p->next) { char *deporigin; ==== //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/perform.c#16 (text+ko) ==== @@ -34,10 +34,6 @@ void cleanup(void); -extern int extract_state; -extern char db_dir_tmp[FILENAME_MAX]; -extern char db_dir[FILENAME_MAX]; - char PkgTopDir[PATH_MAX]; int @@ -52,13 +48,12 @@ if (AddMode == SLAVE) { PkgTopDir[0] = '\0'; err_cnt = pkg_do(NULL); - } - else + } else for (i = 0; pkgs[i]; i++) { PkgTopDir[0] = '\0'; err_cnt += pkg_do(pkgs[i]); } - return err_cnt; + return (err_cnt); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008152040.o7FKekrJ051648>