Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jul 2010 21:37:06 GMT
From:      Julien Laffaye <jlaffaye@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 181198 for review
Message-ID:  <201007192137.o6JLb6eH018136@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@181198?ac=10

Change 181198 by jlaffaye@jlaffaye-chulak on 2010/07/19 21:36:40

	Code cleanup.

Affected files ...

.. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/extract.c#3 edit

Differences ...

==== //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/extract.c#3 (text+ko) ====

@@ -127,7 +127,7 @@
 	    warnx("package '%s' or its older version already installed%s",
 		pkg.name, FailOnAlreadyInstalled ? "" : " (ignored)");
 	    if (FailOnAlreadyInstalled == TRUE)
-		return (1);	/* close enough for government work */
+		return (1);
 	}
 
 	/* Now check the packing list for conflicts */
@@ -146,8 +146,6 @@
 				      pkg.name, matched[i]);
 				conflictsfound = 1;
 			    }
-
-		    continue;
 		}
 	    }
 	    if(conflictsfound) {
@@ -362,19 +360,18 @@
 	}
 
 	/*
-	* Test whether to use the old method of passing tokens to installation
-	* scripts, and set appropriate variables..
-	*/
-	if (fexists(POST_INSTALL_FNAME)) {
-	    sprintf(post_script, "%s", POST_INSTALL_FNAME);
-	    pre_arg[0] = '\0';
-	    post_arg[0] = '\0';
-	} else {
-	    if (fexists(INSTALL_FNAME)) {
-		sprintf(post_script, "%s", INSTALL_FNAME);
-		sprintf(pre_arg, "PRE-INSTALL");
-		sprintf(post_arg, "POST-INSTALL");
-	    }
+	 * Test whether to use the old method of passing tokens to installation
+	 * scripts, and set appropriate variables..
+	 */
+	post_script[0] = '\0';
+	pre_arg[0] = '\0';
+	post_arg[0] = '\0';
+	if (fexists(POST_INSTALL_FNAME))
+	    strlcat(post_script, POST_INSTALL_FNAME, sizeof(post_script));
+	else if (fexists(INSTALL_FNAME)) {
+	    strlcat(post_script, INSTALL_FNAME, sizeof(post_script));
+	    strlcat(pre_arg, "PRE-INSTALL", sizeof(pre_arg));
+	    strlcat(post_arg, "POST-INSTALL", sizeof(post_arg));
 	}
 
 	/* If we're really installing, and have an installation file, run it */
@@ -424,7 +421,7 @@
 		}
 		if (!Fake && chdir(p->name) == -1) {
 		    warn("chdir(%s)", p->name);
-		    return 1;
+		    return (1);
 		}
 		last_dir = p->name;
 		break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007192137.o6JLb6eH018136>