Репозиторий Sisyphus
Последнее обновление: 5 октября 2022 | Пакетов: 17717 | Посещений: 25062348
en ru br
Репозитории ALT
S:0.0.16-alt2.qa1
5.1: 0.0.16-alt1
4.1: 0.0.16-alt1
www.altlinux.org/Changes

Другие репозитории
Upstream:0.0.16

Группа :: Работа с файлами
Пакет: e2tools

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: e2tools-fedora-fixes.patch
Скачать


diff -rpu e2tools-0.0.16-orig/copy.c e2tools-0.0.16-fedora-fixes/copy.c
--- e2tools-0.0.16-orig/copy.c	2004-04-07 03:15:20.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/copy.c	2011-02-09 12:41:51.363614109 +0100
@@ -239,11 +239,10 @@ copy(int argc, char *argv[])
 {
   ext2_filsys fs = NULL;
   ext2_ino_t root;
-  ext2_ino_t orig_cwd;
+  ext2_ino_t orig_cwd = -1;
   ext2_ino_t cwd;
   char tmpbuf[BUF_SIZE];
   char outpath[BUF_SIZE];
-  char *last_filesys = NULL;
   char *cur_filesys = NULL;
   int retval;
   int c;
@@ -251,7 +250,7 @@ copy(int argc, char *argv[])
   char *dest_dir = NULL;
   char *in_file = NULL;
   char *out_file = NULL;
-  int max_out_len;
+  int max_out_len = -1;
   int keep = 0;
   int absolute = 0;
   int verbose = 0;
@@ -1054,7 +1053,6 @@ read_string(char *inbuf)
   char *ptr;
   char *boundary;
   int c;
-  int cnt;
 
   boundary = inbuf + BUF_SIZE - 1;
   ptr = inbuf;
diff -rpu e2tools-0.0.16-orig/e2tools.h e2tools-0.0.16-fedora-fixes/e2tools.h
--- e2tools-0.0.16-orig/e2tools.h	2004-04-07 03:15:55.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/e2tools.h	2011-02-09 12:41:51.364614115 +0100
@@ -57,44 +57,45 @@ extern int optreset;		/* defined by BSD,
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <regex.h>
 #include "ext2fs/ext2_fs.h"
 #include "ext2fs/ext2fs.h"
 
 #define E2T_FORCE 1
 #define E2T_DO_MV 2
 
-#ifndef COPY_C
+/* from copy.c */
 extern long copy(int argc, char *argv[]);
 extern int my_strcmp(const void *n1, const void *n2);
-#endif
 
-#ifdef LN_C
+
+/* from ln.c */
 extern long do_ln(int argc, char *argv[]);
 
 extern long create_hard_link(ext2_filsys fs, ext2_ino_t cwd, ext2_ino_t
                              new_file_ino, char *newfile, int ln_flags);
-#endif
 
-#ifndef LS_C
+
+/* from ls.c */
 extern long do_list_dir(int argc, char *argv[]);
-#endif
 
-#ifndef MKDIR_C
+
+/* from mkdir.c */
 extern long e2mkdir(int argc, char *argv[]);
 extern long create_dir(ext2_filsys fs, ext2_ino_t root, ext2_ino_t *cwd,
                        char *dirname, struct stat *def_stat);
-#endif
+extern long change_cwd(ext2_filsys fs, ext2_ino_t root, ext2_ino_t *cwd,
+		       char *dirname);
 
-#ifdef MV_C
+
+/* from mv.c */
 extern long do_mv(int argc, char *argv[]);
 extern long get_file_parts(ext2_filsys fs, ext2_ino_t root, char *pathname,
                            ext2_ino_t *dir_ino, char **dir_name,
                            char **base_name);
 
-#endif
-
 
-#ifndef READ_C
+/* from read.c */
 extern long get_file(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,
                      char *infile, char *outfile, int keep);
 extern long retrieve_data(ext2_filsys fs, ext2_ino_t src, int dest_fd,
@@ -102,17 +103,17 @@ extern long retrieve_data(ext2_filsys fs
                           ext2_off_t *ret_pos);
 extern long read_to_eof(ext2_file_t infile, int dest_fd, ext2_off_t offset,
                         ext2_off_t *ret_pos);
-#endif
 
-#ifndef RM_C
+
+/* from rm.c */
 extern long e2rm(int argc, char *argv[]);
 #endif
 
-#ifndef TAIL_C
+/* from tail.c */
 extern long do_tail(int argc, char *argv[]);
-#endif
 
-#ifndef UTIL_C
+
+/* from util.c */
 extern mode_t ext2_mode_xlate(__u16 lmode);
 extern __u16 host_mode_xlate(mode_t hmode);
 extern long open_filesystem(char *name, ext2_filsys *fs, ext2_ino_t *root, int
@@ -125,14 +126,12 @@ extern long rm_file(ext2_filsys fs, ext2
                     delfile); 
 extern long delete_file(ext2_filsys fs, ext2_ino_t inode);
 extern void init_stat_buf(struct stat *buf);
-#endif
+extern int  is_file_regexp(char *ptr);
+extern regex_t *make_regexp(char *shell);
 
-#ifndef WRITE_C
+/* from write.c */
 extern long
 put_file(ext2_filsys fs, ext2_ino_t cwd, char *infile, char *outfile,
          ext2_ino_t *outfile_ino, int keep, struct stat *def_stat);
-#endif
-
-#endif
 
 
diff -rpu e2tools-0.0.16-orig/elist.c e2tools-0.0.16-fedora-fixes/elist.c
--- e2tools-0.0.16-orig/elist.c	2004-04-06 22:00:16.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/elist.c	2011-02-09 12:41:51.364614115 +0100
@@ -41,6 +41,7 @@
 /* Feature Test Switches */
 /* Headers */
 #include <memory.h>
+#include <stdlib.h>
 #include "elist.h"
 
 #ifndef NULL
@@ -79,8 +80,6 @@ elist_delete(elist_t *l, void (*data_fre
 void
 elist_free(elist_t *l, void (*data_free)(void *))
 {
-  elist_t *n;
-  
   if (l)
     {
       do
@@ -136,7 +135,7 @@ elist_insert(elist_t *l, void *data)
   return(l);
 }
 
-void elist_sort(elist_t *l, int (sort_func)(void *, void *), int reverse)
+void elist_sort(elist_t *l, int (*sort_func)(const void *, const void *), int reverse)
 {
   int c=0;
   elist_t *tl;
diff -rpu e2tools-0.0.16-orig/ln.c e2tools-0.0.16-fedora-fixes/ln.c
--- e2tools-0.0.16-orig/ln.c	2002-06-30 07:54:02.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/ln.c	2011-02-09 12:41:51.365614122 +0100
@@ -95,7 +95,6 @@ do_ln(int argc, char *argv[])
   int verbose=0;
   int force=0;
   int symlink=0;
-  int num_files;
   int errcnt=0;
   char *cur_filesys = NULL;
   ext2_filsys fs = NULL;
diff -rpu e2tools-0.0.16-orig/ls.c e2tools-0.0.16-fedora-fixes/ls.c
--- e2tools-0.0.16-orig/ls.c	2004-04-07 05:31:39.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/ls.c	2011-02-09 12:41:51.367614136 +0100
@@ -143,7 +143,6 @@ static int
 list_dir_proc(ext2_ino_t dir, int entry, struct ext2_dir_entry *dirent,
               int offset, int blocksize, char *buf, void *private)
 {
-  struct ext2_inode	inode;
   char			name[EXT2_NAME_LEN];
   struct list_dir_struct *ls = (struct list_dir_struct *) private;
   int thislen;
@@ -485,7 +484,7 @@ do_list_dir(int argc, char *argv[])
       if (ls.options & DELETED_OPT)
         flags |= DIRENT_FLAG_INCLUDE_REMOVED;
             
-      if (retval = ext2fs_check_directory(fs, inode))
+      if ((retval = ext2fs_check_directory(fs, inode)))
         {
         if (retval != EXT2_ET_NO_DIRECTORY)
             {
@@ -703,7 +702,7 @@ void short_disp(ls_file_t *info, int *co
   char lbr, rbr;
   char tmp[300];
   int thislen;
-  static max_col_size = 0;
+  static int max_col_size = 0;
 
   if (max_col_size == 0)
     {
@@ -1023,9 +1022,7 @@ int creat_time_sort(void *n1, void *n2)
 elist_t * remove_ls_dups(elist_t *list)
 {
   elist_t *start = list;
-  elist_t *next;
   ls_file_t *cd;
-  ls_file_t *nd;
   int cnt=0;
 
   while(list != NULL)
diff -rpu e2tools-0.0.16-orig/Makefile.am e2tools-0.0.16-fedora-fixes/Makefile.am
--- e2tools-0.0.16-orig/Makefile.am	2003-07-12 19:06:54.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/Makefile.am	2011-02-09 12:41:51.367614136 +0100
@@ -27,3 +27,11 @@ install-exec-hook:
 	$(LN_S) -f e2cp $(DESTDIR)$(bindir)/e2mv
 	$(LN_S) -f e2cp $(DESTDIR)$(bindir)/e2rm
 	$(LN_S) -f e2cp $(DESTDIR)$(bindir)/e2tail
+
+uninstall-exec-hook:
+	$(RM) -f $(DESTDIR)$(bindir)/e2ln
+	$(RM) -f $(DESTDIR)$(bindir)/e2ls
+	$(RM) -f $(DESTDIR)$(bindir)/e2mkdir
+	$(RM) -f $(DESTDIR)$(bindir)/e2mv
+	$(RM) -f $(DESTDIR)$(bindir)/e2rm
+	$(RM) -f $(DESTDIR)$(bindir)/e2tail
diff -rpu e2tools-0.0.16-orig/mkdir.c e2tools-0.0.16-fedora-fixes/mkdir.c
--- e2tools-0.0.16-orig/mkdir.c	2004-04-07 05:19:32.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/mkdir.c	2011-02-09 12:41:51.369614150 +0100
@@ -281,7 +281,6 @@ create_dir(ext2_filsys fs, ext2_ino_t ro
   ext2_ino_t parent;          /* the parent directory inode number*/
   ext2_ino_t child;           /* the inode number of the new directory */
   struct ext2_inode inode;    /* inode of file/directory dirname */
-  char *name;                 /* basename of the new directory */
   long retval;                /* function return value */
   char *buf;
   int len;
@@ -315,7 +314,7 @@ create_dir(ext2_filsys fs, ext2_ino_t ro
         parent = *cwd;
 
       /* allocate memory for the lookups */
-      if ((retval = ext2fs_get_mem(fs->blocksize, (void **) &buf)))
+      if ((retval = ext2fs_get_mem(fs->blocksize, (void *) &buf)))
         {
           fprintf(stderr, "%s\n", error_message(retval));
           return retval;
@@ -357,16 +356,16 @@ create_dir(ext2_filsys fs, ext2_ino_t ro
                                               def_stat)))
                     {
                       fprintf(stderr,
-                              "create_dir: error creating directory %s/%s:%d\n",
+                              "create_dir: error creating directory %s/%s:%ld\n",
                               dirname, dname, retval);
-                      ext2fs_free_mem((void **) &buf);
+                      ext2fs_free_mem((void *) &buf);
                       return(retval);
                     }
                 }
               else
                 {
                   fprintf(stderr, "%s\n", error_message(retval));
-                  ext2fs_free_mem((void **) &buf);
+                  ext2fs_free_mem((void *) &buf);
                   return retval;
                 }
             }
@@ -380,7 +379,7 @@ create_dir(ext2_filsys fs, ext2_ino_t ro
                                                &parent)))
                 {
                   fprintf(stderr, "%s\n", error_message(retval));
-                  ext2fs_free_mem((void **) &buf);
+                  ext2fs_free_mem((void *) &buf);
                   return retval;
                 }
 
@@ -388,7 +387,7 @@ create_dir(ext2_filsys fs, ext2_ino_t ro
               if ((retval = ext2fs_read_inode(fs, parent, &inode)))
                 {
                   fprintf(stderr, "%s\n", error_message(retval));
-                  ext2fs_free_mem((void **) &buf);
+                  ext2fs_free_mem((void *) &buf);
                   return retval;
                 }
 
@@ -397,7 +396,7 @@ create_dir(ext2_filsys fs, ext2_ino_t ro
                 {
                   fprintf(stderr, "create_dir: %s/%s is not a directory: %o\n",
                           dirname, dname, inode.i_mode);
-                  ext2fs_free_mem((void **) &buf);
+                  ext2fs_free_mem((void *) &buf);
                   return(-1);
                 }
             }
@@ -407,7 +406,7 @@ create_dir(ext2_filsys fs, ext2_ino_t ro
             *--dname = '/';
           dname = ptr;
         }
-      ext2fs_free_mem((void **) &buf);
+      ext2fs_free_mem((void *) &buf);
       *cwd = parent;
     }
   else
@@ -415,7 +414,7 @@ create_dir(ext2_filsys fs, ext2_ino_t ro
       if ((retval = create_subdir(fs, root, cwd, dirname, def_stat)))
         {
           fprintf(stderr,
-                  "create_dir: error creating directory %s:%d\n",
+                  "create_dir: error creating directory %s:%ld\n",
                   dirname, retval);
           return(retval);
         }
@@ -493,7 +492,7 @@ long create_subdir(ext2_filsys fs, ext2_
       return(0);
     }
   
-  /* ok, the directory doesn't exist
+  /* ok, the directory doesn't exist */
   /* get a new inode number */
   if ((retval = ext2fs_new_inode(fs, parent, LINUX_S_IFDIR | 0755, 0, &child)))
     {
diff -rpu e2tools-0.0.16-orig/mv.c e2tools-0.0.16-fedora-fixes/mv.c
--- e2tools-0.0.16-orig/mv.c	2002-06-09 23:30:25.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/mv.c	2011-02-09 12:41:51.370614157 +0100
@@ -84,7 +84,6 @@ do_mv(int argc, char *argv[])
   int verbose=0;
   int force=0;
   int swap_files=0;
-  int num_files;
   int errcnt=0;
   char *cur_filesys = NULL;
   ext2_filsys fs = NULL;
diff -rpu e2tools-0.0.16-orig/progress.c e2tools-0.0.16-fedora-fixes/progress.c
--- e2tools-0.0.16-orig/progress.c	2002-06-26 13:18:07.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/progress.c	2011-02-09 12:41:51.371614163 +0100
@@ -27,6 +27,7 @@
 /* System Headers */
 #include <stdio.h>
 #include <unistd.h>
+#include <string.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 
@@ -154,7 +155,7 @@ void update_progress(unsigned long num_b
   if (prog_sbuf != NULL && prog_time != tv.tv_sec)
     {
       prog_time = tv.tv_sec;
-      fprintf(stderr, "%s %10d / %10d\r", prog_file, num_bytes,
+      fprintf(stderr, "%s %10ld / %10ld\r", prog_file, num_bytes,
               prog_sbuf->st_size);
       fflush(stderr);
     }
diff -rpu e2tools-0.0.16-orig/read.c e2tools-0.0.16-fedora-fixes/read.c
--- e2tools-0.0.16-orig/read.c	2002-08-08 09:58:35.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/read.c	2011-02-09 12:41:51.371614163 +0100
@@ -9,9 +9,7 @@
  *
  */
 
-static char rcsid[] = "$Id: read.c,v 0.2 2002/08/08 07:58:35 ksheff Exp $";
-
-static char copyright[] = "Copyright 2002 Keith W Sheffield";
+static char __attribute__ ((used)) copyright[] = "Copyright 2002 Keith W Sheffield";
 
 #ifndef READ_C
 #define READ_C
@@ -106,7 +104,6 @@ long
 get_file(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,
          char *infile, char *outfile, int keep)
 {
-  int fd;
   ext2_ino_t src;
   int dest;
   int retval;
diff -rpu e2tools-0.0.16-orig/rm.c e2tools-0.0.16-fedora-fixes/rm.c
--- e2tools-0.0.16-orig/rm.c	2004-04-07 04:00:43.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/rm.c	2011-02-09 12:41:51.372614169 +0100
@@ -244,8 +244,8 @@ e2rm(int argc, char *argv[])
                   retval = ext2fs_dir_iterate2(gbl_fs, curr_ino,
                                                DIRENT_FLAG_INCLUDE_EMPTY, 0,
                                                rm_dir_proc,
-                                               (void *)
-                                               (verbose) ? &verbose : NULL);
+                                               (void *) 
+                                               ((verbose) ? &verbose : NULL));
                 }
               else
                 {
diff -rpu e2tools-0.0.16-orig/tail.c e2tools-0.0.16-fedora-fixes/tail.c
--- e2tools-0.0.16-orig/tail.c	2003-07-12 18:33:11.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/tail.c	2011-02-09 12:48:54.842042527 +0100
@@ -109,7 +109,7 @@ tail(ext2_filsys *fs, ext2_ino_t root, c
 long
 do_tail(int argc, char *argv[])
 {
-  int verbose=0;
+  /* unused int verbose=0; */
   int follow=0;
   int num_lines = 5;
   int sleep_int = 1;
@@ -131,7 +131,7 @@ do_tail(int argc, char *argv[])
       switch (c)
         {
         case 'v':
-          verbose = 1;
+          /* unused verbose = 1; */
           break;
         case 'f':
           follow = FOLLOW_INODE;
@@ -251,7 +251,6 @@ tail(ext2_filsys *fs_ptr, ext2_ino_t roo
   unsigned int bytes_to_read;
   unsigned int bytes_read;
   char *ptr;
-  off_t pos;
   struct ext2_inode inode;
   ext2_file_t tail_fd;    
   ext2_off_t offset;
@@ -320,7 +319,11 @@ tail(ext2_filsys *fs_ptr, ext2_ino_t roo
               if (bytes_to_read != bytes_read - 1)
                 {
                   ptr++;
-                  write(1, ptr, bytes_read - bytes_to_read - 1);
+		  if (0 > write(1, ptr, bytes_read - bytes_to_read - 1))
+		    {
+		      perror("writing bytes to stdout");
+		      return -1;
+		    }
                 }
               offset = 0;       /* make sure we break out of the main loop */
               break;
@@ -338,7 +341,12 @@ tail(ext2_filsys *fs_ptr, ext2_ino_t roo
    */
   
   if (num_lines > 0)
-    write(1, buf, bytes_read);
+    {
+      if (0 > write(1, buf, bytes_read)) {
+	perror("writing bytes to stdout");
+	return -1;
+      }
+    }
     
   /* retreive the current position in the file */
   if ((retval = ext2fs_file_lseek(tail_fd, 0, EXT2_SEEK_CUR, &cur_pos)))
Only in e2tools-0.0.16-fedora-fixes: tail.c~
diff -rpu e2tools-0.0.16-orig/util.c e2tools-0.0.16-fedora-fixes/util.c
--- e2tools-0.0.16-orig/util.c	2002-06-09 23:30:26.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/util.c	2011-02-09 12:41:51.374614182 +0100
@@ -276,10 +276,9 @@ make_regexp(char *shell)
   char *tmpstr;
   char *ptr;
   static regex_t reg;
-  int l;
   char c;
 
-  if (NULL == (tmpstr = alloca((strlen(shell)) << 1 + 3)))
+  if (NULL == (tmpstr = alloca(((strlen(shell)) << 1) + 3)))
     {
       perror("make_regexp");
       return(NULL);
diff -rpu e2tools-0.0.16-orig/write.c e2tools-0.0.16-fedora-fixes/write.c
--- e2tools-0.0.16-orig/write.c	2004-04-07 03:12:30.000000000 +0200
+++ e2tools-0.0.16-fedora-fixes/write.c	2011-02-09 12:41:51.375614189 +0100
@@ -9,8 +9,6 @@
  * and modified by Robert Sanders <gt8134b@prism.gatech.edu>
  */
 
-static char rcsid[] = "$Id: write.c,v 0.5 2004/04/07 01:12:30 ksheff Exp $";
-
 #ifndef WRITE_C
 #define WRITE_C
 #endif
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin