Compare commits

...
Sign in to create a new pull request.

15 commits

Author SHA1 Message Date
Tim Waugh
f0512d50bb Dead package (obsoleted by dos2unix-5.1). 2010-08-18 12:11:36 +01:00
Fedora Release Engineering
2bc253901f dist-git conversion 2010-07-29 18:04:39 +00:00
Tim Waugh
6b1b060065 - 4.1.2. 2010-01-26 09:57:31 +00:00
Tim Waugh
1070a5a156 - 4.1.1. New upstream. 2010-01-22 10:41:47 +00:00
Bill Nottingham
2bc791f85c Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-25 22:52:47 +00:00
Jesse Keating
f8b4f13cce - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild 2009-07-27 06:33:45 +00:00
Jesse Keating
6c45e8a628 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild 2009-02-25 23:08:15 +00:00
Tom Callaway
ead8ef5d92 fix license tag 2008-09-09 02:57:52 +00:00
Tim Waugh
b3f63a75ab - Removed patch fuzz. 2008-09-08 09:15:22 +00:00
Tim Waugh
d7f7995a2b - Preserve file modes (bug #437469). 2008-09-08 08:57:00 +00:00
Tim Waugh
18dfe2db24 - Fixed grammar in man page (bug #460731). 2008-09-08 08:50:37 +00:00
Tim Waugh
d1f2d7b9d5 - Explicitly apply patch0. 2008-09-08 08:48:06 +00:00
Tim Waugh
e9607f5957 - Rebuild for GCC 4.3. 2008-02-13 10:57:24 +00:00
Bill Nottingham
8594cd18d1 makefile update to properly grab makefile.common 2007-10-15 19:29:21 +00:00
Tim Waugh
a1e810327e - Rebuilt. 2007-08-29 14:43:16 +00:00
11 changed files with 4 additions and 474 deletions

View file

@ -1 +0,0 @@
unix2dos-2.2.src.tar.gz

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
unix2dos-2.2.src.tar.gz
unix2dos-4.1.1.tar.gz
unix2dos-4.1.2.tar.gz

View file

@ -1,6 +0,0 @@
# Makefile for source rpm: unix2dos
# $Id$
NAME := unix2dos
SPECFILE = $(firstword $(wildcard *.spec))
include ../common/Makefile.common

1
dead.package Normal file
View file

@ -0,0 +1 @@
Obsoleted by dos2unix-5.1, which merges unix2dos.

View file

@ -1 +0,0 @@
e4488c241fa9067a48a7534a21d4babb unix2dos-2.2.src.tar.gz

View file

@ -1,32 +0,0 @@
--- unix2dos-2.2/unix2dos.1.man Thu Jan 17 17:25:08 2002
+++ unix2dos-2.2/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.

View file

@ -1,28 +0,0 @@
--- unix2dos-2.2/unix2dos.c.mode 2004-10-11 14:20:07.194483616 +0100
+++ unix2dos-2.2/unix2dos.c 2004-10-11 14:20:30.752966221 +0100
@@ -292,11 +292,14 @@
char TempPath[16];
struct stat StatBuf;
struct utimbuf UTimeBuf;
+ mode_t mode = S_IRUSR | S_IWUSR;
int fd;
/* retrieve ipInFN file date stamp */
- if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+ if (stat(ipInFN, &StatBuf))
RetVal = -1;
+ else
+ mode = StatBuf.st_mode;
strcpy (TempPath, "./u2dtmpXXXXXX");
if((fd=mkstemp (TempPath)) < 0) {
@@ -304,6 +307,9 @@
RetVal = -1;
}
+ if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR))
+ RetVal = -1;
+
#ifdef DEBUG
fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
#endif

View file

@ -1,94 +0,0 @@
--- unix2dos-2.2/unix2dos.c.segf Thu Jan 17 17:09:49 2002
+++ unix2dos-2.2/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;

View file

