svn commit: r532201 - in head/misc/ctm: . files
Stefan Eßer
se at FreeBSD.org
Mon Apr 20 12:20:13 UTC 2020
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 at 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;
}
More information about the svn-ports-all
mailing list