From owner-p4-projects@FreeBSD.ORG Thu May 27 23:46:54 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4FF381065670; Thu, 27 May 2010 23:46:54 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 141661065677 for ; Thu, 27 May 2010 23:46:54 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from repoman.freebsd.org (unknown [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DD88C8FC17 for ; Thu, 27 May 2010 23:46:53 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RNkrii031202 for ; Thu, 27 May 2010 23:46:53 GMT (envelope-from ivoras@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o4RNkr2d031199 for perforce@freebsd.org; Thu, 27 May 2010 23:46:53 GMT (envelope-from ivoras@FreeBSD.org) Date: Thu, 27 May 2010 23:46:53 GMT Message-Id: <201005272346.o4RNkr2d031199@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ivoras@FreeBSD.org using -f From: Ivan Voras To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 178896 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 23:46:54 -0000 http://p4web.freebsd.org/@@178896?ac=10 Change 178896 by ivoras@betelgeuse on 2010/05/27 23:46:51 Cosmetic changes Affected files ... .. //depot/projects/soc2010/pkg_patch/src/patch/Makefile#7 edit .. //depot/projects/soc2010/pkg_patch/src/patch/hashjob.c#6 edit .. //depot/projects/soc2010/pkg_patch/src/patch/hashjob.h#6 edit .. //depot/projects/soc2010/pkg_patch/src/patch/main.c#7 edit .. //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.c#5 edit .. //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.h#5 edit .. //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.h#5 edit .. //depot/projects/soc2010/pkg_patch/src/patch/support.c#4 edit Differences ... ==== //depot/projects/soc2010/pkg_patch/src/patch/Makefile#7 (text+ko) ==== ==== //depot/projects/soc2010/pkg_patch/src/patch/hashjob.c#6 (text+ko) ==== @@ -32,8 +32,7 @@ assert(job->filename != NULL); job->hash_len = 32; memset(job->hash, 0, HASH_MAX_LEN); - if (MD5File(job->filename, job->hash) == NULL) - err(1, "MD5File failed on: %s", job->filename); + assert(MD5File(job->filename, job->hash) != NULL); return (job); } @@ -46,7 +45,7 @@ assert(job->filename != NULL); job->hash_len = 64; memset(job->hash, 0, HASH_MAX_LEN); - SHA256_File(job->filename, job->hash); + assert(SHA256_File(job->filename, job->hash) != NULL); return (job); } ==== //depot/projects/soc2010/pkg_patch/src/patch/hashjob.h#6 (text+ko) ==== ==== //depot/projects/soc2010/pkg_patch/src/patch/main.c#7 (text+ko) ==== ==== //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.c#5 (text+ko) ==== @@ -124,7 +124,12 @@ assert(access(fcold, R_OK) == 0); snprintf(fcnew, PATH_MAX, "%s/%s", dnew, fl->filename); assert(access(fcnew, R_OK) == 0); - + + /* + * Detect changed files using the traditional FreeBSD method - + * by comparing MD5 and SHA256 checksums. As a note to possible + * improvements: SHA256 is almost 3x slower than MD5. + */ hashjob_start(&hjold_md5, fcold, HASH_MD5); hashjob_start(&hjold_sha256, fcold, HASH_SHA256); hashjob_start(&hjnew_md5, fcnew, HASH_MD5); ==== //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.h#5 (text+ko) ==== ==== //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.h#5 (text+ko) ==== ==== //depot/projects/soc2010/pkg_patch/src/patch/support.c#4 (text+ko) ====