@ -1,144 +0,0 @@
--- unix2dos-2.2/unix2dos.c.tmppath 2004-10-20 16:10:06.941343976 +0200
+++ unix2dos-2.2/unix2dos.c 2004-10-20 16:17:52.199613968 +0200
@@ -57,7 +57,10 @@
#ifdef __MSDOS__
# include <dir.h>
+#else
+# include <unistd.h>
#endif __MSDOS
+#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -195,6 +198,40 @@
}
+static int MakeTempFileFrom(const char *OutFN, char **fname_ret)
+{
+ char *cpy = strdup(OutFN);
+ char *dir = NULL;
+ size_t fname_len = 0;
+ char *fname_str = NULL;
+ int fd = -1;
+
+ *fname_ret = NULL;
+
+ if (!cpy)
+ goto make_failed;
+
+ dir = dirname(cpy);
+
+ fname_len = strlen(dir) + strlen("/u2dtmpXXXXXX") + sizeof (char);
+ if (!(fname_str = malloc(fname_len)))
+ goto make_failed;
+ sprintf(fname_str, "%s%s", dir, "/u2dtmpXXXXXX");
+ *fname_ret = fname_str;
+
+ free(cpy);
+
+ if ((fd = mkstemp(fname_str)) == -1)
+ goto make_failed;
+
+ return (fd);
+
+ make_failed:
+ free(*fname_ret);
+ *fname_ret = NULL;
+ return (-1);
+}
+
/* convert file ipInFN to DOS format text and write to file ipOutFN
* RetVal: 0 if success
* -1 otherwise
@@ -204,7 +241,7 @@
int RetVal = 0;
FILE *InF = NULL;
FILE *TempF = NULL;
- char TempPath[16];
+ char *TempPath;
struct stat StatBuf;
struct utimbuf UTimeBuf;
int fd;
@@ -214,7 +251,6 @@
RetVal = -1;
- strcpy (TempPath, "./u2dtmpXXXXXX");
- if((fd=mkstemp (TempPath)) < 0) {
+ if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) {
perror("Can't open output temp file");
RetVal = -1;
}
@@ -231,6 +267,7 @@
if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
{
fclose (InF);
+ InF = NULL;
RetVal = -1;
}
@@ -265,9 +302,6 @@
/* can rename temp file to out file? */
if (!RetVal)
{
- if (stat(ipOutFN, &StatBuf) == 0)
- unlink(ipOutFN);
-
if ((rename(TempPath, ipOutFN) == -1) && (!ipFlag->Quiet))
{
fprintf(stderr, "unix2dos: problems renaming '%s' to '%s'\n", TempPath, ipOutFN);
@@ -275,6 +309,7 @@
RetVal = -1;
}
}
+ free(TempPath);
return RetVal;
}
@@ -289,7 +324,7 @@
int RetVal = 0;
FILE *InF = NULL;
FILE *TempF = NULL;
- char TempPath[16];
+ char *TempPath;
struct stat StatBuf;
struct utimbuf UTimeBuf;
mode_t mode = S_IRUSR | S_IWUSR;
@@ -301,8 +336,7 @@
else
mode = StatBuf.st_mode;
- strcpy (TempPath, "./u2dtmpXXXXXX");
- if((fd=mkstemp (TempPath)) < 0) {
+ if((fd = MakeTempFileFrom(ipInFN, &TempPath)) < 0) {
perror("Can't open output temp file");
RetVal = -1;
}
@@ -322,6 +356,7 @@
if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
{
fclose (InF);
+ InF = NULL;
RetVal = -1;
}
@@ -349,10 +384,6 @@
RetVal = -1;
}
- /* can delete in file? */
- if ((!RetVal) && (unlink(ipInFN) == -1))
- RetVal = -1;
-
/* any error? */
if ((RetVal) && (unlink(TempPath)))
RetVal = -1;
@@ -367,6 +398,7 @@
}
RetVal = -1;
}
+ free(TempPath);
return RetVal;
}

View file

@ -1,20 +0,0 @@
--- unix2dos-2.2/unix2dos.c.orig Fri Nov 17 13:29:24 2000
+++ unix2dos-2.2/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);

View file

