1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
diff -ur ../orig.pkgtools-20041224/lib/pkgdb.rb ./lib/pkgdb.rb
--- ../orig.pkgtools-20041224/lib/pkgdb.rb Wed Mar 23 21:37:47 2005
+++ ./lib/pkgdb.rb Sun May 22 00:39:38 2005
@@ -96,8 +96,7 @@
@db_dir = File.expand_path(new_db_dir || ENV['PKG_DBDIR'] || '/var/db/pkg')
@db_file = File.join(@db_dir, 'pkgdb.db')
- @tmp_dir = ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
- @fixme_file = File.join(@tmp_dir, 'pkgdb.fixme')
+ @fixme_file = ENV['PKG_FIXME_FILE'] || "/var/db/pkgdb.fixme"
@db_filebase = @db_file.sub(/\.db$/, '')
close_db
Only in ./lib: pkgdb.rb~
diff -ur ../orig.pkgtools-20041224/lib/pkgmisc.rb ./lib/pkgmisc.rb
--- ../orig.pkgtools-20041224/lib/pkgmisc.rb Wed Mar 23 21:37:47 2005
+++ ./lib/pkgmisc.rb Thu May 5 14:09:37 2005
@@ -95,3 +95,31 @@
end
end
end
+
+def init_tmpdir
+ if ! $tmpdir.nil? && $tmpdir != "" then
+ return
+ end
+ maintmpdir = ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
+ if !FileTest.directory?(maintmpdir)
+ raise "Temporary directory #{maintmpdir} does not exist"
+ end
+
+ cmdline = shelljoin("/usr/bin/mktemp", "-d", maintmpdir + "/portupgradeXXXXXXXX")
+ pipe = IO.popen(cmdline)
+ tmpdir = pipe.gets
+ pipe.close
+ if $? != 0 || tmpdir.nil? || tmpdir.length == 0
+ raise "Could not create temporary directory in #{maintmpdir}"
+ end
+ tmpdir.chomp!
+
+ at_exit {
+ begin
+ Dir.delete(tmpdir)
+ rescue
+ warning_message "Could not clean up temporary directory: " + $!
+ end
+ }
+ $tmpdir=tmpdir
+end
diff -ur ../orig.pkgtools-20041224/lib/pkgsqldb.rb ./lib/pkgsqldb.rb
--- ../orig.pkgtools-20041224/lib/pkgsqldb.rb Wed Mar 23 21:37:47 2005
+++ ./lib/pkgsqldb.rb Sun May 22 00:42:04 2005
@@ -73,8 +73,7 @@
@db_dir = File.expand_path(new_db_dir || ENV['PKG_DBDIR'] || '/var/db/pkg')
@db_file = File.join(@db_dir, 'pkgdb.sqldb')
- @tmp_dir = ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
- @fixme_file = File.join(@tmp_dir, 'pkgdb.fixme')
+ @fixme_file = ENV['PKG_FIXME_FILE'] || "/var/db/pkgdb.fixme"
close_db
@db_dir
Only in ./lib: pkgsqldb.rb~
diff -ur ../orig.pkgtools-20041224/lib/pkgtools.rb ./lib/pkgtools.rb
--- ../orig.pkgtools-20041224/lib/pkgtools.rb Wed Mar 23 21:37:47 2005
+++ ./lib/pkgtools.rb Tue May 3 19:29:59 2005
@@ -204,7 +204,7 @@
$ports_dir = $portsdb.ports_dir
$packages_base = ENV['PACKAGES'] || File.join($ports_dir, 'packages')
$packages_dir = File.join($packages_base, 'All')
- $tmpdir = ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
+ init_tmpdir
$pkg_path = ENV['PKG_PATH'] || $packages_dir
$pkg_sites = (ENV['PKG_SITES'] || '').split
|