summaryrefslogtreecommitdiff
path: root/sysutils/rsnapshot
diff options
context:
space:
mode:
authorkim <kim>2005-12-27 08:56:47 +0000
committerkim <kim>2005-12-27 08:56:47 +0000
commit44a9744e712f66866b00a7c553b8a9e2610534ce (patch)
tree68ca9e6044bd02601e0f1a5cf939ad8a050e3203 /sysutils/rsnapshot
parent20145e1cdaa168f738c8e3c415815a09f39b6547 (diff)
downloadpkgsrc-44a9744e712f66866b00a7c553b8a9e2610534ce.tar.gz
Restore the use of lchown(2) that was lost in the upgrade.
The upgrade instructions are in the INSTALL document, so install it as well as README.
Diffstat (limited to 'sysutils/rsnapshot')
-rw-r--r--sysutils/rsnapshot/Makefile8
-rw-r--r--sysutils/rsnapshot/PLIST5
-rw-r--r--sysutils/rsnapshot/distinfo3
-rw-r--r--sysutils/rsnapshot/patches/patch-aa130
4 files changed, 143 insertions, 3 deletions
diff --git a/sysutils/rsnapshot/Makefile b/sysutils/rsnapshot/Makefile
index 73778e54f88..c6006327756 100644
--- a/sysutils/rsnapshot/Makefile
+++ b/sysutils/rsnapshot/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.6 2005/12/05 23:55:20 rillig Exp $
+# $NetBSD: Makefile,v 1.7 2005/12/27 08:56:47 kim Exp $
#
DISTNAME= rsnapshot-1.2.1
+PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= http://www.rsnapshot.org/downloads/
@@ -10,6 +11,7 @@ HOMEPAGE= http://www.rsnapshot.org/
COMMENT= Filesystem snapshot utility
DEPENDS+= rsync>=2.3.1:../../net/rsync
+DEPENDS+= p5-Lchown>=0.07:../../sysutils/p5-Lchown
GNU_CONFIGURE= yes
USE_TOOLS+= perl:run
@@ -18,6 +20,7 @@ USE_PKGINSTALL= yes
.include "../../mk/bsd.prefs.mk"
EGDIR= ${PREFIX}/share/examples/${PKGBASE}
+DOCDIR= ${PREFIX}/share/doc/${PKGBASE}
CONF_FILES+= ${EGDIR}/rsnapshot.conf.default \
${PKG_SYSCONFDIR}/rsnapshot.conf
@@ -33,5 +36,8 @@ do-install:
${INSTALL_MAN} ${WRKSRC}/rsnapshot.1 ${PREFIX}/man/man1
${INSTALL_DATA_DIR} ${EGDIR}
${INSTALL_DATA} ${WRKSRC}/rsnapshot.conf.default ${EGDIR}
+ ${INSTALL_DATA_DIR} ${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${DOCDIR}
.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/rsnapshot/PLIST b/sysutils/rsnapshot/PLIST
index d0685b18b3d..f15e6a11752 100644
--- a/sysutils/rsnapshot/PLIST
+++ b/sysutils/rsnapshot/PLIST
@@ -1,5 +1,8 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2004/10/10 17:28:14 kim Exp $
+@comment $NetBSD: PLIST,v 1.2 2005/12/27 08:56:47 kim Exp $
bin/${PKGBASE}
man/man1/${PKGBASE}.1
+share/doc/${PKGBASE}/INSTALL
+share/doc/${PKGBASE}/README
+@dirrm share/doc/${PKGBASE}
share/examples/${PKGBASE}/${PKGBASE}.conf.default
@dirrm share/examples/${PKGBASE}
diff --git a/sysutils/rsnapshot/distinfo b/sysutils/rsnapshot/distinfo
index 12284e6e381..390b60b82c2 100644
--- a/sysutils/rsnapshot/distinfo
+++ b/sysutils/rsnapshot/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.4 2005/09/13 11:47:49 abs Exp $
+$NetBSD: distinfo,v 1.5 2005/12/27 08:56:47 kim Exp $
SHA1 (rsnapshot-1.2.1.tar.gz) = 4e13d6a828012b869fa0709f651e3b11c40d0c91
RMD160 (rsnapshot-1.2.1.tar.gz) = 78d365b45c3a7dbe2034d901afe4937b39687946
Size (rsnapshot-1.2.1.tar.gz) = 137194 bytes
+SHA1 (patch-aa) = 7b6fb79ce5e47cc552ee3634598b2e2101dc8919
diff --git a/sysutils/rsnapshot/patches/patch-aa b/sysutils/rsnapshot/patches/patch-aa
new file mode 100644
index 00000000000..8aff79aba77
--- /dev/null
+++ b/sysutils/rsnapshot/patches/patch-aa
@@ -0,0 +1,130 @@
+$NetBSD: patch-aa,v 1.3 2005/12/27 08:56:47 kim Exp $
+
+--- rsnapshot-program.pl.orig 2005-04-10 01:22:29.000000000 +0300
++++ rsnapshot-program.pl 2005-12-25 11:16:47.000000000 +0200
+@@ -32,6 +32,7 @@
+ use File::Path; # mkpath(), rmtree()
+ use File::stat; # stat(), lstat()
+ use POSIX qw(locale_h); # setlocale()
++use Lchown qw(lchown LCHOWN_AVAILABLE);
+
+ ########################################
+ ### DECLARE GLOBAL VARIABLES ###
+@@ -3277,24 +3278,9 @@
+
+ # CHOWN DEST (if root)
+ if (0 == $<) {
+- # make sure destination is not a symlink
+- if ( ! -l "$dest" ) {
+- # print and/or log this if necessary
+- if (($verbose > 4) or ($loglevel > 4)) {
+- my $cmd_string = "chown(" . $st->uid . ", " . $st->gid . ", \"$dest\")";
+-
+- if ($verbose > 4) {
+- print_cmd($cmd_string);
+- } elsif ($loglevel > 4) {
+- log_msg($cmd_string, 4);
+- }
+- }
+-
+- $result = chown($st->uid, $st->gid, "$dest");
+- if (! $result) {
+- print_err("Warning! Could not chown(" . $st->uid . ", " . $st->gid . ", \"$dest\");", 2);
+- return(0);
+- }
++ $result = safe_chown($st->uid, $st->gid, $dest);
++ if (! $result) {
++ return(0);
+ }
+ }
+
+@@ -3501,6 +3487,43 @@
+ return (1);
+ }
+
++# choose between lchown or chown
++sub safe_chown {
++ my $uid = shift(@_);
++ my $gid = shift(@_);
++ my $dest = shift(@_);
++
++ my $result = 0;
++
++ # logging
++ if (LCHOWN_AVAILABLE || ! -l $dest) {
++ # print and/or log this if necessary
++ if (($verbose > 4) or ($loglevel > 4)) {
++ my $cmd_string = 'chown(' . $uid . ', ' . $gid . ', "' . $dest . '")';
++ if ($verbose > 4) {
++ print_cmd($cmd_string);
++ } elsif ($loglevel > 4) {
++ log_msg($cmd_string, 4);
++ }
++ }
++ }
++
++ if (LCHOWN_AVAILABLE) {
++ $result = lchown($uid, $gid, $dest);
++ } else {
++ # make sure destination is not a symlink
++ if ( ! -l $dest ) {
++ $result = chown($uid, $gid, $dest);
++ }
++ }
++
++ if (! $result) {
++ print_err('Warning! Could not safe_chown(' . $uid . ', ' . $gid . ', "' . $dest . '")', 2);
++ }
++
++ return($result);
++}
++
+ # accepts a path
+ # displays the rm command according to the config file
+ sub display_rm_rf {
+@@ -3777,13 +3800,9 @@
+
+ # CHOWN DEST (if root)
+ if (0 == $<) {
+- # make sure dest is not a symlink
+- if ( ! -l "$dest" ) {
+- $result = chown($st->uid, $st->gid, "$dest");
+- if (! $result) {
+- print_err("Warning! Could not chown(" . $st->uid . ", " . $st->gid . ", \"$dest\");", 2);
+- return(0);
+- }
++ $result = safe_chown($st->uid, $st->gid, $dest);
++ if (! $result) {
++ return(0);
+ }
+ }
+
+@@ -3998,25 +4017,9 @@
+ # CHOWN DEST (if root)
+ if (0 == $<) {
+ if ( -e "$dest" ) {
+- # make sure destination is not a symlink
+- if ( ! -l "$dest" ) {
+- # print and/or log this if necessary
+- if (($verbose > 4) or ($loglevel > 4)) {
+- my $cmd_string = "chown(" . $st->uid . ", " . $st->gid . ", \"$dest\");";
+-
+- if ($verbose > 4) {
+- print_cmd($cmd_string);
+- } elsif ($loglevel > 4) {
+- log_msg($cmd_string, 4);
+- }
+- }
+-
+- $result = chown($st->uid, $st->gid, "$dest");
+-
+- if (! $result) {
+- print_err("Warning! Could not chown(" . $st->uid . ", " . $st->gid . ", \"$dest\")", 2);
+- return (0);
+- }
++ $result = safe_chown($st->uid, $st->gid, $dest);
++ if (! $result) {
++ return (0);
+ }
+ }
+ }