@ -1,148 +0,0 @@
Summary: UNIX to DOS text file format converter
Name: unix2dos
Version: 2.2
Release: 28%{?dist}
License: Distributable
Group: Applications/Text
Source: unix2dos-2.2.src.tar.gz
Patch0: unix2dos-mkstemp.patch
Patch1: unix2dos-2.2-segfault.patch
Patch2: unix2dos-2.2-manpage.patch
Patch3: unix2dos-2.2-mode.patch
Patch4: unix2dos-2.2-tmppath.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%prep
%setup -q -c
%patch -p1 -b .sec
%patch1 -p1 -b .segf
%patch2 -p1 -b .man
%patch3 -p1 -b .mode
%patch4 -p1 -b .tmppath
perl -pi -e "s/^#endif.*/#endif/g;s/^#else.*/#else/g" *.[ch]
%description
A utility that converts plain text files in UNIX format to DOS format.
%build
gcc $RPM_OPT_FLAGS -o unix2dos unix2dos.c
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
install -p -m755 unix2dos $RPM_BUILD_ROOT%{_bindir}
install -p -m444 unix2dos.1 $RPM_BUILD_ROOT%{_mandir}/man1
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root,0755)
%doc COPYRIGHT
%{_bindir}/unix2dos
%{_mandir}/*/*
%changelog
* Wed Feb 7 2007 Tim Waugh <twaugh@redhat.com> 2.2-28
- Fixed license tag (bug #226514).
* Tue Feb 6 2007 Tim Waugh <twaugh@redhat.com> 2.2-27
- Preserve timestamps on install (bug #226514).
- Fixed summary (bug #226514).
- Fixed build root (bug #226514).
- Don't explicitly require perl for build (bug #226514).
- Added dist to release tag (bug #226514).
- Don't build with '-Wall' since RPM_OPT_FLAGS already includes it
(bug #226514).
- Fixed macros in changelog (bug #226514).
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2.2-26.2.2
- rebuild
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.2-26.2.1
- bump again for double-long bug on ppc(64)
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 2.2-26.2
- rebuilt for new gcc4.1 snapshot and glibc changes
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Wed Apr 13 2005 Tim Waugh <twaugh@redhat.com>
- Merge last fix into tmppath patch, which introduced the original problem.
* Tue Apr 12 2005 Tim Waugh <twaugh@redhat.com> 2.2-26
- Removed inappropriate strcpy (bug #153079). Patch from Neil Horman.
* Thu Mar 3 2005 Mike A. Harris <mharris@redhat.com> 2.2-25
- Rebuild with gcc 4 for FC4
* Wed Oct 20 2004 Miloslav Trmac <mitr@redhat.com> 2.2-24
- Don't just delete the original file when destination and current directory
are on different filesystems
* Mon Oct 11 2004 Tim Waugh <twaugh@redhat.com> 2.2-23
- Apply H J Lu's patch to preserve file mode (bug #91332).
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt
* Mon Oct 7 2002 Mike A. Harris <mharris@redhat.com> 2.2-18
- All-arch rebuild
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Tue Mar 5 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.2-15
- rebuild
* Thu Jan 17 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.2-14
- Fix up the mkstemp patch, don't segfault with lacking write permissions
(#57700)
- Fix up man page (part 2 of #57700)
- Fix compiler warnings
* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
- Bump release + rebuild.
* Fri Nov 17 2000 Tim Powers <timp@redhat.com>
- patched to use mkstemp, not much had to be done.
* Thu Nov 16 2000 Tim Powers <timp@redhat.com>
- minor spec file cleanups
- built for 7.1
- use predefined RPM macros whenever possible
- use RPM_OPT_FLAGS when building
* Tue Jul 07 1999 Peter Soos <sp@osb.hu>
- Added Hungarian "Summary:" and "%%description"
- Corrected the file and directory attributes to rebuild the package
under RedHat Linux 6.0
* Thu Jul 09 1998 Arkadiusz Mikkkkkkiewicz <misiek@misiek.eu.org>
- Recompiled under RedHat Linux 5.1
- Small changes in %%build and %%files
- Added "Vendor:"
- Added Polish "Summary:" and "%%description"
* Thu Jun 18 1998 Peter Soos <sp@osb.hu>
- Corrected the spec file for rpm 2.5
* Fri Dec 5 1997 Peter Soos <sp@osb.hu>
- Recompiled under RedHat Linux 5.0