[31045] trunk/dports/textproc/unix2dos

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 14 14:27:15 PST 2007


Revision: 31045
          http://trac.macosforge.org/projects/macports/changeset/31045
Author:   mww at macports.org
Date:     2007-11-14 14:27:14 -0800 (Wed, 14 Nov 2007)

Log Message:
-----------
use original distfile, clean up patches, don't use 'cd' -- distfile & approval of andrew at fernandes.org via mail

Modified Paths:
--------------
    trunk/dports/textproc/unix2dos/Portfile

Added Paths:
-----------
    trunk/dports/textproc/unix2dos/files/patch-unix2dos.1.man
    trunk/dports/textproc/unix2dos/files/patch-unix2dos.c

Removed Paths:
-------------
    trunk/dports/textproc/unix2dos/files/unix2dos-2.2-manpage.patch
    trunk/dports/textproc/unix2dos/files/unix2dos-2.2-segfault.patch
    trunk/dports/textproc/unix2dos/files/unix2dos-mkstemp.patch

Modified: trunk/dports/textproc/unix2dos/Portfile
===================================================================
--- trunk/dports/textproc/unix2dos/Portfile	2007-11-14 20:43:23 UTC (rev 31044)
+++ trunk/dports/textproc/unix2dos/Portfile	2007-11-14 22:27:14 UTC (rev 31045)
@@ -5,23 +5,27 @@
 version         2.2
 categories      textproc
 description     Convert text from unix to dos format
+long_description ${description}
 maintainers     andrew at fernandes.org
-master_sites    http://opendarwin.org/~olegb/src/
-checksums       unix2dos-2.2.src.tar.gz md5 e4488c241fa9067a48a7534a21d4babb 
+master_sites    macports
+checksums       md5 caf9f33155073d3efd310eff9103170b \
+                sha1 e63ac815b7049c07eab0a1ade48c978c8a4c99f7
+patchfiles      patch-unix2dos.1.man patch-unix2dos.c
 
-use_configure   no
+distname        ${name}-${version}.src
 
-distfiles       ${name}-${version}.src.tar.gz
+pre-extract     {
+                  file mkdir ${worksrcpath}
+                }
+extract.dir     ${worksrcpath}
 
-worksrcdir      .
+use_configure   no
 
 build           {
-                  cd ${worksrcpath}
-                  system "gcc -O unix2dos.c -o unix2dos"
+                  system "cd ${worksrcpath} && gcc ${configure.cflags} unix2dos.c -o unix2dos"
                 }
 
 destroot        {
-                  cd ${worksrcpath}
-                  system "install -m 755 -cs unix2dos ${destroot}${prefix}/bin"
-                  system "gzip -c unix2dos.1 > ${destroot}${prefix}/share/man/man1/unix2dos.1.gz"
+                  xinstall -m 0555 -W ${worksrcpath} -s unix2dos ${destroot}${prefix}/bin/
+                  xinstall -m 0444 -W ${worksrcpath} unix2dos.1 ${destroot}${prefix}/share/man/man1/
                 }

Copied: trunk/dports/textproc/unix2dos/files/patch-unix2dos.1.man (from rev 30953, trunk/dports/textproc/unix2dos/files/unix2dos-2.2-manpage.patch)
===================================================================
--- trunk/dports/textproc/unix2dos/files/patch-unix2dos.1.man	                        (rev 0)
+++ trunk/dports/textproc/unix2dos/files/patch-unix2dos.1.man	2007-11-14 22:27:14 UTC (rev 31045)
@@ -0,0 +1,32 @@
+--- unix2dos.1.man	Thu Jan 17 17:25:08 2002
++++ unix2dos.1	Thu Jan 17 17:25:35 2002
+@@ -16,7 +16,7 @@
+ .SH DESCRIPTION
+ 
+ .PP
+-This manual page documents dos2unix, the program that converts text 
++This manual page documents unix2dos, the program that converts text 
+ files in UNIX format to DOS format.
+ 
+ .SH OPTIONS
+@@ -40,7 +40,7 @@
+ 
+ .TP
+ .B \-c --convmode convmode
+-Sets conversion mode. Simulates dos2unix under SunOS.
++Sets conversion mode. Simulates unix2dos under SunOS.
+ 
+ .TP
+ .B \-o --oldfile file ...
+@@ -71,9 +71,9 @@
+ Convert and replace a.txt in ASCII conversion mode.
+ Convert and replace b.txt in ISO conversion mode.
+ .IP
+-.B dos2unix a.txt -c iso b.txt
++.B unix2dos a.txt -c iso b.txt
+ .IP
+-.B dos2unix -c ascii a.txt -c iso b.txt
++.B unix2dos -c ascii a.txt -c iso b.txt
+ 
+ .LP
+ Convert and replace a.txt while keeping original date stamp.

Added: trunk/dports/textproc/unix2dos/files/patch-unix2dos.c
===================================================================
--- trunk/dports/textproc/unix2dos/files/patch-unix2dos.c	                        (rev 0)
+++ trunk/dports/textproc/unix2dos/files/patch-unix2dos.c	2007-11-14 22:27:14 UTC (rev 31045)
@@ -0,0 +1,94 @@
+--- work/unix2dos-2.2.src/unix2dos.c	1995-03-30 18:03:23.000000000 +0200
++++ unix2dos.c	2007-11-14 23:21:10.000000000 +0100
+@@ -131,9 +131,9 @@
+  * RetVal: NULL if failure
+  *         file stream otherwise
+  */
+-FILE* OpenOutFile(char *ipFN)
++FILE* OpenOutFile(int fd)
+ {
+-  return (fopen(ipFN, W_CNTRL));
++  return (fdopen(fd, W_CNTRL));
+ }
+ 
+ 
+@@ -207,14 +207,17 @@
+   char TempPath[16];
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+-  strcpy (TempPath, "./u2dtmp");
+-  strcat (TempPath, "XXXXXX");
+-  mktemp (TempPath);
++  strcpy (TempPath, "./u2dtmpXXXXXX");
++  if((fd=mkstemp (TempPath)) < 0) {
++	  perror("Can't open output temp file");
++	  RetVal = -1;
++  }
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+@@ -225,7 +228,7 @@
+     RetVal = -1;
+ 
+   /* can open out file? */
+-  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
++  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
+     RetVal = -1;
+@@ -243,6 +246,9 @@
+   if ((TempF) && (fclose(TempF) == EOF))
+     RetVal = -1;
+ 
++  if(fd>=0)
++	  close(fd);
++
+   if ((!RetVal) && (ipFlag->KeepDate))
+   {
+     UTimeBuf.actime = StatBuf.st_atime;
+@@ -286,14 +292,17 @@
+   char TempPath[16];
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+-  strcpy (TempPath, "./u2dtmp");
+-  strcat (TempPath, "XXXXXX");
+-  mktemp (TempPath);
++  strcpy (TempPath, "./u2dtmpXXXXXX");
++  if((fd=mkstemp (TempPath)) < 0) {
++      perror("Can't open output temp file");
++      RetVal = -1;
++  }
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+@@ -304,7 +313,7 @@
+     RetVal = -1;
+ 
+   /* can open out file? */
+-  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
++  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
+     RetVal = -1;
+@@ -322,6 +331,9 @@
+   if ((TempF) && (fclose(TempF) == EOF))
+     RetVal = -1;
+ 
++  if(fd>=0)
++	  close(fd);
++
+   if ((!RetVal) && (ipFlag->KeepDate))
+   {
+     UTimeBuf.actime = StatBuf.st_atime;

Deleted: trunk/dports/textproc/unix2dos/files/unix2dos-2.2-manpage.patch
===================================================================
--- trunk/dports/textproc/unix2dos/files/unix2dos-2.2-manpage.patch	2007-11-14 20:43:23 UTC (rev 31044)
+++ trunk/dports/textproc/unix2dos/files/unix2dos-2.2-manpage.patch	2007-11-14 22:27:14 UTC (rev 31045)
@@ -1,32 +0,0 @@
---- unix2dos.1.man	Thu Jan 17 17:25:08 2002
-+++ unix2dos.1	Thu Jan 17 17:25:35 2002
-@@ -16,7 +16,7 @@
- .SH DESCRIPTION
- 
- .PP
--This manual page documents dos2unix, the program that converts text 
-+This manual page documents unix2dos, the program that converts text 
- files in UNIX format to DOS format.
- 
- .SH OPTIONS
-@@ -40,7 +40,7 @@
- 
- .TP
- .B \-c --convmode convmode
--Sets conversion mode. Simulates dos2unix under SunOS.
-+Sets conversion mode. Simulates unix2dos under SunOS.
- 
- .TP
- .B \-o --oldfile file ...
-@@ -71,9 +71,9 @@
- Convert and replace a.txt in ASCII conversion mode.
- Convert and replace b.txt in ISO conversion mode.
- .IP
--.B dos2unix a.txt -c iso b.txt
-+.B unix2dos a.txt -c iso b.txt
- .IP
--.B dos2unix -c ascii a.txt -c iso b.txt
-+.B unix2dos -c ascii a.txt -c iso b.txt
- 
- .LP
- Convert and replace a.txt while keeping original date stamp.

Deleted: trunk/dports/textproc/unix2dos/files/unix2dos-2.2-segfault.patch
===================================================================
--- trunk/dports/textproc/unix2dos/files/unix2dos-2.2-segfault.patch	2007-11-14 20:43:23 UTC (rev 31044)
+++ trunk/dports/textproc/unix2dos/files/unix2dos-2.2-segfault.patch	2007-11-14 22:27:14 UTC (rev 31045)
@@ -1,94 +0,0 @@
---- unix2dos.c.segf	Thu Jan 17 17:09:49 2002
-+++ unix2dos.c	Thu Jan 17 17:12:47 2002
-@@ -131,9 +131,9 @@
-  * RetVal: NULL if failure
-  *         file stream otherwise
-  */
--FILE* OpenOutFile(char *ipFN)
-+FILE* OpenOutFile(int fd)
- {
--  return (fopen(ipFN, W_CNTRL));
-+  return (fdopen(fd, W_CNTRL));
- }
- 
- 
-@@ -207,14 +207,17 @@
-   char TempPath[16];
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  int fd;
- 
-   /* retrieve ipInFN file date stamp */
-   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
--  strcpy (TempPath, "./u2dtmp");
--  strcat (TempPath, "XXXXXX");
--  mkstemp (TempPath);
-+  strcpy (TempPath, "./u2dtmpXXXXXX");
-+  if((fd=mkstemp (TempPath)) < 0) {
-+	  perror("Can't open output temp file");
-+	  RetVal = -1;
-+  }
- 
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
-@@ -225,7 +228,7 @@
-     RetVal = -1;
- 
-   /* can open out file? */
--  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
-+  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-     RetVal = -1;
-@@ -243,6 +246,9 @@
-   if ((TempF) && (fclose(TempF) == EOF))
-     RetVal = -1;
- 
-+  if(fd>=0)
-+	  close(fd);
-+
-   if ((!RetVal) && (ipFlag->KeepDate))
-   {
-     UTimeBuf.actime = StatBuf.st_atime;
-@@ -286,14 +292,17 @@
-   char TempPath[16];
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  int fd;
- 
-   /* retrieve ipInFN file date stamp */
-   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
--  strcpy (TempPath, "./u2dtmp");
--  strcat (TempPath, "XXXXXX");
--  mkstemp (TempPath);
-+  strcpy (TempPath, "./u2dtmpXXXXXX");
-+  if((fd=mkstemp (TempPath)) < 0) {
-+      perror("Can't open output temp file");
-+      RetVal = -1;
-+  }
- 
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
-@@ -304,7 +313,7 @@
-     RetVal = -1;
- 
-   /* can open out file? */
--  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
-+  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-     RetVal = -1;
-@@ -322,6 +331,9 @@
-   if ((TempF) && (fclose(TempF) == EOF))
-     RetVal = -1;
- 
-+  if(fd>=0)
-+	  close(fd);
-+
-   if ((!RetVal) && (ipFlag->KeepDate))
-   {
-     UTimeBuf.actime = StatBuf.st_atime;

Deleted: trunk/dports/textproc/unix2dos/files/unix2dos-mkstemp.patch
===================================================================
--- trunk/dports/textproc/unix2dos/files/unix2dos-mkstemp.patch	2007-11-14 20:43:23 UTC (rev 31044)
+++ trunk/dports/textproc/unix2dos/files/unix2dos-mkstemp.patch	2007-11-14 22:27:14 UTC (rev 31045)
@@ -1,20 +0,0 @@
---- unix2dos.c.orig	Fri Nov 17 13:29:24 2000
-+++ unix2dos.c	Fri Nov 17 13:30:16 2000
-@@ -214,7 +214,7 @@
- 
-   strcpy (TempPath, "./u2dtmp");
-   strcat (TempPath, "XXXXXX");
--  mktemp (TempPath);
-+  mkstemp (TempPath);
- 
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
-@@ -293,7 +293,7 @@
- 
-   strcpy (TempPath, "./u2dtmp");
-   strcat (TempPath, "XXXXXX");
--  mktemp (TempPath);
-+  mkstemp (TempPath);
- 
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071114/13e6d7b0/attachment-0001.html


More information about the macports-changes mailing list