dos2unix and unix2dos provided by griswold

svn path=/nixpkgs/trunk/; revision=19409

+1180
+41
pkgs/tools/text/dos2unix/default.nix
··· 1 + {stdenv, fetchurl}: 2 + 3 + stdenv.mkDerivation { 4 + name = "dos2unix-2.2"; 5 + 6 + src = fetchurl { 7 + url = http://cvs.fedoraproject.org/repo/pkgs/dos2unix/dos2unix-3.1.tar.bz2/f90026a397cf787083ec2e4892c6dcdd/dos2unix-3.1.tar.bz2; 8 + md5 = "f90026a397cf787083ec2e4892c6dcdd"; 9 + }; 10 + 11 + patches = [ 12 + ./dos2unix-3.1.patch 13 + ./dos2unix-3.1-segfault.patch 14 + ./dos2unix-3.1-safeconv.patch 15 + ./dos2unix-3.1-manpage-update-57507.patch 16 + ./dos2unix-3.1-preserve-file-modes.patch 17 + ./dos2unix-3.1-tmppath.patch 18 + ./dos2unix-c-missing-arg.patch 19 + ./dos2unix-missing-proto.patch 20 + ./dos2unix-manpage.patch 21 + ./dos2unix-preserve-file-modes.patch 22 + ]; 23 + 24 + installPhase = '' 25 + ensureDir $out/bin 26 + ensureDir $out/share/man/man1 27 + install -p -m755 dos2unix $out/bin 28 + install -p -m644 dos2unix.1 $out/share/man/man1 29 + ln -s dos2unix $out/bin/mac2unix 30 + ''; 31 + 32 + buildPhase = '' 33 + rm -f dos2unix 34 + make dos2unix 35 + ''; 36 + 37 + meta = { 38 + homepage = http://unknown/; 39 + description = "dos2unix tool"; 40 + }; 41 + }
+238
pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch
··· 1 + Patch by Bill Anderson, to fix bug: 2 + https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57507 3 + 4 + 5 + 6 + Description of Problem: 7 + 8 + The dos2unix man page examples are confusing. 9 + For instance, one piece of text mentions "c.txt", but that file 10 + isn't used in the following example. 11 + 12 + 13 + 14 + --- dos2unix-3.1/dos2unix.1 2004-09-28 03:17:29.000000000 -0600 15 + +++ dos2unix-3.1/dos2unix.1-new 2004-09-28 03:16:32.000000000 -0600 16 + @@ -1,123 +1,126 @@ 17 + .\" $$Id: dos2unix.1 2.2 1995/03/31 01:50:45 blin Exp blin $$ 18 + -.TH dos2unix 1 "dos2unix v3.0" "1995.03.31" 19 + - 20 + -.SH NAME 21 + - 22 + +.\" 23 + +.TH "dos2unix" "1" "dos2unix v3.0" "1995.03.31" "" 24 + +.SH "NAME" 25 + dos2unix \- DOS/MAC to UNIX text file format converter 26 + 27 + -.SH SYNOPSYS 28 + - 29 + -dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...] 30 + -.PP 31 + +.SH "SYNOPSYS" 32 + +dos2unix [options] [\-c convmode] [\-o file ...] [\-n infile outfile ...] 33 + +.PP 34 + Options: 35 + -.PP 36 + -[-hkqV] [--help] [--keepdate] [--quiet] [--version] 37 + - 38 + -.SH DESCRIPTION 39 + +.PP 40 + +[\-hkqV] [\-\-help] [\-\-keepdate] [\-\-quiet] [\-\-version] 41 + 42 + -.PP 43 + +.SH "DESCRIPTION" 44 + +.PP 45 + This manual page documents dos2unix, the program that converts plain text 46 + files in DOS/MAC format to UNIX format. 47 + 48 + -.SH OPTIONS 49 + - 50 + +.SH "OPTIONS" 51 + The following options are available: 52 + -.TP 53 + -.B \-h --help 54 + +.TP 55 + +.B \-h \-\-help 56 + Print online help. 57 + 58 + -.TP 59 + -.B \-k --keepdate 60 + +.TP 61 + +.B \-k \-\-keepdate 62 + Keep the date stamp of output file same as input file. 63 + 64 + -.TP 65 + -.B \-q --quiet 66 + +.TP 67 + +.B \-q \-\-quiet 68 + Quiet mode. Suppress all warning and messages. 69 + 70 + -.TP 71 + -.B \-V --version 72 + +.TP 73 + +.B \-V \-\-version 74 + Prints version information. 75 + 76 + -.TP 77 + -.B \-c --convmode convmode 78 + -Sets conversion mode. Simulates dos2unix under SunOS. 79 + +.TP 80 + +.B \-c \-\-convmode convmode 81 + +Sets conversion mode. Where convmode is one of: 82 + +.B ASCII, 7bit, ISO, Mac 83 + +with ASCII being the default. 84 + +Simulates dos2unix under SunOS. 85 + + 86 + + 87 + 88 + -.TP 89 + -.B \-o --oldfile file ... 90 + +.TP 91 + +.B \-o \-\-oldfile file ... 92 + Old file mode. Convert the file and write output to it. The program 93 + default to run in this mode. Wildcard names may be used. 94 + 95 + -.TP 96 + -.B \-n --newfile infile outfile ... 97 + +.TP 98 + +.B \-n \-\-newfile infile outfile ... 99 + New file mode. Convert the infile and write output to outfile. File names 100 + must be given in pairs and wildcard names should NOT be used or you WILL 101 + lost your files. 102 + 103 + -.SH EXAMPLES 104 + - 105 + -.LP 106 + +.SH "EXAMPLES" 107 + +.LP 108 + Get input from stdin and write output to stdout. 109 + -.IP 110 + +.IP 111 + .B dos2unix 112 + 113 + -.LP 114 + +.LP 115 + Convert and replace a.txt. Convert and replace b.txt. 116 + -.IP 117 + +.IP 118 + .B dos2unix a.txt b.txt 119 + -.IP 120 + -.B dos2unix -o a.txt b.txt 121 + +.IP 122 + +.B dos2unix \-o a.txt b.txt 123 + 124 + -.LP 125 + +.LP 126 + Convert and replace a.txt in ASCII conversion mode. 127 + +.IP 128 + +.B dos2unix a.txt \-c iso b.txt 129 + + 130 + +.LP 131 + Convert and replace b.txt in ISO conversion mode. 132 + +.IP 133 + +.B dos2unix \-c ascii a.txt \-c iso b.txt 134 + + 135 + +.LP 136 + Convert c.txt from Mac to Unix ascii format. 137 + -.IP 138 + -.B dos2unix a.txt -c iso b.txt 139 + -.IP 140 + -.B dos2unix -c ascii a.txt -c iso b.txt 141 + -.IP 142 + -.B dos2unix -c mac a.txt b.txt 143 + 144 + -.LP 145 + +.IP 146 + +.B dos2unix \-c mac c.txt b.txt 147 + + 148 + +.LP 149 + Convert and replace a.txt while keeping original date stamp. 150 + -.IP 151 + -.B dos2unix -k a.txt 152 + -.IP 153 + -.B dos2unix -k -o a.txt 154 + +.IP 155 + +.B dos2unix \-k a.txt 156 + +.IP 157 + +.B dos2unix \-k \-o a.txt 158 + 159 + -.LP 160 + +.LP 161 + Convert a.txt and write to e.txt. 162 + -.IP 163 + -.B dos2unix -n a.txt e.txt 164 + +.IP 165 + +.B dos2unix \-n a.txt e.txt 166 + 167 + -.LP 168 + +.LP 169 + Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt. 170 + -.IP 171 + -.B dos2unix -k -n a.txt e.txt 172 + +.IP 173 + +.B dos2unix \-k \-n a.txt e.txt 174 + 175 + -.LP 176 + +.LP 177 + Convert and replace a.txt. Convert b.txt and write to e.txt. 178 + -.IP 179 + -.B dos2unix a.txt -n b.txt e.txt 180 + -.IP 181 + -.B dos2unix -o a.txt -n b.txt e.txt 182 + +.IP 183 + +.B dos2unix a.txt \-n b.txt e.txt 184 + +.IP 185 + +.B dos2unix \-o a.txt \-n b.txt e.txt 186 + 187 + -.LP 188 + +.LP 189 + Convert c.txt and write to e.txt. Convert and replace a.txt. 190 + Convert and replace b.txt. Convert d.txt and write to f.txt. 191 + -.IP 192 + -.B dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt 193 + +.IP 194 + +.B dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt 195 + 196 + -.SH DIAGNOSTICS 197 + - 198 + -.SH BUGS 199 + +.SH "DIAGNOSTICS" 200 + 201 + +.SH "BUGS" 202 + The program does not work properly under MSDOS in stdio processing mode. 203 + If you know why is that so, please tell me. 204 + 205 + -.SH AUTHORS 206 + - 207 + -Benjamin Lin - 208 + +.SH "AUTHORS" 209 + +Benjamin Lin \- 210 + .B <blin@socs.uts.edu.au> 211 + 212 + 213 + @@ -125,18 +128,17 @@ 214 + .B <wuebben@kde.org> 215 + 216 + 217 + -.SH MISCELLANY 218 + - 219 + +.SH "MISCELLANY" 220 + Tested environment: 221 + -.IP 222 + +.IP 223 + Linux 1.2.0 with GNU C 2.5.8 224 + -.IP 225 + +.IP 226 + SunOS 4.1.3 with GNU C 2.6.3 227 + -.IP 228 + -MS-DOS 6.20 with Borland C++ 4.02 229 + -.PP 230 + +.IP 231 + +MS\-DOS 6.20 with Borland C++ 4.02 232 + +.PP 233 + Suggestions and bug reports are welcome. 234 + 235 + -.SH SEE ALSO 236 + +.SH "SEE ALSO" 237 + unix2dos(1) mac2unix(1) 238 +
+28
pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch
··· 1 + --- dos2unix-3.1/dos2unix.c.mode 2003-05-21 08:09:08.000000000 -0700 2 + +++ dos2unix-3.1/dos2unix.c 2003-05-21 08:09:56.000000000 -0700 3 + @@ -345,11 +345,14 @@ int ConvertDosToUnixOldFile(char* ipInFN 4 + char TempPath[16]; 5 + struct stat StatBuf; 6 + struct utimbuf UTimeBuf; 7 + + mode_t mode = S_IRUSR | S_IWUSR; 8 + int fd; 9 + 10 + /* retrieve ipInFN file date stamp */ 11 + - if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 12 + + if (stat(ipInFN, &StatBuf)) 13 + RetVal = -1; 14 + + else 15 + + mode = StatBuf.st_mode; 16 + 17 + strcpy (TempPath, "./u2dtmpXXXXXX"); 18 + if((fd=mkstemp (TempPath))<0) { 19 + @@ -357,6 +360,9 @@ int ConvertDosToUnixOldFile(char* ipInFN 20 + RetVal = -1; 21 + } 22 + 23 + + if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR)) 24 + + RetVal = -1; 25 + + 26 + #ifdef DEBUG 27 + fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath); 28 + #endif DEBUG
+88
pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch
··· 1 + * Fix http://bugzilla.redhat.com/57508 (make dos2unix not modify Mac 2 + files unless in mac2unix mode) 3 + * Make mac2unix mode not create duplicate Unix line delimiters when 4 + run on a DOS file. (mschwendt@users.sf.net) 5 + 6 + diff -Nur dos2unix-3.1-orig/dos2unix.c dos2unix-3.1/dos2unix.c 7 + --- dos2unix-3.1-orig/dos2unix.c 1998-11-19 13:19:25.000000000 +0100 8 + +++ dos2unix-3.1/dos2unix.c 2004-09-26 20:57:41.606587616 +0200 9 + @@ -153,6 +153,24 @@ 10 + } 11 + 12 + 13 + +void StripDelimiter(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, int CurChar) 14 + +{ 15 + + int TempNextChar; 16 + + /* Don't modify Mac files when in dos2unix mode. */ 17 + + if ( (TempNextChar = getc(ipInF)) != EOF) { 18 + + ungetc( TempNextChar, ipInF ); /* put back peek char */ 19 + + if ( TempNextChar != '\x0a' ) { 20 + + putc( CurChar, ipOutF ); /* Mac line, put back CR */ 21 + + } 22 + + } 23 + + else if ( CurChar == '\x0d' ) { /* EOF: last Mac line delimiter (CR)? */ 24 + + putc( CurChar, ipOutF ); 25 + + } 26 + + if (ipFlag->NewLine) { /* add additional LF? */ 27 + + putc('\n', ipOutF); 28 + + } 29 + +} 30 + + 31 + /* converts stream ipInF to UNIX format text and write to stream ipOutF 32 + * RetVal: 0 if success 33 + * -1 otherwise 34 + @@ -161,6 +179,7 @@ 35 + { 36 + int RetVal = 0; 37 + int TempChar; 38 + + int TempNextChar; 39 + 40 + if ( macmode ) 41 + ipFlag->ConvMode = 3; 42 + @@ -177,9 +196,7 @@ 43 + break; 44 + } 45 + } else { 46 + - if (ipFlag->NewLine) { 47 + - putc('\n', ipOutF); 48 + - } 49 + + StripDelimiter( ipInF, ipOutF, ipFlag, TempChar ); 50 + } 51 + } 52 + break; 53 + @@ -193,9 +210,7 @@ 54 + break; 55 + } 56 + } else { 57 + - if (ipFlag->NewLine) { 58 + - putc('\n', ipOutF); 59 + - } 60 + + StripDelimiter( ipInF, ipOutF, ipFlag, TempChar ); 61 + } 62 + } 63 + break; 64 + @@ -209,9 +224,7 @@ 65 + break; 66 + } 67 + } else { 68 + - if (ipFlag->NewLine) { 69 + - putc('\n', ipOutF); 70 + - } 71 + + StripDelimiter( ipInF, ipOutF, ipFlag, TempChar ); 72 + } 73 + } 74 + break; 75 + @@ -227,6 +240,13 @@ 76 + } 77 + } 78 + else{ 79 + + if ( (TempNextChar = getc(ipInF)) != EOF) { 80 + + ungetc( TempNextChar, ipInF ); /* put back peek char */ 81 + + /* Don't touch this delimiter if it's a CR,LF pair. */ 82 + + if ( TempNextChar == '\x0a' ) { 83 + + continue; 84 + + } 85 + + } 86 + if (putc('\x0a', ipOutF) == EOF) 87 + { 88 + RetVal = -1;
+93
pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch
··· 1 + --- dos2unix-3.1/dos2unix.c.segf Thu Jan 17 17:27:42 2002 2 + +++ dos2unix-3.1/dos2unix.c Thu Jan 17 17:28:07 2002 3 + @@ -147,9 +147,9 @@ 4 + * RetVal: NULL if failure 5 + * file stream otherwise 6 + */ 7 + -FILE* OpenOutFile(char *ipFN) 8 + +FILE* OpenOutFile(int fd) 9 + { 10 + - return (fopen(ipFN, W_CNTRL)); 11 + + return (fdopen(fd, W_CNTRL)); 12 + } 13 + 14 + 15 + @@ -260,14 +260,17 @@ 16 + char TempPath[16]; 17 + struct stat StatBuf; 18 + struct utimbuf UTimeBuf; 19 + + int fd; 20 + 21 + /* retrieve ipInFN file date stamp */ 22 + if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 23 + RetVal = -1; 24 + 25 + - strcpy (TempPath, "./d2utmp"); 26 + - strcat (TempPath, "XXXXXX"); 27 + - mkstemp (TempPath); 28 + + strcpy (TempPath, "./d2utmpXXXXXX"); 29 + + if((fd=mkstemp (TempPath))<0) { 30 + + perror("Failed to open output temp file"); 31 + + RetVal = -1; 32 + + } 33 + 34 + #ifdef DEBUG 35 + fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath); 36 + @@ -278,7 +281,7 @@ 37 + RetVal = -1; 38 + 39 + /* can open out file? */ 40 + - if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL)) 41 + + if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) 42 + { 43 + fclose (InF); 44 + RetVal = -1; 45 + @@ -295,6 +298,8 @@ 46 + /* can close out file? */ 47 + if ((TempF) && (fclose(TempF) == EOF)) 48 + RetVal = -1; 49 + + if(fd>=0) 50 + + close(fd); 51 + 52 + if ((!RetVal) && (ipFlag->KeepDate)) 53 + { 54 + @@ -340,14 +345,17 @@ 55 + char TempPath[16]; 56 + struct stat StatBuf; 57 + struct utimbuf UTimeBuf; 58 + + int fd; 59 + 60 + /* retrieve ipInFN file date stamp */ 61 + if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 62 + RetVal = -1; 63 + 64 + - strcpy (TempPath, "./u2dtmp"); 65 + - strcat (TempPath, "XXXXXX"); 66 + - mkstemp (TempPath); 67 + + strcpy (TempPath, "./u2dtmpXXXXXX"); 68 + + if((fd=mkstemp (TempPath))<0) { 69 + + perror("Failed to open output temp file"); 70 + + RetVal = -1; 71 + + } 72 + 73 + #ifdef DEBUG 74 + fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath); 75 + @@ -358,7 +366,7 @@ 76 + RetVal = -1; 77 + 78 + /* can open out file? */ 79 + - if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL)) 80 + + if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) 81 + { 82 + fclose (InF); 83 + RetVal = -1; 84 + @@ -376,6 +384,9 @@ 85 + if ((TempF) && (fclose(TempF) == EOF)) 86 + RetVal = -1; 87 + 88 + + if(fd>=0) 89 + + close(fd); 90 + + 91 + if ((!RetVal) && (ipFlag->KeepDate)) 92 + { 93 + UTimeBuf.actime = StatBuf.st_atime;
+141
pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch
··· 1 + --- dos2unix-3.1/dos2unix.c.tmppath 2004-10-20 16:00:00.342561008 +0200 2 + +++ dos2unix-3.1/dos2unix.c 2004-10-20 16:01:42.210074792 +0200 3 + @@ -69,6 +69,7 @@ 4 + #ifdef __MSDOS__ 5 + # include <dir.h> 6 + #endif __MSDOS__ 7 + +#include <libgen.h> 8 + #include <stdio.h> 9 + #include <stdlib.h> 10 + #include <string.h> 11 + @@ -267,6 +268,39 @@ 12 + return RetVal; 13 + } 14 + 15 + +static int MakeTempFileFrom(const char *OutFN, char **fname_ret) 16 + +{ 17 + + char *cpy = strdup(OutFN); 18 + + char *dir = NULL; 19 + + size_t fname_len = 0; 20 + + char *fname_str = NULL; 21 + + int fd = -1; 22 + + 23 + + *fname_ret = NULL; 24 + + 25 + + if (!cpy) 26 + + goto make_failed; 27 + + 28 + + dir = dirname(cpy); 29 + + 30 + + fname_len = strlen(dir) + strlen("/d2utmpXXXXXX") + sizeof (char); 31 + + if (!(fname_str = malloc(fname_len))) 32 + + goto make_failed; 33 + + sprintf(fname_str, "%s%s", dir, "/d2utmpXXXXXX"); 34 + + *fname_ret = fname_str; 35 + + 36 + + free(cpy); 37 + + 38 + + if ((fd = mkstemp(fname_str)) == -1) 39 + + goto make_failed; 40 + + 41 + + return (fd); 42 + + 43 + + make_failed: 44 + + free(*fname_ret); 45 + + *fname_ret = NULL; 46 + + return (-1); 47 + +} 48 + 49 + /* convert file ipInFN to UNIX format text and write to file ipOutFN 50 + * RetVal: 0 if success 51 + @@ -277,7 +311,7 @@ 52 + int RetVal = 0; 53 + FILE *InF = NULL; 54 + FILE *TempF = NULL; 55 + - char TempPath[16]; 56 + + char *TempPath; 57 + struct stat StatBuf; 58 + struct utimbuf UTimeBuf; 59 + int fd; 60 + @@ -286,8 +320,7 @@ 61 + if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 62 + RetVal = -1; 63 + 64 + - strcpy (TempPath, "./d2utmpXXXXXX"); 65 + - if((fd=mkstemp (TempPath))<0) { 66 + + if((fd = MakeTempFileFrom(ipOutFN, &TempPath))<0) { 67 + perror("Failed to open output temp file"); 68 + RetVal = -1; 69 + } 70 + @@ -304,6 +337,7 @@ 71 + if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) 72 + { 73 + fclose (InF); 74 + + InF = NULL; 75 + RetVal = -1; 76 + } 77 + 78 + @@ -337,9 +371,6 @@ 79 + /* can rename temp file to out file? */ 80 + if (!RetVal) 81 + { 82 + - if (stat(ipOutFN, &StatBuf) == 0) 83 + - unlink(ipOutFN); 84 + - 85 + if ((rename(TempPath, ipOutFN) == -1) && (!ipFlag->Quiet)) 86 + { 87 + fprintf(stderr, "dos2unix: problems renaming '%s' to '%s'\n", TempPath, ipOutFN); 88 + @@ -347,6 +378,7 @@ 89 + RetVal = -1; 90 + } 91 + } 92 + + free(TempPath); 93 + return RetVal; 94 + } 95 + 96 + @@ -362,7 +394,7 @@ 97 + int RetVal = 0; 98 + FILE *InF = NULL; 99 + FILE *TempF = NULL; 100 + - char TempPath[16]; 101 + + char *TempPath; 102 + struct stat StatBuf; 103 + struct utimbuf UTimeBuf; 104 + mode_t mode = S_IRUSR | S_IWUSR; 105 + @@ -374,8 +406,7 @@ 106 + else 107 + mode = StatBuf.st_mode; 108 + 109 + - strcpy (TempPath, "./u2dtmpXXXXXX"); 110 + - if((fd=mkstemp (TempPath))<0) { 111 + + if((fd = MakeTempFileFrom(ipInFN, &TempPath))<0) { 112 + perror("Failed to open output temp file"); 113 + RetVal = -1; 114 + } 115 + @@ -395,6 +426,7 @@ 116 + if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) 117 + { 118 + fclose (InF); 119 + + InF = NULL; 120 + RetVal = -1; 121 + } 122 + 123 + @@ -422,10 +454,6 @@ 124 + RetVal = -1; 125 + } 126 + 127 + - /* can delete in file? */ 128 + - if ((!RetVal) && (unlink(ipInFN) == -1)) 129 + - RetVal = -1; 130 + - 131 + /* any error? */ 132 + if ((RetVal) && (unlink(TempPath))) 133 + RetVal = -1; 134 + @@ -440,6 +468,7 @@ 135 + } 136 + RetVal = -1; 137 + } 138 + + free(TempPath); 139 + return RetVal; 140 + } 141 +
+49
pkgs/tools/text/dos2unix/dos2unix-3.1.patch
··· 1 + --- dos2unix-3.1/Makefile.orig Thu Nov 19 07:09:38 1998 2 + +++ dos2unix-3.1/Makefile Fri Nov 17 13:25:35 2000 3 + @@ -1,10 +1,12 @@ 4 + +CFLAGS= 5 + + 6 + default: dos2unix 7 + 8 + all: dos2unix link install 9 + 10 + 11 + dos2unix: 12 + - gcc -O dos2unix.c -o dos2unix 13 + + gcc $(CFLAGS) dos2unix.c -o dos2unix 14 + 15 + 16 + link: 17 + @@ -12,11 +14,10 @@ 18 + ln -s dos2unix.1 mac2unix.1 19 + 20 + clean: 21 + - rm dos2unix 22 + + rm -f dos2unix mac2unix mac2unix.1 *~ *.orig core 23 + 24 + install: 25 + install -m 755 dos2unix /usr/local/bin 26 + install -m 644 dos2unix.1 /usr/local/man/man1 27 + install -m 755 mac2unix /usr/local/bin 28 + install -m 644 mac2unix.1 /usr/local/man/man1 29 + - 30 + --- dos2unix-3.1/dos2unix.c.orig Thu Nov 19 07:19:25 1998 31 + +++ dos2unix-3.1/dos2unix.c Fri Nov 17 13:25:25 2000 32 + @@ -267,7 +267,7 @@ 33 + 34 + strcpy (TempPath, "./d2utmp"); 35 + strcat (TempPath, "XXXXXX"); 36 + - mktemp (TempPath); 37 + + mkstemp (TempPath); 38 + 39 + #ifdef DEBUG 40 + fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath); 41 + @@ -347,7 +347,7 @@ 42 + 43 + strcpy (TempPath, "./u2dtmp"); 44 + strcat (TempPath, "XXXXXX"); 45 + - mktemp (TempPath); 46 + + mkstemp (TempPath); 47 + 48 + #ifdef DEBUG 49 + fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
+42
pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch
··· 1 + diff -up dos2unix-3.1/dos2unix.c.c-missing-arg dos2unix-3.1/dos2unix.c 2 + --- dos2unix-3.1/dos2unix.c.c-missing-arg 2008-01-18 09:24:21.000000000 +0000 3 + +++ dos2unix-3.1/dos2unix.c 2008-01-18 09:25:43.000000000 +0000 4 + @@ -533,19 +533,28 @@ int main (int argc, char *argv[]) 5 + 6 + if ((strcmp(argv[ArgIdx],"-c") == 0) || (strcmp(argv[ArgIdx],"--convmode") == 0)) 7 + { 8 + - ArgIdx++; 9 + - if (strcmpi(argv[ArgIdx],"ASCII") == 0) 10 + - pFlag->ConvMode = 0; 11 + - else if (strcmpi(argv[ArgIdx], "7Bit") == 0) 12 + - pFlag->ConvMode = 1; 13 + - else if (strcmpi(argv[ArgIdx], "ISO") == 0) 14 + - pFlag->ConvMode = 2; 15 + - else if (strcmpi(argv[ArgIdx], "Mac") == 0) 16 + - pFlag->ConvMode = 3; 17 + + if (++ArgIdx < argc) 18 + + { 19 + + if (strcmpi(argv[ArgIdx],"ASCII") == 0) 20 + + pFlag->ConvMode = 0; 21 + + else if (strcmpi(argv[ArgIdx], "7Bit") == 0) 22 + + pFlag->ConvMode = 1; 23 + + else if (strcmpi(argv[ArgIdx], "ISO") == 0) 24 + + pFlag->ConvMode = 2; 25 + + else if (strcmpi(argv[ArgIdx], "Mac") == 0) 26 + + pFlag->ConvMode = 3; 27 + + else 28 + + { 29 + + if (!pFlag->Quiet) 30 + + fprintf(stderr, "dos2unix: invalid %s conversion mode specified\n",argv[ArgIdx]); 31 + + ShouldExit = 1; 32 + + } 33 + + } 34 + else 35 + { 36 + + ArgIdx--; 37 + if (!pFlag->Quiet) 38 + - fprintf(stderr, "dos2unix: invalid %s conversion mode specified\n",argv[ArgIdx]); 39 + + fprintf(stderr,"dos2unix: option `%s' requires an argument\n",argv[ArgIdx]); 40 + ShouldExit = 1; 41 + } 42 + }
+12
pkgs/tools/text/dos2unix/dos2unix-manpage.patch
··· 1 + diff -up dos2unix-3.1/dos2unix.1.manpage dos2unix-3.1/dos2unix.1 2 + --- dos2unix-3.1/dos2unix.1.manpage 2008-09-08 09:58:46.000000000 +0100 3 + +++ dos2unix-3.1/dos2unix.1 2008-09-08 09:58:56.000000000 +0100 4 + @@ -52,7 +52,7 @@ default to run in this mode. Wildcard na 5 + .B \-n \-\-newfile infile outfile ... 6 + New file mode. Convert the infile and write output to outfile. File names 7 + must be given in pairs and wildcard names should NOT be used or you WILL 8 + -lost your files. 9 + +lose your files. 10 + 11 + .SH "EXAMPLES" 12 + .LP
+15
pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch
··· 1 + diff -up dos2unix-3.1/dos2unix.c.missing-proto dos2unix-3.1/dos2unix.c 2 + --- dos2unix-3.1/dos2unix.c.missing-proto 2008-04-14 17:11:58.000000000 +0100 3 + +++ dos2unix-3.1/dos2unix.c 2008-04-14 17:12:42.000000000 +0100 4 + @@ -75,6 +75,11 @@ static int macmode = 0; 5 + #include <string.h> 6 + #include <utime.h> 7 + #include <sys/stat.h> 8 + +#if defined(__MSDOS__) || defined(__WIN32__) || defined(_WIN32) 9 + +# include <io.h> 10 + +#else 11 + +# include <unistd.h> 12 + +#endif 13 + #include "dos2unix.h" 14 + 15 +
+28
pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch
··· 1 + diff -up dos2unix-3.1/dos2unix.c.preserve-file-modes dos2unix-3.1/dos2unix.c 2 + --- dos2unix-3.1/dos2unix.c.preserve-file-modes 2008-09-08 09:58:05.000000000 +0100 3 + +++ dos2unix-3.1/dos2unix.c 2008-09-08 10:16:04.000000000 +0100 4 + @@ -320,9 +320,10 @@ int ConvertDosToUnixNewFile(char *ipInFN 5 + struct stat StatBuf; 6 + struct utimbuf UTimeBuf; 7 + int fd; 8 + + mode_t mask; 9 + 10 + /* retrieve ipInFN file date stamp */ 11 + - if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 12 + + if (stat(ipInFN, &StatBuf)) 13 + RetVal = -1; 14 + 15 + if((fd = MakeTempFileFrom(ipOutFN, &TempPath))<0) { 16 + @@ -346,6 +347,12 @@ int ConvertDosToUnixNewFile(char *ipInFN 17 + RetVal = -1; 18 + } 19 + 20 + + /* preserve original mode as modified by umask */ 21 + + mask = umask(0); 22 + + umask(mask); 23 + + if (!RetVal && fchmod(fd, StatBuf.st_mode & ~mask)) 24 + + RetVal = -1; 25 + + 26 + /* conversion sucessful? */ 27 + if ((!RetVal) && (ConvertDosToUnix(InF, TempF, ipFlag))) 28 + RetVal = -1;
+37
pkgs/tools/text/unix2dos/default.nix
··· 1 + {stdenv, fetchurl}: 2 + 3 + stdenv.mkDerivation { 4 + name = "unix2dos-2.2"; 5 + 6 + src = fetchurl { 7 + url = http://cvs.fedoraproject.org/repo/pkgs/unix2dos/unix2dos-2.2.src.tar.gz/e4488c241fa9067a48a7534a21d4babb/unix2dos-2.2.src.tar.gz; 8 + md5 = "e4488c241fa9067a48a7534a21d4babb"; 9 + }; 10 + 11 + patches = [ 12 + ./unix2dos-mkstemp.patch 13 + ./unix2dos-2.2-segfault.patch 14 + ./unix2dos-2.2-manpage.patch 15 + ./unix2dos-2.2-mode.patch 16 + ./unix2dos-2.2-tmppath.patch 17 + ./unix2dos-preserve-file-modes.patch 18 + ]; 19 + 20 + sourceRoot = "."; 21 + 22 + buildPhase = '' 23 + cc -o unix2dos unix2dos.c 24 + ''; 25 + 26 + installPhase = '' 27 + ensureDir $out/bin 28 + ensureDir $out/share/man 29 + install -p -m755 unix2dos $out/bin 30 + install -p -m444 unix2dos.1 $out/share/man 31 + ''; 32 + 33 + meta = { 34 + homepage = http://unknown/; 35 + description = "unix2dos tool"; 36 + }; 37 + }
+42
pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch
··· 1 + diff -up unix2dos-2.2/unix2dos.1.man unix2dos-2.2/unix2dos.1 2 + --- unix2dos-2.2/unix2dos.1.man 1995-03-30 17:03:22.000000000 +0100 3 + +++ unix2dos-2.2/unix2dos.1 2008-09-08 09:49:19.000000000 +0100 4 + @@ -16,7 +16,7 @@ Options: 5 + .SH DESCRIPTION 6 + 7 + .PP 8 + -This manual page documents dos2unix, the program that converts text 9 + +This manual page documents unix2dos, the program that converts text 10 + files in UNIX format to DOS format. 11 + 12 + .SH OPTIONS 13 + @@ -40,7 +40,7 @@ Prints version information. 14 + 15 + .TP 16 + .B \-c --convmode convmode 17 + -Sets conversion mode. Simulates dos2unix under SunOS. 18 + +Sets conversion mode. Simulates unix2dos under SunOS. 19 + 20 + .TP 21 + .B \-o --oldfile file ... 22 + @@ -51,7 +51,7 @@ default to run in this mode. Wildcard na 23 + .B \-n --newfile infile outfile ... 24 + New file mode. Convert the infile and write output to outfile. File names 25 + must be given in pairs and wildcard names should NOT be used or you WILL 26 + -lost your files. 27 + +lose your files. 28 + 29 + .SH EXAMPLES 30 + 31 + @@ -71,9 +71,9 @@ Convert and replace a.txt. Convert and r 32 + Convert and replace a.txt in ASCII conversion mode. 33 + Convert and replace b.txt in ISO conversion mode. 34 + .IP 35 + -.B dos2unix a.txt -c iso b.txt 36 + +.B unix2dos a.txt -c iso b.txt 37 + .IP 38 + -.B dos2unix -c ascii a.txt -c iso b.txt 39 + +.B unix2dos -c ascii a.txt -c iso b.txt 40 + 41 + .LP 42 + Convert and replace a.txt while keeping original date stamp.
+29
pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch
··· 1 + diff -up unix2dos-2.2/unix2dos.c.mode unix2dos-2.2/unix2dos.c 2 + --- unix2dos-2.2/unix2dos.c.mode 2008-09-08 10:13:39.000000000 +0100 3 + +++ unix2dos-2.2/unix2dos.c 2008-09-08 10:13:39.000000000 +0100 4 + @@ -292,11 +292,14 @@ int ConvertUnixToDosOldFile(char* ipInFN 5 + char TempPath[16]; 6 + struct stat StatBuf; 7 + struct utimbuf UTimeBuf; 8 + + mode_t mode = S_IRUSR | S_IWUSR; 9 + int fd; 10 + 11 + /* retrieve ipInFN file date stamp */ 12 + - if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 13 + + if (stat(ipInFN, &StatBuf)) 14 + RetVal = -1; 15 + + else 16 + + mode = StatBuf.st_mode; 17 + 18 + strcpy (TempPath, "./u2dtmpXXXXXX"); 19 + if((fd=mkstemp (TempPath)) < 0) { 20 + @@ -304,6 +307,9 @@ int ConvertUnixToDosOldFile(char* ipInFN 21 + RetVal = -1; 22 + } 23 + 24 + + if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR)) 25 + + RetVal = -1; 26 + + 27 + #ifdef DEBUG 28 + fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath); 29 + #endif DEBUG
+94
pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch
··· 1 + --- unix2dos-2.2/unix2dos.c.segf Thu Jan 17 17:09:49 2002 2 + +++ unix2dos-2.2/unix2dos.c Thu Jan 17 17:12:47 2002 3 + @@ -131,9 +131,9 @@ 4 + * RetVal: NULL if failure 5 + * file stream otherwise 6 + */ 7 + -FILE* OpenOutFile(char *ipFN) 8 + +FILE* OpenOutFile(int fd) 9 + { 10 + - return (fopen(ipFN, W_CNTRL)); 11 + + return (fdopen(fd, W_CNTRL)); 12 + } 13 + 14 + 15 + @@ -207,14 +207,17 @@ 16 + char TempPath[16]; 17 + struct stat StatBuf; 18 + struct utimbuf UTimeBuf; 19 + + int fd; 20 + 21 + /* retrieve ipInFN file date stamp */ 22 + if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 23 + RetVal = -1; 24 + 25 + - strcpy (TempPath, "./u2dtmp"); 26 + - strcat (TempPath, "XXXXXX"); 27 + - mkstemp (TempPath); 28 + + strcpy (TempPath, "./u2dtmpXXXXXX"); 29 + + if((fd=mkstemp (TempPath)) < 0) { 30 + + perror("Can't open output temp file"); 31 + + RetVal = -1; 32 + + } 33 + 34 + #ifdef DEBUG 35 + fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath); 36 + @@ -225,7 +228,7 @@ 37 + RetVal = -1; 38 + 39 + /* can open out file? */ 40 + - if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL)) 41 + + if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) 42 + { 43 + fclose (InF); 44 + RetVal = -1; 45 + @@ -243,6 +246,9 @@ 46 + if ((TempF) && (fclose(TempF) == EOF)) 47 + RetVal = -1; 48 + 49 + + if(fd>=0) 50 + + close(fd); 51 + + 52 + if ((!RetVal) && (ipFlag->KeepDate)) 53 + { 54 + UTimeBuf.actime = StatBuf.st_atime; 55 + @@ -286,14 +292,17 @@ 56 + char TempPath[16]; 57 + struct stat StatBuf; 58 + struct utimbuf UTimeBuf; 59 + + int fd; 60 + 61 + /* retrieve ipInFN file date stamp */ 62 + if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 63 + RetVal = -1; 64 + 65 + - strcpy (TempPath, "./u2dtmp"); 66 + - strcat (TempPath, "XXXXXX"); 67 + - mkstemp (TempPath); 68 + + strcpy (TempPath, "./u2dtmpXXXXXX"); 69 + + if((fd=mkstemp (TempPath)) < 0) { 70 + + perror("Can't open output temp file"); 71 + + RetVal = -1; 72 + + } 73 + 74 + #ifdef DEBUG 75 + fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath); 76 + @@ -304,7 +313,7 @@ 77 + RetVal = -1; 78 + 79 + /* can open out file? */ 80 + - if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL)) 81 + + if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) 82 + { 83 + fclose (InF); 84 + RetVal = -1; 85 + @@ -322,6 +331,9 @@ 86 + if ((TempF) && (fclose(TempF) == EOF)) 87 + RetVal = -1; 88 + 89 + + if(fd>=0) 90 + + close(fd); 91 + + 92 + if ((!RetVal) && (ipFlag->KeepDate)) 93 + { 94 + UTimeBuf.actime = StatBuf.st_atime;
+146
pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch
··· 1 + diff -up unix2dos-2.2/unix2dos.c.tmppath unix2dos-2.2/unix2dos.c 2 + --- unix2dos-2.2/unix2dos.c.tmppath 2008-09-08 10:14:30.000000000 +0100 3 + +++ unix2dos-2.2/unix2dos.c 2008-09-08 10:14:30.000000000 +0100 4 + @@ -57,7 +57,10 @@ 5 + 6 + #ifdef __MSDOS__ 7 + # include <dir.h> 8 + +#else 9 + +# include <unistd.h> 10 + #endif __MSDOS 11 + +#include <libgen.h> 12 + #include <stdio.h> 13 + #include <stdlib.h> 14 + #include <string.h> 15 + @@ -195,6 +198,40 @@ int ConvertUnixToDos(FILE* ipInF, FILE* 16 + } 17 + 18 + 19 + +static int MakeTempFileFrom(const char *OutFN, char **fname_ret) 20 + +{ 21 + + char *cpy = strdup(OutFN); 22 + + char *dir = NULL; 23 + + size_t fname_len = 0; 24 + + char *fname_str = NULL; 25 + + int fd = -1; 26 + + 27 + + *fname_ret = NULL; 28 + + 29 + + if (!cpy) 30 + + goto make_failed; 31 + + 32 + + dir = dirname(cpy); 33 + + 34 + + fname_len = strlen(dir) + strlen("/u2dtmpXXXXXX") + sizeof (char); 35 + + if (!(fname_str = malloc(fname_len))) 36 + + goto make_failed; 37 + + sprintf(fname_str, "%s%s", dir, "/u2dtmpXXXXXX"); 38 + + *fname_ret = fname_str; 39 + + 40 + + free(cpy); 41 + + 42 + + if ((fd = mkstemp(fname_str)) == -1) 43 + + goto make_failed; 44 + + 45 + + return (fd); 46 + + 47 + + make_failed: 48 + + free(*fname_ret); 49 + + *fname_ret = NULL; 50 + + return (-1); 51 + +} 52 + + 53 + /* convert file ipInFN to DOS format text and write to file ipOutFN 54 + * RetVal: 0 if success 55 + * -1 otherwise 56 + @@ -204,7 +241,7 @@ int ConvertUnixToDosNewFile(char *ipInFN 57 + int RetVal = 0; 58 + FILE *InF = NULL; 59 + FILE *TempF = NULL; 60 + - char TempPath[16]; 61 + + char *TempPath; 62 + struct stat StatBuf; 63 + struct utimbuf UTimeBuf; 64 + int fd; 65 + @@ -213,8 +250,7 @@ int ConvertUnixToDosNewFile(char *ipInFN 66 + if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 67 + RetVal = -1; 68 + 69 + - strcpy (TempPath, "./u2dtmpXXXXXX"); 70 + - if((fd=mkstemp (TempPath)) < 0) { 71 + + if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) { 72 + perror("Can't open output temp file"); 73 + RetVal = -1; 74 + } 75 + @@ -231,6 +267,7 @@ int ConvertUnixToDosNewFile(char *ipInFN 76 + if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) 77 + { 78 + fclose (InF); 79 + + InF = NULL; 80 + RetVal = -1; 81 + } 82 + 83 + @@ -265,9 +302,6 @@ int ConvertUnixToDosNewFile(char *ipInFN 84 + /* can rename temp file to out file? */ 85 + if (!RetVal) 86 + { 87 + - if (stat(ipOutFN, &StatBuf) == 0) 88 + - unlink(ipOutFN); 89 + - 90 + if ((rename(TempPath, ipOutFN) == -1) && (!ipFlag->Quiet)) 91 + { 92 + fprintf(stderr, "unix2dos: problems renaming '%s' to '%s'\n", TempPath, ipOutFN); 93 + @@ -275,6 +309,7 @@ int ConvertUnixToDosNewFile(char *ipInFN 94 + RetVal = -1; 95 + } 96 + } 97 + + free(TempPath); 98 + 99 + return RetVal; 100 + } 101 + @@ -289,7 +324,7 @@ int ConvertUnixToDosOldFile(char* ipInFN 102 + int RetVal = 0; 103 + FILE *InF = NULL; 104 + FILE *TempF = NULL; 105 + - char TempPath[16]; 106 + + char *TempPath; 107 + struct stat StatBuf; 108 + struct utimbuf UTimeBuf; 109 + mode_t mode = S_IRUSR | S_IWUSR; 110 + @@ -301,8 +336,7 @@ int ConvertUnixToDosOldFile(char* ipInFN 111 + else 112 + mode = StatBuf.st_mode; 113 + 114 + - strcpy (TempPath, "./u2dtmpXXXXXX"); 115 + - if((fd=mkstemp (TempPath)) < 0) { 116 + + if((fd = MakeTempFileFrom(ipInFN, &TempPath)) < 0) { 117 + perror("Can't open output temp file"); 118 + RetVal = -1; 119 + } 120 + @@ -322,6 +356,7 @@ int ConvertUnixToDosOldFile(char* ipInFN 121 + if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) 122 + { 123 + fclose (InF); 124 + + InF = NULL; 125 + RetVal = -1; 126 + } 127 + 128 + @@ -349,10 +384,6 @@ int ConvertUnixToDosOldFile(char* ipInFN 129 + RetVal = -1; 130 + } 131 + 132 + - /* can delete in file? */ 133 + - if ((!RetVal) && (unlink(ipInFN) == -1)) 134 + - RetVal = -1; 135 + - 136 + /* any error? */ 137 + if ((RetVal) && (unlink(TempPath))) 138 + RetVal = -1; 139 + @@ -367,6 +398,7 @@ int ConvertUnixToDosOldFile(char* ipInFN 140 + } 141 + RetVal = -1; 142 + } 143 + + free(TempPath); 144 + return RetVal; 145 + } 146 +
+20
pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch
··· 1 + --- unix2dos-2.2/unix2dos.c.orig Fri Nov 17 13:29:24 2000 2 + +++ unix2dos-2.2/unix2dos.c Fri Nov 17 13:30:16 2000 3 + @@ -214,7 +214,7 @@ 4 + 5 + strcpy (TempPath, "./u2dtmp"); 6 + strcat (TempPath, "XXXXXX"); 7 + - mktemp (TempPath); 8 + + mkstemp (TempPath); 9 + 10 + #ifdef DEBUG 11 + fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath); 12 + @@ -293,7 +293,7 @@ 13 + 14 + strcpy (TempPath, "./u2dtmp"); 15 + strcat (TempPath, "XXXXXX"); 16 + - mktemp (TempPath); 17 + + mkstemp (TempPath); 18 + 19 + #ifdef DEBUG 20 + fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+29
pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch
··· 1 + diff -up unix2dos-2.2/unix2dos.c~ unix2dos-2.2/unix2dos.c 2 + --- unix2dos-2.2/unix2dos.c~ 2008-03-03 13:16:34.000000000 +0000 3 + +++ unix2dos-2.2/unix2dos.c 2008-03-03 13:22:10.000000000 +0000 4 + @@ -244,10 +244,11 @@ int ConvertUnixToDosNewFile(char *ipInFN 5 + char *TempPath; 6 + struct stat StatBuf; 7 + struct utimbuf UTimeBuf; 8 + + mode_t mask; 9 + int fd; 10 + 11 + /* retrieve ipInFN file date stamp */ 12 + - if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) 13 + + if (stat(ipInFN, &StatBuf)) 14 + RetVal = -1; 15 + 16 + if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) { 17 + @@ -271,6 +272,12 @@ int ConvertUnixToDosNewFile(char *ipInFN 18 + RetVal = -1; 19 + } 20 + 21 + + /* preserve original mode as modified by umask */ 22 + + mask = umask(0); 23 + + umask(mask); 24 + + if (!RetVal && fchmod(fd, StatBuf.st_mode & ~mask)) 25 + + RetVal = -1; 26 + + 27 + /* conversion sucessful? */ 28 + if ((!RetVal) && (ConvertUnixToDos(InF, TempF, ipFlag))) 29 + RetVal = -1;
+8
pkgs/top-level/all-packages.nix
··· 693 693 inherit (xlibs) libX11 xproto libXt; 694 694 }; 695 695 696 + dos2unix = import ../tools/text/dos2unix { 697 + inherit fetchurl stdenv; 698 + }; 699 + 700 + unix2dos = import ../tools/text/unix2dos { 701 + inherit fetchurl stdenv; 702 + }; 703 + 696 704 gawk = useFromStdenv "gawk" 697 705 (import ../tools/text/gawk { 698 706 inherit fetchurl stdenv;