[Fakeroot-commits] [SCM] fakeroot branch, upstream, updated. debian/1.14.3-200-gb232f8a

Clint Adams schizo at debian.org
Tue Aug 23 13:06:07 UTC 2011


The following commit has been merged in the upstream branch:
commit 1acfa08d9cf93ddf6d83aed69a89c1e298e3e921
Author: Clint Adams <schizo at debian.org>
Date:   Mon Jan 21 22:32:22 2008 +0000

    Add Fakeroot::Stat from THUS plc to a contrib/ directory in the source tarball.  closes: #459728.
    
    git-archimport-id: fakeroot at packages.debian.org--fakeroot/fakeroot--main--0.0--patch-160

diff --git a/contrib/Fakeroot-Stat-1.8.8/MANIFEST b/contrib/Fakeroot-Stat-1.8.8/MANIFEST
new file mode 100644
index 0000000..807e0d5
--- /dev/null
+++ b/contrib/Fakeroot-Stat-1.8.8/MANIFEST
@@ -0,0 +1,7 @@
+Makefile.PL
+MANIFEST
+README
+lib/Fakeroot/Stat.pm
+Stat.xs
+t/Fakeroot-Stat.t
+META.yml                                 Module meta-data (added by MakeMaker)
diff --git a/contrib/Fakeroot-Stat-1.8.8/META.yml b/contrib/Fakeroot-Stat-1.8.8/META.yml
new file mode 100644
index 0000000..f3b6e55
--- /dev/null
+++ b/contrib/Fakeroot-Stat-1.8.8/META.yml
@@ -0,0 +1,11 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         Fakeroot-Stat
+version:      1.8.8
+version_from: lib/Fakeroot/Stat.pm
+installdirs:  site
+requires:
+    Test:                          0
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.30
diff --git a/contrib/Fakeroot-Stat-1.8.8/Makefile.PL b/contrib/Fakeroot-Stat-1.8.8/Makefile.PL
new file mode 100644
index 0000000..29173d3
--- /dev/null
+++ b/contrib/Fakeroot-Stat-1.8.8/Makefile.PL
@@ -0,0 +1,16 @@
+# $Thus: source/cvs/Fakeroot-Stat/Makefile.PL,v 1.9.96.3 2007/11/29 15:05:56 benhaman-repoman Exp $
+
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+	'NAME'		=> 'Fakeroot::Stat',
+	'VERSION_FROM'	=> 'lib/Fakeroot/Stat.pm',
+	'PREREQ_PM'	=> {
+		'Test' => '0',
+		},
+	($] >= 5.005 ? (
+		'ABSTRACT_FROM'	=> 'lib/Fakeroot/Stat.pm',
+		'AUTHOR'	=> 'SCM Team at THUS plc <scm at thus.net>')
+	: ()),
+	'LIBS'	=> ["-lfakeroot"]
+);
diff --git a/contrib/Fakeroot-Stat-1.8.8/README b/contrib/Fakeroot-Stat-1.8.8/README
new file mode 100644
index 0000000..77e0805
--- /dev/null
+++ b/contrib/Fakeroot-Stat-1.8.8/README
@@ -0,0 +1,33 @@
+Fakeroot::Stat version 1.8.8
+============================
+
+This provides fakestat() and fakelstat() functions which will communicate
+with a faked and return what the faked stat or lstat information is for
+the file.
+
+INSTALLATION
+
+To install this module type the following:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+  fakeroot version 1.8.8 or later
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2002-2007 THUS plc.
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+AUTHORS
+
+Members of the SCM Team at THUS plc (scm at thus.net)
+
diff --git a/contrib/Fakeroot-Stat-1.8.8/Stat.xs b/contrib/Fakeroot-Stat-1.8.8/Stat.xs
new file mode 100644
index 0000000..1942247
--- /dev/null
+++ b/contrib/Fakeroot-Stat-1.8.8/Stat.xs
@@ -0,0 +1,71 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+MODULE = Fakeroot::Stat		PACKAGE = Fakeroot::Stat
+
+void
+fakestat(key, path)
+	char *key;
+	char *path;
+    PROTOTYPE: $$
+    INIT:
+	struct stat st;
+	int	    i;
+    PPCODE:
+	/* Stat first, then fill in uid/gid from fakeroot (ignore everything
+	 * else */
+	i = stat(path, &st);
+	if (i == 0) {
+		if (key && strlen(key))
+			fake_get_owner(0, key, path, &st.st_uid, &st.st_gid,
+				       &st.st_mode);
+
+		EXTEND(SP, 13);
+		PUSHs(sv_2mortal(newSVnv(st.st_dev)));
+		PUSHs(sv_2mortal(newSVnv(st.st_ino)));
+		PUSHs(sv_2mortal(newSVnv(st.st_mode)));
+		PUSHs(sv_2mortal(newSVnv(st.st_nlink)));
+		PUSHs(sv_2mortal(newSVnv(st.st_uid)));
+		PUSHs(sv_2mortal(newSVnv(st.st_gid)));
+		PUSHs(sv_2mortal(newSVnv(st.st_rdev)));
+		PUSHs(sv_2mortal(newSVnv(st.st_size)));
+		PUSHs(sv_2mortal(newSVnv(st.st_atime)));
+		PUSHs(sv_2mortal(newSVnv(st.st_mtime)));
+		PUSHs(sv_2mortal(newSVnv(st.st_ctime)));
+		PUSHs(sv_2mortal(newSVnv(st.st_blksize)));
+		PUSHs(sv_2mortal(newSVnv(st.st_blocks)));
+	}
+
+void
+fakelstat(key, path)
+	char *key;
+	char *path;
+    PROTOTYPE: $$
+    INIT:
+	struct stat st;
+	int	    i;
+    PPCODE:
+	/* Stat first, then fill in uid/gid from fakeroot (ignore everything
+	 * else */
+	i = lstat(path, &st);
+	if (i == 0) {
+		if (key && strlen(key))
+			fake_get_owner(1, key, path, &st.st_uid, &st.st_gid,
+				       &st.st_mode);
+
+		EXTEND(SP, 13);
+		PUSHs(sv_2mortal(newSVnv(st.st_dev)));
+		PUSHs(sv_2mortal(newSVnv(st.st_ino)));
+		PUSHs(sv_2mortal(newSVnv(st.st_mode)));
+		PUSHs(sv_2mortal(newSVnv(st.st_nlink)));
+		PUSHs(sv_2mortal(newSVnv(st.st_uid)));
+		PUSHs(sv_2mortal(newSVnv(st.st_gid)));
+		PUSHs(sv_2mortal(newSVnv(st.st_rdev)));
+		PUSHs(sv_2mortal(newSVnv(st.st_size)));
+		PUSHs(sv_2mortal(newSVnv(st.st_atime)));
+		PUSHs(sv_2mortal(newSVnv(st.st_mtime)));
+		PUSHs(sv_2mortal(newSVnv(st.st_ctime)));
+		PUSHs(sv_2mortal(newSVnv(st.st_blksize)));
+		PUSHs(sv_2mortal(newSVnv(st.st_blocks)));
+	}
diff --git a/contrib/Fakeroot-Stat-1.8.8/lib/Fakeroot/Stat.pm b/contrib/Fakeroot-Stat-1.8.8/lib/Fakeroot/Stat.pm
new file mode 100644
index 0000000..f16dcad
--- /dev/null
+++ b/contrib/Fakeroot-Stat-1.8.8/lib/Fakeroot/Stat.pm
@@ -0,0 +1,47 @@
+package Fakeroot::Stat;
+
+use 5.006;
+use strict;
+use warnings;
+
+require Exporter;
+require DynaLoader;
+
+our @ISA = qw(Exporter DynaLoader);
+
+our @EXPORT = qw(
+	fakestat
+	fakelstat
+);
+our $VERSION = '1.8.8';
+
+bootstrap Fakeroot::Stat $VERSION;
+
+# Preloaded methods go here.
+
+1;
+__END__
+
+=head1 NAME
+
+Fakeroot::Stat - Perl extension for interrogating a faked daemon
+
+=head1 SYNOPSIS
+
+  use Fakeroot::Stat;
+
+  ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+     $atime,$mtime,$ctime,$blksize,$blocks)
+         = fakestat($fakerootkey, $filename);
+
+  # fakelstat as above, but does an lstat
+
+=head1 AUTHOR
+
+SCM Team at THUS plc E<lt>scm at thus.netE<gt>
+
+=head1 SEE ALSO
+
+L<perl>.
+
+=cut
diff --git a/contrib/Fakeroot-Stat-1.8.8/t/Fakeroot-Stat.t b/contrib/Fakeroot-Stat-1.8.8/t/Fakeroot-Stat.t
new file mode 100644
index 0000000..8cdf44f
--- /dev/null
+++ b/contrib/Fakeroot-Stat-1.8.8/t/Fakeroot-Stat.t
@@ -0,0 +1,33 @@
+use Test;
+BEGIN { plan tests => 5 };
+END { kill 'TERM', $pid if defined $pid; unlink ".test.file" };
+
+# 1: Can we run it?
+use Fakeroot::Stat;
+ok(1) or exit 1;
+
+# Start FAKED
+open FAKED, "$ENV{FAKED}|" or die "Couldn't start faked: $!";
+chomp ($out = <FAKED>);
+close FAKED;
+($key, $pid) = split(/:/, $out, 2);
+die "No key returned from faked" unless length $key;
+
+open TEST, "> .test.file";
+print TEST "This file means we tested\n";
+close TEST;
+
+# Try it
+ at realstat = stat(".test.file");
+ at fakestat = fakestat(undef, ".test.file");
+
+# 2: Make sure we return the same elements as stat
+ok(scalar(@fakestat), scalar(@realstat)) or exit 1;
+
+# 3: Make sure we return the same without faked
+ok(join(":", @fakestat), join(":", at realstat)) or exit 1;
+
+# 4: Make sure it returns root if we use fakeroot
+ at teststat = fakestat($key, ".test.file");
+ok($teststat[4], 0) or exit 1;
+ok($teststat[5], 0) or exit 1;
diff --git a/debian/changelog b/debian/changelog
index 19cd607..7b550fa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ fakeroot (1.9.1) unstable; urgency=low
     on Solaris.
   * Apply patch from Andrew Benham to make compare-tar test more
     portable.
+  * Add Fakeroot::Stat from THUS plc to a contrib/ directory
+    in the source tarball.  closes: #459728.
 
  -- Clint Adams <schizo at debian.org>  Mon, 21 Jan 2008 17:16:22 -0500
 
diff --git a/debian/copyright b/debian/copyright
index 220317d..3d6aa76 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1 +1,10 @@
 GNU copyleft joost witteveen, <joostje at debian.org>.
+
+
+The Fakeroot::Stat Perl module,
+Copyright (C) 2002-2007 THUS plc.,
+is licensed thusly:
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+

-- 
fakeroot



More information about the Fakeroot-commits mailing list