Date: Sun, 16 Jun 2013 18:32:53 +0900 (JST) From: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp> To: FreeBSD-gnats-submit@freebsd.org Cc: turutani@scphys.kyoto-u.ac.jp Subject: ports/179611: running sysutils/pdumpfs fails with ruby19 Message-ID: <201306160932.r5G9Wrip082112@h120.65.226.10.32118.vlan.kuins.net> Resent-Message-ID: <201306160940.r5G9e1p6078364@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 179611 >Category: ports >Synopsis: running sysutils/pdumpfs fails with ruby19 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 16 09:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Tsurutani Naoki >Release: FreeBSD 8.4-PRERELEASE i386 >Organization: >Environment: System: FreeBSD h120.65.226.10.32118.vlan.kuins.net 8.4-PRERELEASE FreeBSD 8.4-PRERELEASE #26 r249149: Fri Apr 5 22:13:25 JST 2013 turutani@h120.65.226.10.32118.vlan.kuins.net:/usr/local/work/usr/obj/usr/src/sys/POLYMER i386 >Description: sysutils/pdumpfs can be installed with ruby-1.9x, but it cannot run with ruby-1.9x. >How-To-Repeat: % pdumpfs /home/turutani /backup/turutani /usr/local/lib/ruby/1.9/rubygems/custom_require.rb:36:in `require': cannot load such file -- ftools (LoadError) from /usr/local/lib/ruby/1.9/rubygems/custom_require.rb:36:in `require' from /usr/local/sbin/pdumpfs:51:in `<main>' /usr/local/sbin/pdumpfs exit with status 1. >Fix: here is a patch, which should be stored as files/patch-pdumpfs.in: --- pdumpfs.in.orig 2004-12-21 11:43:12.000000000 +0900 +++ pdumpfs.in 2013-06-16 18:25:25.000000000 +0900 @@ -1,4 +1,4 @@ -#! /usr/bin/env ruby +#!/usr/local/bin/ruby19 # # pdumpfs - a daily backup system similar to Plan9's dumpfs. # @@ -48,21 +48,21 @@ # require 'find' -require 'ftools' +require 'fileutils' require 'getoptlong' require 'date' class File def self.real_file? (path) - File.file?(path) and not File.symlink?(path) + FileTest.file?(path) and not FileTest.symlink?(path) end def self.anything_exist? (path) - File.exist?(path) or File.symlink?(path) + FileTest.exist?(path) or FileTest.symlink?(path) end def self.real_directory? (path) - File.directory?(path) and not File.symlink?(path) + FileTest.directory?(path) and not FileTest.symlink?(path) end def self.force_symlink (src, dest) @@ -79,7 +79,7 @@ end def self.readable_file? (path) - File.file?(path) and File.readable?(path) + FileTest.file?(path) and FileTest.readable?(path) end def self.split_all (path) @@ -129,7 +129,7 @@ GetVolumeInformation = Win32API.new("kernel32", "GetVolumeInformation", "PPLPPPPL", "I") def get_filesystem_type (path) - return nil unless(File.exist?(path)) + return nil unless(FileTest.exist?(path)) drive = File.expand_path(path)[0..2] buff = "\0" * 1024 @@ -868,7 +868,7 @@ today = File.join(dest, datedir(start_time), base) File.umask(0077) - File.mkpath(today) unless @dry_run + FileUtils.mkpath(today) unless @dry_run if latest update_snapshot(src, latest, today) else @@ -1018,7 +1018,7 @@ case type when "directory" - File.mkpath(today) + FileUtils.mkpath(today) when "unchanged" File.force_link(latest, today) when "updated" @@ -1052,7 +1052,7 @@ Find.find(src) do |s| # path of the source file if @matcher.exclude?(s) - if File.lstat(s).directory? then Find.prune() else next end + if FileTest.directory(s)? then Find.prune() else next end end r = make_relative_path(s, src) l = File.join(latest, r) # path of the latest snapshot @@ -1089,7 +1089,7 @@ case type when "directory" - File.mkpath(t) + FileUtils.mkpath(t) when "new_file" copy(s, t) when "symlink" >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306160932.r5G9Wrip082112>