On Sun, May 29, 2005 at 08:32:20AM -0500, John Goerzen wrote:
> On Sun, May 29, 2005 at 02:18:04PM +0300, Kari Pahula wrote:
> > Package: darcs-buildpackage
> > Version: 0.5.1
> > Severity: normal
> > 
> > Looks like dbp-get loses file permissions.
> 
> Unfortunately, darcs does not store file permissions (yet), so there's
> not much I can do about this one.

Here's what I ended up doing after running dbp-get.  It's a kind of a
hack and I don't know if doing anything like this in
darcs-buildpackage itself would be a good idea.  FYI for anybody who's
interested, I guess.

[EMAIL PROTECTED]:~/src/deb/crossfire$ for a in `find . -path './_darcs' -prune 
-o -print`; do cpstat ~/debdarcs/crossfire.upstream/$a $a || cpstat 
~/debdarcs/crossfire/$a $a; done

cpstat.c attached.
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <utime.h>

int main(int argc, char *argv[])
{
  struct stat sourcestat;
  struct utimbuf sourcetimes;
  if (argc != 3)
    {
      fprintf(stderr, "usage: cpstat SOURCE DEST\n");
      exit(0);
    }
  if (stat(argv[1], &sourcestat))
    {
      fprintf(stderr, "cpstat: can't stat SOURCE\n");
      exit(1);
    }
  sourcetimes.actime = sourcestat.st_atime;
  sourcetimes.modtime = sourcestat.st_mtime;
  if (utime(argv[2], &sourcetimes))
    {
      fprintf(stderr, "cpstat: can't assign time to DEST\n");
      exit(2);
    }
  if (chmod(argv[2], sourcestat.st_mode))
    {
      fprintf(stderr, "cpstat: can't assign permissions to DEST\n");
      exit(3);
    }
}

	      

Reply via email to