From owner-svn-ports-head@freebsd.org Mon Apr 20 12:20:13 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1B342C1AC1; Mon, 20 Apr 2020 12:20:13 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 495Qkj3rnlz4G5g; Mon, 20 Apr 2020 12:20:13 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65491F437; Mon, 20 Apr 2020 12:20:13 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03KCKDJ0025704; Mon, 20 Apr 2020 12:20:13 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03KCKDkM025702; Mon, 20 Apr 2020 12:20:13 GMT (envelope-from se@FreeBSD.org) Message-Id: <202004201220.03KCKDkM025702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 20 Apr 2020 12:20:13 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r532201 - in head/misc/ctm: . files X-SVN-Group: ports-head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/misc/ctm: . files X-SVN-Commit-Revision: 532201 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 12:20:13 -0000 Author: se Date: Mon Apr 20 12:20:12 2020 New Revision: 532201 URL: https://svnweb.freebsd.org/changeset/ports/532201 Log: Make ctm use the file mode listed in the CTM delta. PR: 245415 Submitted by: stephen Approved by: antoine (implicit) Modified: head/misc/ctm/Makefile head/misc/ctm/files/patch-ctm_ctm__pass3.c Modified: head/misc/ctm/Makefile ============================================================================== --- head/misc/ctm/Makefile Mon Apr 20 12:18:00 2020 (r532200) +++ head/misc/ctm/Makefile Mon Apr 20 12:20:12 2020 (r532201) @@ -2,7 +2,7 @@ PORTNAME= ctm PORTVERSION= 2.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= misc MAINTAINER= se@FreeBSD.org Modified: head/misc/ctm/files/patch-ctm_ctm__pass3.c ============================================================================== --- head/misc/ctm/files/patch-ctm_ctm__pass3.c Mon Apr 20 12:18:00 2020 (r532200) +++ head/misc/ctm/files/patch-ctm_ctm__pass3.c Mon Apr 20 12:20:12 2020 (r532201) @@ -1,6 +1,16 @@ --- ctm/ctm_pass3.c.orig 2018-10-27 15:56:22 UTC +++ ctm/ctm_pass3.c -@@ -35,10 +35,12 @@ Pass3(FILE *fd) +@@ -31,14 +31,22 @@ settime(const char *name, const struct timeval *times) + } + + int ++setmodefromchar(const char *name, const u_char *mode) ++{ ++ return chmod(name, strtol(mode, NULL, 8)); ++} ++ ++int + Pass3(FILE *fd) { u_char *p,*q,buf[BUFSIZ]; MD5_CTX ctx; @@ -15,7 +25,7 @@ struct stat st; char md5_1[33]; int match=0; -@@ -131,7 +133,7 @@ Pass3(FILE *fd) +@@ -131,7 +139,7 @@ Pass3(FILE *fd) WRONG found: for(i=0;(j = sp->List[i]);i++) { @@ -24,7 +34,7 @@ sep = ' '; else sep = '\n'; -@@ -149,53 +151,98 @@ Pass3(FILE *fd) +@@ -149,53 +157,99 @@ Pass3(FILE *fd) break; case CTM_F_Count: GETBYTECNT(cnt,sep); break; case CTM_F_Bytes: GETDATA(trash,cnt); break; @@ -140,6 +150,7 @@ + WRONG + } + if (settime(name,times)) WRONG ++ if (setmodefromchar(name,mode)) WRONG + continue; } - if(cnt != write(i,trash,cnt)) { @@ -159,7 +170,31 @@ if(!strcmp(sp->Key,"FE")) { ed = popen("ed","w"); if(!ed) { -@@ -278,6 +325,8 @@ Pass3(FILE *fd) +@@ -218,6 +272,7 @@ Pass3(FILE *fd) + WRONG + } + if (settime(name,times)) WRONG ++ if (setmodefromchar(name,mode)) WRONG + continue; + } + if(!strcmp(sp->Key,"FN")) { +@@ -237,6 +292,7 @@ Pass3(FILE *fd) + if (rename(buf,name) == -1) + WRONG + if (settime(name,times)) WRONG ++ if (setmodefromchar(name,mode)) WRONG + continue; + } + if(!strcmp(sp->Key,"DM")) { +@@ -249,6 +305,7 @@ Pass3(FILE *fd) + WRONG + } + if (settime(name,times)) WRONG ++ if (setmodefromchar(name,mode)) WRONG + continue; + } + if(!strcmp(sp->Key,"FR")) { +@@ -278,6 +335,8 @@ Pass3(FILE *fd) } continue; }