Przeglądaj źródła

dpkg: Move newtarobject_utime() call out of newtarobject_allmodes()

Always call newtarobject_utime() for all tar object types, except
symlinks.
Guillem Jover 15 lat temu
rodzic
commit
b1ef911615
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/archives.c

+ 2 - 2
src/archives.c

@@ -247,7 +247,6 @@ newtarobject_allmodes(const char *path, struct file_stat *st)
     ohshite(_("error setting ownership of `%.255s'"), path);
     ohshite(_("error setting ownership of `%.255s'"), path);
   if (chmod(path, st->mode & ~S_IFMT))
   if (chmod(path, st->mode & ~S_IFMT))
     ohshite(_("error setting permissions of `%.255s'"), path);
     ohshite(_("error setting permissions of `%.255s'"), path);
-  newtarobject_utime(path, st);
 }
 }
 
 
 static void
 static void
@@ -717,7 +716,6 @@ tarobject(void *ctx, struct tar_entry *ti)
     pop_cleanup(ehflag_normaltidy); /* fd = open(fnamenewvb.buf) */
     pop_cleanup(ehflag_normaltidy); /* fd = open(fnamenewvb.buf) */
     if (close(fd))
     if (close(fd))
       ohshite(_("error closing/writing `%.255s'"), ti->name);
       ohshite(_("error closing/writing `%.255s'"), ti->name);
-    newtarobject_utime(fnamenewvb.buf, st);
     break;
     break;
   case tar_filetype_fifo:
   case tar_filetype_fifo:
     if (mkfifo(fnamenewvb.buf,0))
     if (mkfifo(fnamenewvb.buf,0))
@@ -770,6 +768,8 @@ tarobject(void *ctx, struct tar_entry *ti)
     internerr("unknown tar type '%d', but already checked", ti->type);
     internerr("unknown tar type '%d', but already checked", ti->type);
   }
   }
 
 
+  if (ti->type != tar_filetype_symlink)
+    newtarobject_utime(fnamenewvb.buf, st);
   set_selinux_path_context(fnamevb.buf, fnamenewvb.buf, st->mode);
   set_selinux_path_context(fnamevb.buf, fnamenewvb.buf, st->mode);
 
 
   /*
   /*