rpms/ren/devel ren-1.0.Wall.patch, NONE, 1.1 ren.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Manuel Wolfshant (wolfy) fedora-extras-commits at redhat.com
Tue Oct 24 13:14:32 UTC 2006


Author: wolfy

Update of /cvs/extras/rpms/ren/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24283/devel

Modified Files:
	.cvsignore sources 
Added Files:
	ren-1.0.Wall.patch ren.spec 
Log Message:
auto-import ren-1.0-11 on branch devel from ren-1.0-11.src.rpm

ren-1.0.Wall.patch:

--- NEW FILE ren-1.0.Wall.patch ---
diff -N -r -u ren-1.0-old/ren.c ren-1.0/ren.c
--- ren-1.0-old/ren.c	1997-10-28 05:32:44.000000000 +0000
+++ ren-1.0/ren.c	2006-06-23 10:22:34.000000000 +0100
@@ -3,6 +3,8 @@
 #include <sys/types.h>
 #include <dirent.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
 #define direct dirent
 
@@ -27,26 +29,22 @@
 #define NODEL 2
 #define ABORTDEL 3
 
-extern int alphasort();
-extern int scandir();
-extern qsort();
-
-static procargs();
+static int procargs();
 static int procdir();
 static int checkpats();
 static int getreps();
 static int scan();
 static char *makerep();
-static checkcollisons();
+static int checkcollisons();
 static int mycmp();
-static checkdeletes();
-static int bsearch();
+static int checkdeletes();
+static int ren_bsearch();
 static char** breakcycles();
-static dorenames();
+static int dorenames();
 
 static char tempprefix[] = "renTMP";
 
-main(argc, argv)
+int main(argc, argv)
 	int argc;
 	char *(argv[]);
 {
@@ -69,7 +67,7 @@
 }
 
 
-static procargs(argc, argv, pverbose, pdelstyle, pfrom_pat, pto_pat, ppath)
+static int procargs(argc, argv, pverbose, pdelstyle, pfrom_pat, pto_pat, ppath)
 	int argc;
 	char *(argv[]);
 	int *pverbose, *pdelstyle;
@@ -124,10 +122,11 @@
 	}
 	else
 		*ppath = ".";
+	return 0;
 }
 
 
-static checkpats(from_pat, to_pat)
+static int checkpats(from_pat, to_pat)
 	char *from_pat, *to_pat;
 {
 	char *p;
@@ -171,6 +170,7 @@
 				break;
 		}
 	}
+	return 0;
 }
 
 
@@ -340,7 +340,7 @@
 }
 
 
-static checkcollisons(reps, nreps)
+static int checkcollisons(reps, nreps)
 	REP *reps;
 	int nreps;
 {
@@ -361,6 +361,7 @@
 			fputs("Aborting, no renames done.\n", stderr);
 			exit(1);
 		}
+	return 0;
 }
 
 
@@ -371,7 +372,7 @@
 }
 
 
-static checkdeletes(reps, dot, filrep, nfils, delstyle)
+static int checkdeletes(reps, dot, filrep, nfils, delstyle)
 	REP *reps;
 	struct direct *(dot[]);
 	REP *(filrep[]);
@@ -386,7 +387,7 @@
 		for (cur = reps; cur != NULL; cur = cur->nextrep) {
 			if (cur->status == FORGET)
 				continue;
-			if ((i = bsearch(cur->repname, dot, nfils)) >= 0) {
+			if ((i = ren_bsearch(cur->repname, dot, nfils)) >= 0) {
 				if (filrep[i] == NULL && cur->mustdel < 0) {
 					cur->dofirst = NULL;
 					if (delstyle == QUIETDEL)
@@ -437,10 +438,12 @@
 			}
 		}
 	} while (recheck);
+
+	return 0;
 }
 
 
-static int bsearch(s, dlist, n)
+static int ren_bsearch(s, dlist, n)
 	char *s;
 	struct direct *(dlist[]);
 	int n;
@@ -484,7 +487,7 @@
 				exit(1);
 			}
 		}
-		if (pred == cur)
+		if (pred == cur) {
 			if (cur->dofirst == cur)
 				cur->status = FORGET;
 			else {
@@ -503,12 +506,15 @@
 				cur->dofirst = NULL;
 				cur->nextrep = pred;
 			}
+		}
 	}
 	return(tempnames);
+
+	return 0;
 }
 
 
-static dorenames(reps, dot, tempnames, verbose)
+static int dorenames(reps, dot, tempnames, verbose)
 	REP *reps;
 	struct direct *(dot[]);
 	char *(tempnames[]);
@@ -548,4 +554,5 @@
 			}
 		}
 	} while (skipped);
+	return 0;
 }


--- NEW FILE ren.spec ---
Summary: Rename multiple files
Name: ren
Version: 1.0
Release: 11%{?dist}
License: Public Domain
Group: Applications/File
Source: ftp://sunsite.unc.edu/pub/Linux/utils/file/ren-1.0.tar.gz
Patch0: ren-1.0.Wall.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL: http://linux.maruhn.com/sec/ren.html

%description
Whereas mv can rename (as opposed to move) only one file at a time,
ren can rename many files according to search and replacement
patterns, ala VMS and MS-DOS (but better). ren checks for replacement name
collisions and handles rename chains (1 goes to 2 goes to 3 etc.)
gracefully.

%prep
%setup -q
%patch0 -p1

%build
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}

%install
#there is no install script included in the upstream Makefile
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_bindir} %{buildroot}/%{_mandir}/man1/
install -m 755 ren %{buildroot}/%{_bindir}
install -m 644 ren.1 %{buildroot}/%{_mandir}/man1/


%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc README
%{_mandir}/man1/ren.1*
%{_bindir}/ren

%changelog

* Fri Sep 22 2006 lonely wolf <wolfy at pcnet.ro> - 1.0-11
- "freshly" included source did not have correct timestamps. Fixed.

* Fri Sep 22 2006 lonely wolf <wolfy at pcnet.ro> - 1.0-10
- the included tar.gz file did not match the md5sum from upstrean. recreated the src.rpm with a freshly downloaded one

* Fri Sep 22 2006 lonely wolf <wolfy at pcnet.ro> - 1.0-9
- cosmetic fixes

* Thu Jul 27 2006 lonely wolf <wolfy at pcnet.ro> - 1.0-8
- fix generation of debuginfo package

* Wed Jun 28 2006 lonely wolf <wolfy at pcnet.ro> - 1.0-7
- cleanup (%%defattr, %%make)

* Thu Jun 23 2006 lonely wolf <wolfy at pcnet.ro> - 1.0-6
- minor spec cleaning

* Fri Jun 23 2006 Alan Iwi <A.M.Iwi at rl.ac.uk>
- buildroot
- man file is gzipped and is in %%{_mandir}/man1
- patch0: changes to ensure a clean build with gcc -Wall

* Sun Aug 30 1998 W. L. Estes <wlestes at uncg.edu>
- fix docdir permissions

* Sat Aug 01 1998 W. L. Estes <wlestes at hamlet.uncg.edu>
- buildroot
- drop patch to Makefile
- relocateable
- defattr in filelist


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/ren/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	24 Oct 2006 13:13:22 -0000	1.1
+++ .cvsignore	24 Oct 2006 13:14:02 -0000	1.2
@@ -0,0 +1 @@
+ren-1.0.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/ren/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	24 Oct 2006 13:13:22 -0000	1.1
+++ sources	24 Oct 2006 13:14:02 -0000	1.2
@@ -0,0 +1 @@
+245453453a8bd1c0bf7d03880b97d632  ren-1.0.tar.gz




More information about the fedora-extras-commits mailing list