diff options
author | Edwin Groothuis <edwin@FreeBSD.org> | 2005-12-04 06:39:12 +0000 |
---|---|---|
committer | Edwin Groothuis <edwin@FreeBSD.org> | 2005-12-04 06:39:12 +0000 |
commit | 99dbdd022e3003b699d2b6530770cccfd1016a7c (patch) | |
tree | 53eeb8ecd61070f485e7eabf464d769292e3f718 /sysutils/portupgrade | |
parent | a6b8720f7bd606ddebc23d4608d6146e21da8482 (diff) | |
download | ports-99dbdd022e3003b699d2b6530770cccfd1016a7c.tar.gz ports-99dbdd022e3003b699d2b6530770cccfd1016a7c.zip |
sysutils/portupgrade: fix the problem that portupgrade sometimes runs slow, and bump PORTVERSION to 20051204.
(1) For years, I have experienced that portupgrade sometimes
runs very slow. After some investigation, I found that
"pkgdb -aF" is invoked from portupgrade or other programs
(such as portversion) without having sufficient privilege
to modify /var/db/pkg/, and that error is not caught by the
caller program, and "pkgdb -aF" is invoked repeatedlly.
So, I fixed the following things:
- When pkgdb internally invoked from other program exits
with error, make the caller program also exit with error.
- Display the error messages of pkgdb that run internally
from other program.
When portupgrade or other programs die with the following error,
** You do not own /var/db/pkg. (use -f to force or run as root)
Command failed [exit code 1]: /usr/local/sbin/pkgdb -aFQ
please run "pkgdb -aF" as the user that owns /var/db/pkg (usually root).
(2) Make new tarball that contains the above fix and all
patches in files/. Bump PORTVERSION to 20051204 and change
MASTER_SITES.
PR: ports/89917
Submitted by: KOMATSU Shinichiro <koma2@lovepeers.org>
Notes
Notes:
svn path=/head/; revision=150346
Diffstat (limited to 'sysutils/portupgrade')
-rw-r--r-- | sysutils/portupgrade/Makefile | 10 | ||||
-rw-r--r-- | sysutils/portupgrade/distinfo | 9 | ||||
-rw-r--r-- | sysutils/portupgrade/files/patch-CAN-2005-0610 | 75 | ||||
-rw-r--r-- | sysutils/portupgrade/files/patch-Makefile.compat | 11 | ||||
-rw-r--r-- | sysutils/portupgrade/files/patch-bin-pkgdb | 13 | ||||
-rw-r--r-- | sysutils/portupgrade/files/patch-bin-portsclean.1 | 24 | ||||
-rw-r--r-- | sysutils/portupgrade/files/patch-bin-portupgrade | 22 | ||||
-rw-r--r-- | sysutils/portupgrade/files/patch-etc-Makefile | 14 | ||||
-rw-r--r-- | sysutils/portupgrade/files/patch-etc-pkgtools.conf | 16 | ||||
-rw-r--r-- | sysutils/portupgrade/files/patch-lib_portsdb.rb | 24 |
10 files changed, 7 insertions, 211 deletions
diff --git a/sysutils/portupgrade/Makefile b/sysutils/portupgrade/Makefile index 0aa59b77c0a8..73885670b4c8 100644 --- a/sysutils/portupgrade/Makefile +++ b/sysutils/portupgrade/Makefile @@ -6,18 +6,16 @@ # PORTNAME= portupgrade -PORTVERSION= 20041226 -PORTREVISION= 9 +PORTVERSION= 20051204 +PORTREVISION= 0 CATEGORIES= sysutils -MASTER_SITES= ftp://ftp.iDaemons.org/pub/distfiles/ \ - ${MASTER_SITE_LOCAL} -MASTER_SITE_SUBDIR= knu +MASTER_SITES= http://dists.lovepeers.org/distfiles/portupgrade/ DISTNAME= pkgtools-${DISTVERSION} MAINTAINER= koma2@lovepeers.org COMMENT= FreeBSD ports/packages administration and management tool suite -DISTVERSION= 20041224 +DISTVERSION= ${PORTVERSION} .if ${DISTVERSION} != ${PORTVERSION} PATCH_SITES= ${MASTER_SITES} diff --git a/sysutils/portupgrade/distinfo b/sysutils/portupgrade/distinfo index fef8ec70c6be..0775417b5749 100644 --- a/sysutils/portupgrade/distinfo +++ b/sysutils/portupgrade/distinfo @@ -1,6 +1,3 @@ -MD5 (pkgtools-20041224.tar.bz2) = 1c69732e569fa423152cc792d2c40113 -SHA256 (pkgtools-20041224.tar.bz2) = bf637cdcadc1bc843f300bf3d2628cf576c5d2252932f0f09188e8dd9d4803b7 -SIZE (pkgtools-20041224.tar.bz2) = 104308 -MD5 (pkgtools-20041224-20041226.diff.bz2) = aab3f2885424d5f25c8ab08d48da5f34 -SHA256 (pkgtools-20041224-20041226.diff.bz2) = 1900a764a50396d8f45b25576005533878bebcc37f5187099632ee591989ea63 -SIZE (pkgtools-20041224-20041226.diff.bz2) = 1086 +MD5 (pkgtools-20051204.tar.bz2) = 9c90481860f80d80f856ec72907ea730 +SHA256 (pkgtools-20051204.tar.bz2) = d118d5fb63a06217b61b06b1d0349413a131044d96cfe187da7da7a7bfd83867 +SIZE (pkgtools-20051204.tar.bz2) = 105771 diff --git a/sysutils/portupgrade/files/patch-CAN-2005-0610 b/sysutils/portupgrade/files/patch-CAN-2005-0610 deleted file mode 100644 index 415dca4bff3c..000000000000 --- a/sysutils/portupgrade/files/patch-CAN-2005-0610 +++ /dev/null @@ -1,75 +0,0 @@ -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 diff --git a/sysutils/portupgrade/files/patch-Makefile.compat b/sysutils/portupgrade/files/patch-Makefile.compat deleted file mode 100644 index 731d4409da45..000000000000 --- a/sysutils/portupgrade/files/patch-Makefile.compat +++ /dev/null @@ -1,11 +0,0 @@ ---- ../orig.pkgtools-20041224/Makefile.compat Wed Mar 23 21:37:47 2005 -+++ Makefile.compat Sun May 22 00:46:39 2005 -@@ -89,7 +89,7 @@ - .endif - .endif - --.endif defined(${group}) && !empty(${group}) -+.endif # defined(${group}) && !empty(${group}) - .endfor - - .endif diff --git a/sysutils/portupgrade/files/patch-bin-pkgdb b/sysutils/portupgrade/files/patch-bin-pkgdb deleted file mode 100644 index 94bd4843b037..000000000000 --- a/sysutils/portupgrade/files/patch-bin-pkgdb +++ /dev/null @@ -1,13 +0,0 @@ -Index: bin/pkgdb -=================================================================== ---- bin/pkgdb (revision 38) -+++ bin/pkgdb (working copy) -@@ -615,7 +615,7 @@ - next - end - -- if $pkgdb.match?(pat, dep) -+ if File.fnmatch?(pat, dep) - case alt - when :delete, :skip - return [alt] diff --git a/sysutils/portupgrade/files/patch-bin-portsclean.1 b/sysutils/portupgrade/files/patch-bin-portsclean.1 deleted file mode 100644 index e9c95e66154b..000000000000 --- a/sysutils/portupgrade/files/patch-bin-portsclean.1 +++ /dev/null @@ -1,24 +0,0 @@ -Index: bin/portsclean.1 -=================================================================== ---- bin/portsclean.1 (revision 32) -+++ bin/portsclean.1 (revision 34) -@@ -8,7 +8,7 @@ - .Nd a tool to clean ports/packages garbage - .Sh SYNOPSIS - .Nm --.Op Fl hCDDinPPQQq -+.Op Fl hCDDiLnPPQQq - .Sh DESCRIPTION - .Nm - is a tool to help users clean out the working directories of their ports -@@ -81,7 +81,9 @@ - .Pp - .It Fl Q - .It Fl -quiet --Do not write anything to stdout. Specified twice, do not write -+Do not write anything to stdout. Specified twice (i.e. -+.Fl QQ ) , -+do not write - anything to stderr either. This is for internal use. - .Pp - .It Fl q diff --git a/sysutils/portupgrade/files/patch-bin-portupgrade b/sysutils/portupgrade/files/patch-bin-portupgrade deleted file mode 100644 index 063d81beee94..000000000000 --- a/sysutils/portupgrade/files/patch-bin-portupgrade +++ /dev/null @@ -1,22 +0,0 @@ -Index: bin/portupgrade -=================================================================== ---- bin/portupgrade (revision 34) -+++ bin/portupgrade (revision 36) -@@ -1560,7 +1560,7 @@ - - timer_start(time_key = "Installation of #{pkgname}") - -- cmdargs = [PkgDB::command(:pkg_add), '-f', pkgname] -+ cmdargs = [PkgDB::command(:pkg_add), '-f', pkgfile] - - progress_message "Installing the new version via the package" - -@@ -1705,7 +1705,7 @@ - id_pkgname, id_origin, pkgdep = identify_pkg(file) - - if id_origin == origin -- pkglist << [PkgInfo.new(id_pkgname), file] -+ pkglist << [PkgInfo.new(id_pkgname), File.join(dir, file)] - end - } - } diff --git a/sysutils/portupgrade/files/patch-etc-Makefile b/sysutils/portupgrade/files/patch-etc-Makefile deleted file mode 100644 index 31f27de19fec..000000000000 --- a/sysutils/portupgrade/files/patch-etc-Makefile +++ /dev/null @@ -1,14 +0,0 @@ -Index: etc/Makefile -=================================================================== ---- etc/Makefile (リビジョン 1049) -+++ etc/Makefile (作業コピー) -@@ -32,7 +32,8 @@ - ${script}: ${script:T} - @mkdir -p ${BUILDDIR} - ${RUBY} -p \ -- -e 'sub %r:/usr/local:, "${PREFIX}"' \ -+ -e 'sub(%r:/usr/local:, "${PREFIX}")' \ -+ -e 'sub(%r:(/etc/rc\.subr):, "${PREFIX}\\1") if !File.exist?("/etc/rc.subr")' \ - ${.ALLSRC} > ${.TARGET} - .endfor - diff --git a/sysutils/portupgrade/files/patch-etc-pkgtools.conf b/sysutils/portupgrade/files/patch-etc-pkgtools.conf deleted file mode 100644 index 84ec52278a32..000000000000 --- a/sysutils/portupgrade/files/patch-etc-pkgtools.conf +++ /dev/null @@ -1,16 +0,0 @@ -Index: etc/pkgtools.conf -=================================================================== ---- etc/pkgtools.conf (revision 39) -+++ etc/pkgtools.conf (revision 40) -@@ -252,8 +252,10 @@ - # be used as B values, instead of pkgname glob patterns. <:delete> - # means to delete the dependency and <:skip> to skip it. - # -- # cf. pkg_glob(1) -+ # This replacement is done when "pkgdb -F" is executed. - # -+ # cf. pkg_glob(1), pkgdb(1) -+ # - # e.g.: - # ALT_PKGDEP = { - # # If you use apache13-modssl instead of apache13 diff --git a/sysutils/portupgrade/files/patch-lib_portsdb.rb b/sysutils/portupgrade/files/patch-lib_portsdb.rb deleted file mode 100644 index 149bf63987c1..000000000000 --- a/sysutils/portupgrade/files/patch-lib_portsdb.rb +++ /dev/null @@ -1,24 +0,0 @@ -Index: lib/portsdb.rb -=================================================================== ---- lib/portsdb.rb (.../vendor/portupgrade/trunk/lib/portsdb.rb) (revision 2) -+++ lib/portsdb.rb (.../branches/ports/lib/portsdb.rb) (revision 41) -@@ -194,8 +194,8 @@ - def db_dir=(new_db_dir) - @db_dir = new_db_dir || ENV['PORTS_DBDIR'] || ports_dir - -- @db_file = File.join(@db_dir, 'INDEX.db') -- @db_filebase = @db_file.sub(/\.db$/, '') -+ @db_filebase = File.join(@db_dir, File.basename(index_file())) -+ @db_file = @db_filebase + '.db' - - close_db - -@@ -846,7 +846,7 @@ - - def all_depends_list(origin, before_args = nil, after_args = nil) - if !before_args && !after_args && i = port(origin) -- i.all_depends.map { |n| origin(n) } -+ i.all_depends.map { |n| origin(n) }.compact - else - all_depends_list!(origin, before_args, after_args) - end |