svn commit: r212399 - in user/pgollucci/portupgrade/trunk: . bin
etc lib man misc misc/bash misc/tcsh misc/zsh tests
Philip M. Gollucci
pgollucci at FreeBSD.org
Thu Sep 9 23:37:55 UTC 2010
Author: pgollucci (ports committer)
Date: Thu Sep 9 23:37:54 2010
New Revision: 212399
URL: http://svn.freebsd.org/changeset/base/212399
Log:
- Update to ports-mgmt/portupgrade-devel at 20091221_1
Modified:
user/pgollucci/portupgrade/trunk/Makefile
user/pgollucci/portupgrade/trunk/Makefile.compat
user/pgollucci/portupgrade/trunk/Makefile.inc
user/pgollucci/portupgrade/trunk/NEWS
user/pgollucci/portupgrade/trunk/README
user/pgollucci/portupgrade/trunk/bin/Makefile
user/pgollucci/portupgrade/trunk/bin/pkg_fetch
user/pgollucci/portupgrade/trunk/bin/pkg_glob
user/pgollucci/portupgrade/trunk/bin/pkg_sort
user/pgollucci/portupgrade/trunk/bin/pkgdb
user/pgollucci/portupgrade/trunk/bin/pkgdu
user/pgollucci/portupgrade/trunk/bin/portcvsweb
user/pgollucci/portupgrade/trunk/bin/portsclean
user/pgollucci/portupgrade/trunk/bin/portsdb
user/pgollucci/portupgrade/trunk/bin/portupgrade
user/pgollucci/portupgrade/trunk/bin/portversion
user/pgollucci/portupgrade/trunk/etc/Makefile
user/pgollucci/portupgrade/trunk/etc/pkgtools.conf
user/pgollucci/portupgrade/trunk/etc/pkgtools.sh
user/pgollucci/portupgrade/trunk/etc/status-pkg.sh
user/pgollucci/portupgrade/trunk/lib/Makefile
user/pgollucci/portupgrade/trunk/lib/pkg.rb
user/pgollucci/portupgrade/trunk/lib/pkgdb.rb
user/pgollucci/portupgrade/trunk/lib/pkgdbtools.rb
user/pgollucci/portupgrade/trunk/lib/pkginfo.rb
user/pgollucci/portupgrade/trunk/lib/pkgmisc.rb
user/pgollucci/portupgrade/trunk/lib/pkgtools.rb
user/pgollucci/portupgrade/trunk/lib/pkgtsort.rb
user/pgollucci/portupgrade/trunk/lib/pkgversion.rb
user/pgollucci/portupgrade/trunk/lib/portinfo.rb
user/pgollucci/portupgrade/trunk/lib/ports.rb
user/pgollucci/portupgrade/trunk/lib/portsdb.rb
user/pgollucci/portupgrade/trunk/man/Makefile
user/pgollucci/portupgrade/trunk/man/pkg_deinstall.1
user/pgollucci/portupgrade/trunk/man/pkg_fetch.1
user/pgollucci/portupgrade/trunk/man/pkg_glob.1
user/pgollucci/portupgrade/trunk/man/pkg_sort.1
user/pgollucci/portupgrade/trunk/man/pkgdb.1
user/pgollucci/portupgrade/trunk/man/pkgdu.1
user/pgollucci/portupgrade/trunk/man/pkgtools.conf.5
user/pgollucci/portupgrade/trunk/man/portcvsweb.1
user/pgollucci/portupgrade/trunk/man/portsclean.1
user/pgollucci/portupgrade/trunk/man/portsdb.1
user/pgollucci/portupgrade/trunk/man/portupgrade.1
user/pgollucci/portupgrade/trunk/man/portversion.1
user/pgollucci/portupgrade/trunk/misc/Makefile
user/pgollucci/portupgrade/trunk/misc/Makefile.inc
user/pgollucci/portupgrade/trunk/misc/bash/Makefile
user/pgollucci/portupgrade/trunk/misc/bash/complete.sample
user/pgollucci/portupgrade/trunk/misc/tcsh/Makefile
user/pgollucci/portupgrade/trunk/misc/tcsh/complete.sample
user/pgollucci/portupgrade/trunk/misc/zsh/Makefile
user/pgollucci/portupgrade/trunk/tests/test_all.rb
user/pgollucci/portupgrade/trunk/tests/test_pkgdb.rb
user/pgollucci/portupgrade/trunk/tests/test_pkginfo.rb
user/pgollucci/portupgrade/trunk/tests/test_pkgtsort.rb
user/pgollucci/portupgrade/trunk/tests/test_pkgversion.rb
user/pgollucci/portupgrade/trunk/tests/test_portinfo.rb
user/pgollucci/portupgrade/trunk/tests/test_portsdb.rb
Modified: user/pgollucci/portupgrade/trunk/Makefile
==============================================================================
--- user/pgollucci/portupgrade/trunk/Makefile Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/Makefile Thu Sep 9 23:37:54 2010 (r212399)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 2006/07/02 15:23:35 sem_prg Exp $
+# $Id: Makefile,v 1.1.1.1 2006/06/13 12:58:59 sem Exp $
SUBDIR= bin \
etc \
Modified: user/pgollucci/portupgrade/trunk/Makefile.compat
==============================================================================
--- user/pgollucci/portupgrade/trunk/Makefile.compat Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/Makefile.compat Thu Sep 9 23:37:54 2010 (r212399)
@@ -1,4 +1,4 @@
-# $Id: Makefile.compat,v 1.1.1.1 2006/06/13 12:58:59 sem_prg Exp $
+# $Id: Makefile.compat 52 2006-01-01 06:26:59Z koma2 $
.if defined(SCRIPTS) && !empty(SCRIPTS) && !target(_scriptsinstall)
Modified: user/pgollucci/portupgrade/trunk/Makefile.inc
==============================================================================
--- user/pgollucci/portupgrade/trunk/Makefile.inc Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/Makefile.inc Thu Sep 9 23:37:54 2010 (r212399)
@@ -1,4 +1,4 @@
-# $Id: Makefile.inc,v 1.1.1.1 2006/06/13 12:58:59 sem_prg Exp $
+# $Id: Makefile.inc 52 2006-01-01 06:26:59Z koma2 $
PREFIX?= /usr/local
Modified: user/pgollucci/portupgrade/trunk/NEWS
==============================================================================
--- user/pgollucci/portupgrade/trunk/NEWS Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/NEWS Thu Sep 9 23:37:54 2010 (r212399)
@@ -349,3 +349,5 @@ portupgrade 2.0.0 (released 2006-01-01):
instead of "portsdb -U" (make INDEX by yourself) in portsdb(1). [1]
Pointed out by: Enrique Matias <cronopios at gmail dot com> [1]
+
+$FreeBSD: projects/pkgtools/NEWS,v 1.27 2009-10-27 23:31:09 stas Exp $
Modified: user/pgollucci/portupgrade/trunk/README
==============================================================================
--- user/pgollucci/portupgrade/trunk/README Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/README Thu Sep 9 23:37:54 2010 (r212399)
@@ -1,4 +1,4 @@
-$Id: README,v 1.1.1.1 2006/06/13 12:58:59 sem_prg Exp $
+$Id: README 52 2006-01-01 06:26:59Z koma2 $
You need to install the following ports to use these pkgtools.
Modified: user/pgollucci/portupgrade/trunk/bin/Makefile
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/Makefile Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/Makefile Thu Sep 9 23:37:54 2010 (r212399)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 2008/07/10 13:17:02 sem_prg Exp $
+# $Id: Makefile,v 1.3 2008/07/10 13:17:02 sem Exp $
SCRIPTSDIR?= ${PREFIX}/sbin
@@ -28,7 +28,7 @@ ${script}: ${script:T}
${RUBY} -pe ' \
if $$. == 1; \
if /^#!/; \
- sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}"; \
+ $$_.sub(/^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}"); \
else; \
$$_ = "#!${RUBY}\n" + $$_; \
end; \
Modified: user/pgollucci/portupgrade/trunk/bin/pkg_fetch
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/pkg_fetch Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/pkg_fetch Thu Sep 9 23:37:54 2010 (r212399)
@@ -73,24 +73,24 @@ usage: #{MYNAME} [-hfqRv] {pkgname|URI}
exit 0
}
- opts.def_option("-f", "--force", "Download a package even if recorded as installed;#{NEXTLINE}Remove existing packages if they are corrupt") {
- |$force|
+ opts.def_option("-f", "--force", "Download a package even if recorded as installed;#{NEXTLINE}Remove existing packages if they are corrupt") { |v|
+ $force = v
}
# opts.def_option("-O", "--omit-check", "Omit sanity checks for dependencies.") {
# $sanity_check = false
# }
- opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") {
- |$noconfig|
+ opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
- opts.def_option("-R", "--upward-recursive", "Download the packages required by the given#{NEXTLINE}packages as well") {
- |$upward_recursive|
+ opts.def_option("-R", "--upward-recursive", "Download the packages required by the given#{NEXTLINE}packages as well") { |v|
+ $upward_recursive = v
}
- opts.def_option("-v", "--verbose", "Be verbose") {
- |$verbose|
+ opts.def_option("-v", "--verbose", "Be verbose") { |v|
+ $verbose = v
}
opts.def_tail_option '
Modified: user/pgollucci/portupgrade/trunk/bin/pkg_glob
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/pkg_glob Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/pkg_glob Thu Sep 9 23:37:54 2010 (r212399)
@@ -90,8 +90,8 @@ usage: #{MYNAME} [-haOqrR] [-x pkgname_g
exit 0
}
- opts.def_option("-a", "--all", "#{$service_verb.capitalize} all the installed packages") {
- |$all|
+ opts.def_option("-a", "--all", "#{$service_verb.capitalize} all the installed packages") { |v|
+ $all = v
$recursive = false
$upward_recursive = false
}
@@ -108,14 +108,14 @@ usage: #{MYNAME} [-haOqrR] [-x pkgname_g
$pkg_delete_args.push '-D'
} if $service == :deinstall
- opts.def_option("-f", "--force", "Force removal of the packages [*]") {
- |$force|
+ opts.def_option("-f", "--force", "Force removal of the packages [*]") { |v|
+ $force = v
$pkg_delete_args.push '-f'
$collate = false
} if $service == :deinstall
- opts.def_option("-i", "--interactive", "Request confirmation for each package removal [*]") {
- |$interactive|
+ opts.def_option("-i", "--interactive", "Request confirmation for each package removal [*]") { |v|
+ $interactive = v
if $interactive
$verbose = true
end
@@ -123,8 +123,8 @@ usage: #{MYNAME} [-haOqrR] [-x pkgname_g
$pkg_delete_args.push '-i'
} if $service == :deinstall
- opts.def_option("-n", "--noexecute", "Do not actually deinstall a package, just report the#{NEXTLINE}steps that would be taken if it were [*]") {
- |$noexecute|
+ opts.def_option("-n", "--noexecute", "Do not actually deinstall a package, just report the#{NEXTLINE}steps that would be taken if it were [*]") { |v|
+ $noexecute = v
if $noexecute
$verbose = true
$interactive = false
@@ -137,17 +137,16 @@ usage: #{MYNAME} [-haOqrR] [-x pkgname_g
$sanity_check = false
}
- opts.def_option("-p", "--prefix=PREFIX", "Set prefix [*]") {
- |prefix|
+ opts.def_option("-p", "--prefix=PREFIX", "Set prefix [*]") { |prefix|
$pkg_delete_args.push '-p', prefix
} if $service == :deinstall
- opts.def_option("-P", "--preserve", "Preserve shared libraries (Save *.so.n)") {
- |$preserve_shlib|
+ opts.def_option("-P", "--preserve", "Preserve shared libraries (Save *.so.n)") { |v|
+ $preserve_shlib = v
} if $service == :deinstall
- opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") {
- |$noconfig|
+ opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
opts.def_option("-r", "--recursive", "#{$service_verb.capitalize} all those depending on the given#{NEXTLINE}packages as well") {
@@ -158,8 +157,8 @@ usage: #{MYNAME} [-haOqrR] [-x pkgname_g
$upward_recursive = true unless $all
}
- opts.def_option("-v", "--verbose", "Turn on verbose output [*]") {
- |$verbose|
+ opts.def_option("-v", "--verbose", "Turn on verbose output [*]") { |v|
+ $verbose = v
$pkg_delete_args.push '-v'
} if $service == :deinstall
@@ -168,8 +167,7 @@ usage: #{MYNAME} [-haOqrR] [-x pkgname_g
[*] These options are transparently passed to pkg_delete(1).
EOF
- opts.def_option("-x", "--exclude=GLOB", "Exclude packages matching the specified glob#{NEXTLINE}pattern") {
- |arg|
+ opts.def_option("-x", "--exclude=GLOB", "Exclude packages matching the specified glob#{NEXTLINE}pattern") { |arg|
begin
pattern = parse_pattern(arg)
rescue RegexpError => e
@@ -299,8 +297,8 @@ def get_beforedeinstall_command(origin)
commands[commands.size, 0] = config_beforedeinstall(origin) # maybe nil
commands.uniq!
- commands.each { |cmd| cmd.sub!(/^[;\s]+/, '') }
- commands.reject! { |cmd| cmd.empty? }
+ commands.each { |cmd| cmd.sub!(/^[;\s]+/, '') if !cmd.nil }
+ commands.reject! { |cmd| cmd.nil? || cmd.empty? }
if commands.empty?
nil
Modified: user/pgollucci/portupgrade/trunk/bin/pkg_sort
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/pkg_sort Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/pkg_sort Thu Sep 9 23:37:54 2010 (r212399)
@@ -62,8 +62,8 @@ usage: #{MYNAME} [-hq]
exit 0
}
- opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") {
- |$noconfig|
+ opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
opts.def_tail_option '
Modified: user/pgollucci/portupgrade/trunk/bin/pkgdb
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/pkgdb Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/pkgdb Thu Sep 9 23:37:54 2010 (r212399)
@@ -28,6 +28,8 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
+# $FreeBSD: projects/pkgtools/bin/pkgdb,v 1.25 2009-10-26 12:26:10 stas Exp $
+#
MYREVISION = %w$Rev: 52 $[1]
MYDATE = %w$Date: 2008/07/01 13:32:07 $[1]
@@ -74,8 +76,7 @@ usage: #{MYNAME} [-hafFfiLOQQquv] [-c pk
exit 0
}
- opts.def_option("-c", "--collate=PKGNAME", "Show files installed by the given packge#{NEXTLINE}that have been overwritten by other packages") {
- |pkgname|
+ opts.def_option("-c", "--collate=PKGNAME", "Show files installed by the given packge#{NEXTLINE}that have been overwritten by other packages") { |pkgname|
pkgname = $pkgdb.strip(pkgname, true)
begin
@@ -99,17 +100,17 @@ usage: #{MYNAME} [-hafFfiLOQQquv] [-c pk
end unless dry_parse
}
- opts.def_option("-f", "--force", "Force;#{NEXTLINE}Specified with -u, update database#{NEXTLINE}regardless of timestamps#{NEXTLINE}Specified with -F, fix held packages too") {
- |$force|
+ opts.def_option("-f", "--force", "Force;#{NEXTLINE}Specified with -u, update database#{NEXTLINE}regardless of timestamps#{NEXTLINE}Specified with -F, fix held packages too") { |v|
+ $force = v
}
- opts.def_option("-F", "--fix", "Fix the package database interactively") {
- |$fix_db|
+ opts.def_option("-F", "--fix", "Fix the package database interactively") { |v|
+ $fix_db = v
$interactive = true if ! $automatic
}
- opts.def_option("-a", "--auto", "Turn on automatic mode when -F is also specified") {
- |$automatic|
+ opts.def_option("-a", "--auto", "Turn on automatic mode when -F is also specified") { |v|
+ $automatic = v
$interactive = false if $fix_db
}
@@ -118,16 +119,15 @@ usage: #{MYNAME} [-hafFfiLOQQquv] [-c pk
}
opts.def_option("-i", "--interactive",
- "Turn on interactive mode") {
- |$interactive|
+ "Turn on interactive mode") { |v|
+ $interactive = v
}
- opts.def_option("-L", "--fix-lost", "Check and restore lost dependencies#{NEXTLINE}against the ports tree") {
- |$check_lost|
+ opts.def_option("-L", "--fix-lost", "Check and restore lost dependencies#{NEXTLINE}against the ports tree") { |v|
+ $check_lost = v
}
- opts.def_option("-o", "--origin=PKGNAME[=ORIGIN]", "Look up or change the origin of the given#{NEXTLINE}package") {
- |arg|
+ opts.def_option("-o", "--origin=PKGNAME[=ORIGIN]", "Look up or change the origin of the given#{NEXTLINE}package") { |arg|
pkgname, origin = arg.split('=', 2)
spkgname = $pkgdb.strip(pkgname, true)
unless dry_parse
@@ -149,8 +149,8 @@ usage: #{MYNAME} [-hafFfiLOQQquv] [-c pk
end
}
- opts.def_option("-O", "--omit-check", "Specified with -F, turn off checks#{NEXTLINE}dependencies against the ports tree. Useful#{NEXTLINE}if you need a speed-up") {
- |$omit_check|
+ opts.def_option("-O", "--omit-check", "Specified with -F, turn off checks#{NEXTLINE}dependencies against the ports tree. Useful#{NEXTLINE}if you need a speed-up") { |v|
+ $omit_check = v
}
opts.def_option("-Q", "--quiet", "Do not write anything to stdout;#{NEXTLINE}Specified twice, stderr neither") {
@@ -163,12 +163,11 @@ usage: #{MYNAME} [-hafFfiLOQQquv] [-c pk
end
}
- opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") {
- |$noconfig|
+ opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
- opts.def_option("-s", "--substitute=/OLD/NEW/", "Substitute all the dependencies recorded#{NEXTLINE}as OLD with NEW") {
- |expr|
+ opts.def_option("-s", "--substitute=/OLD/NEW/", "Substitute all the dependencies recorded#{NEXTLINE}as OLD with NEW") { |expr|
if expr.empty?
warning_message "Illegal expression: " + expr
print opts
@@ -201,12 +200,12 @@ usage: #{MYNAME} [-hafFfiLOQQquv] [-c pk
$automatic = automatic
}
- opts.def_option("-u", "--update", "Update the package database") {
- |$update_db|
+ opts.def_option("-u", "--update", "Update the package database") { |v|
+ $update_db = v
}
- opts.def_option("-v", "--verbose", "Be verbose") {
- |$verbose|
+ opts.def_option("-v", "--verbose", "Be verbose") { |v|
+ $verbose = v
}
opts.def_tail_option '
@@ -647,11 +646,11 @@ def fix_dependencies(pkgname)
puts "Stale dependency: #{pkgname} -> #{dep} (#{origin}):"
if !$omit_check && !get_real_run_deps(pkgname).values.include?(origin)
# Ignore dependencies which exist in ALG_PKGDEP
- next if alt_dep(dep)
-
- puts "-> Deleted. (irrelevant)"
- modify_pkgdep(pkgname, dep, :delete)
- next
+ unless alt_dep(dep, origin)
+ puts "-> Deleted. (irrelevant)"
+ modify_pkgdep(pkgname, dep, :delete)
+ next
+ end
end
if config_held?(pkgname) && !$force
Modified: user/pgollucci/portupgrade/trunk/bin/pkgdu
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/pkgdu Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/pkgdu Thu Sep 9 23:37:54 2010 (r212399)
@@ -77,25 +77,24 @@ usage: #{MYNAME} [-hbkmRrqs] [pkgname_gl
$divider = 1024*1024
}
- opts.def_option("-t", "--total", "Display a grand total") {
- |$total|
+ opts.def_option("-t", "--total", "Display a grand total") { |v|
+ $total = v
}
- opts.def_option("-q", "--quiet", "Display only grand total") {
- |$quiet|
+ opts.def_option("-q", "--quiet", "Display only grand total") { |v|
+ $quiet = v
$total = true
}
- opts.def_option("-r", "--recursive", "Check for all those depending on the given#{NEXTLINE}packages as well") {
- |$recursive|
+ opts.def_option("-r", "--recursive", "Check for all those depending on the given#{NEXTLINE}packages as well") { |v|
+ $recursive = v
}
- opts.def_option("-R", "--upward-recursive", "Check for all those required by the given#{NEXTLINE}packages as well") {
- |$upward_recursive|
+ opts.def_option("-R", "--upward-recursive", "Check for all those required by the given#{NEXTLINE}packages as well") { |v|
+ $upward_recursive = v
}
- opts.def_option("-x", "--exclude=GLOB", "Exclude packages matching the specified glob#{NEXTLINE}pattern") {
- |arg|
+ opts.def_option("-x", "--exclude=GLOB", "Exclude packages matching the specified glob#{NEXTLINE}pattern") { |arg|
begin
pattern = parse_pattern(arg)
rescue RegexpError => e
Modified: user/pgollucci/portupgrade/trunk/bin/portcvsweb
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/portcvsweb Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/portcvsweb Thu Sep 9 23:37:54 2010 (r212399)
@@ -418,22 +418,20 @@ usage: #{MYNAME} [-hqv] {pkgname_glob|po
exit 0
}
- opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") {
- |$noconfig|
+ opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
- opts.def_option("-v", "--verbose", "Be verbose") {
- |$verbose|
+ opts.def_option("-v", "--verbose", "Be verbose") { |v|
+ $verbose = v
}
opts.def_option("-F", "--freshports",
- "View FreshPorts.org instead of cvsweb") {
- |freshports|
+ "View FreshPorts.org instead of cvsweb") { |freshports|
}
opts.def_option("-D [DATE]", "--datespec [DATE]",
- "View the FreshPorts.org of DAYBACK days ago.") {
- |datespec|
+ "View the FreshPorts.org of DAYBACK days ago.") { |datespec|
if datespec == nil
datespec = "0"
end
Modified: user/pgollucci/portupgrade/trunk/bin/portsclean
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/portsclean Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/portsclean Thu Sep 9 23:37:54 2010 (r212399)
@@ -72,8 +72,8 @@ usage: #{MYNAME} [-hCDDiLnPPQQq]
exit 0
}
- opts.def_option("-C", "--workclean", "Clean up working directories") {
- |$workclean|
+ opts.def_option("-C", "--workclean", "Clean up working directories") { |v|
+ $workclean = v
}
opts.def_option("-D", "--distclean", "Clean up distfiles which are not referenced from any#{NEXTLINE}port in the ports tree;#{NEXTLINE}Specified twice, clean up distfiles which are not#{NEXTLINE}referenced from any port that is currently installed") {
@@ -86,12 +86,12 @@ usage: #{MYNAME} [-hCDDiLnPPQQq]
end
}
- opts.def_option("-L", "--libclean", "Clean up old shared libraries") {
- |$libclean|
+ opts.def_option("-L", "--libclean", "Clean up old shared libraries") { |v|
+ $libclean = v
}
- opts.def_option("-n", "--noexecute", "Do not actually delete files") {
- |$noexecute|
+ opts.def_option("-n", "--noexecute", "Do not actually delete files") { |v|
+ $noexecute = v
if $noexecute
$interactive = false
end
@@ -115,8 +115,8 @@ usage: #{MYNAME} [-hCDDiLnPPQQq]
end
}
- opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") {
- |$noconfig|
+ opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
opts.def_tail_option '
@@ -310,7 +310,7 @@ def libclean()
libtable = {}
- `/sbin/ldconfig -elf -r`.each do |line|
+ `/sbin/ldconfig -elf -r`.each_line do |line|
line.strip!
case line
Modified: user/pgollucci/portupgrade/trunk/bin/portsdb
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/portsdb Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/portsdb Thu Sep 9 23:37:54 2010 (r212399)
@@ -72,49 +72,47 @@ usage: #{MYNAME} [-hfFMqrRuU] [-x port_g
exit 0
}
- opts.def_option("-f", "--force", "Force to update database regardless of timestamps") {
- |$force|
+ opts.def_option("-f", "--force", "Force to update database regardless of timestamps") { |v|
+ $force = v
}
- opts.def_option("-F", "--fetchindex", "Fetch INDEX") {
- |b|
+ opts.def_option("-F", "--fetchindex", "Fetch INDEX") { |b|
$update_index = $fetch_index = b
}
- opts.def_option("-M", "--master-recursive", "List all the master ports of the given packages#{NEXTLINE}as well") {
- |$master_recursive|
+ opts.def_option("-M", "--master-recursive", "List all the master ports of the given packages#{NEXTLINE}as well") { |v|
+ $master_recursive = v
}
# opts.def_option("-O", "--omit-check", "Omit sanity checks for dependencies.") {
# $sanity_check = false
# }
- opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") {
- |$noconfig|
+ opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
- opts.def_option("-r", "--recursive", "List all those depending on the given packages#{NEXTLINE}as well") {
- |$recursive|
+ opts.def_option("-r", "--recursive", "List all those depending on the given packages#{NEXTLINE}as well") { |v|
+ $recursive = v
}
- opts.def_option("-R", "--upward-recursive", "List all those required by the given packages#{NEXTLINE}as well") {
- |$upward_recursive|
+ opts.def_option("-R", "--upward-recursive", "List all those required by the given packages#{NEXTLINE}as well") { |v|
+ $upward_recursive = v
}
-# opts.def_option("-S", "--slave-recursive", "List all the slave ports of the given packages#{NEXTLINE}as well") {
-# |$slave_recursive|
+# opts.def_option("-S", "--slave-recursive", "List all the slave ports of the given packages#{NEXTLINE}as well") { |v|
+# $slave_recursive = v
# }
- opts.def_option("-u", "--update", "Update INDEX.db") {
- |$update_db|
+ opts.def_option("-u", "--update", "Update INDEX.db") { |v|
+ $update_db = v
}
- opts.def_option("-U", "--updateindex", "Update INDEX") {
- |$update_index|
+ opts.def_option("-U", "--updateindex", "Update INDEX") { |v|
+ $update_index = v
}
- opts.def_option("-x", "--exclude=GLOB", "Exclude ports matching the specified glob#{NEXTLINE}pattern") {
- |arg|
+ opts.def_option("-x", "--exclude=GLOB", "Exclude ports matching the specified glob#{NEXTLINE}pattern") { |arg|
begin
pattern = parse_pattern(arg)
rescue RegexpError => e
Modified: user/pgollucci/portupgrade/trunk/bin/portupgrade
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/portupgrade Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/portupgrade Thu Sep 9 23:37:54 2010 (r212399)
@@ -28,6 +28,8 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
+# $FreeBSD: projects/pkgtools/bin/portupgrade,v 1.67 2009-12-22 01:24:51 stas Exp $
+#
MYREVISION = %w$Rev: 71 $[1]
MYDATE = %w$Date: 2008/07/01 11:32:25 $[1]
@@ -234,44 +236,44 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
}
opts.def_option("-a", "--all",
- "Do with all the installed packages") {
- |$all|
+ "Do with all the installed packages") { |v|
+ $all = v
$recursive = false
$upward_recursive = false
}
opts.def_option("-A", "--afterinstall=CMD",
- "Run the command after each installation") {
- |$afterinstall|
+ "Run the command after each installation") { |v|
+ $afterinstall = v
$afterinstall.strip!
}
opts.def_option("-b", "--backup-packages",
- "Keep backup packages of the old versions") {
- |$backup_packages|
+ "Keep backup packages of the old versions") { |v|
+ $backup_packages = v
}
opts.def_option("--batch",
"Run an upgrading process in a batch mode" << NEXTLINE <<
- "(with BATCH=yes)") {
- |$batch_mode|
+ "(with BATCH=yes)") { |v|
+ $batch_mode = v
}
opts.def_option("-B", "--beforebuild=CMD",
"Run the command before each build; If the command" << NEXTLINE <<
- "exits in failure, then the port will be skipped") {
- |$beforebuild|
+ "exits in failure, then the port will be skipped") { |v|
+ $beforebuild = v
$beforebuild.strip!
}
opts.def_option("-c", "--config",
- "Run \"make config-conditional\" before everything for all tasks") {
- |$config|
+ "Run \"make config-conditional\" before everything for all tasks") { |v|
+ $config = v
}
opts.def_option("-C", "--force-config",
- "Run \"make config\" before everything for all tasks") {
- |$force_config|
+ "Run \"make config\" before everything for all tasks") { |v|
+ $force_config = v
$config = true
}
@@ -283,43 +285,42 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
}
opts.def_option("-e", "--emit-summaries",
- "Emit summary info after each port processing" << NEXTLINE ) {
- |$emit_summaries|
+ "Emit summary info after each port processing" << NEXTLINE ) { |v|
+ $emit_summaries = v
}
opts.def_option("-f", "--force",
"Force the upgrade of a port even if it is to be a" << NEXTLINE <<
- "downgrade or just a reinstall, or the port is held") {
- |$force|
+ "downgrade or just a reinstall, or the port is held") { |v|
+ $force = v
}
opts.def_option("-F", "--fetch-only",
"Only fetch distfiles or packages (if -P is given);" << NEXTLINE <<
- "Do not build or install anything") {
- |$fetch_only|
+ "Do not build or install anything") { |v|
+ $fetch_only = v
}
opts.def_option("--ignore-moved",
- "Ignore MOVED file") {
- |$ignore_moved|
+ "Ignore MOVED file") { |v|
+ $ignore_moved = v
}
opts.def_option("-i", "--interactive",
- "Turn on interactive mode") {
- |$interactive|
+ "Turn on interactive mode") { |v|
+ $interactive = v
$verbose = true
}
opts.def_option("-k", "--keep-going",
"Force the upgrade of a port even if some of the" << NEXTLINE <<
- "requisite ports have failed to upgrade") {
- |$keep_going|
+ "requisite ports have failed to upgrade") { |v|
+ $keep_going = v
}
opts.def_option("-l", "--results-file=FILE",
"Specify a file name to save the results to" << NEXTLINE <<
- "(default: do not save results)") {
- |resultsfile|
+ "(default: do not save results)") { |resultsfile|
$resultsfile = File.expand_path(resultsfile)
}
@@ -327,8 +328,7 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
"Specify a printf(3) style format to determine the" << NEXTLINE <<
"log file name for each port; '%s::%s' is appended" << NEXTLINE <<
"if it does not contain a %; category and portname" << NEXTLINE <<
- "are given as arguments (default: do not save logs)") {
- |fmt|
+ "are given as arguments (default: do not save logs)") { |fmt|
fmt.include?(?%) or fmt << '%s::%s'
$logfilename_format = File.expand_path(fmt)
@@ -336,14 +336,13 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
opts.def_option("-m", "--make-args=ARGS",
"Specify arguments to append to each make(1)" << NEXTLINE <<
- "command line") {
- |$make_args|
- }
+ "command line") { |v|
+ $make_args = v
+ }
opts.def_option("-M", "--make-env=ARGS",
"Specify arguments to prepend to each make(1)" << NEXTLINE <<
- "command line") {
- |make_env|
+ "command line") { |make_env|
$make_env = shellwords(make_env) unless make_env.empty?
if $make_env[0].include?('=')
@@ -353,8 +352,8 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
opts.def_option("-n", "--noexecute",
"Do not upgrade any ports, but just show what would" << NEXTLINE <<
- "be done") {
- |$noexecute|
+ "be done") { |v|
+ $noexecute = v
$verbose = true
$interactive = true
$yestoall = false
@@ -363,13 +362,12 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
opts.def_option("-N", "--new",
"Install a new one when a specified package is" << NEXTLINE <<
"not installed, after upgrading all the dependent" << NEXTLINE <<
- "packages (default: #{MYNAME == 'portinstall' ? 'on' : 'off'})") {
- |$new|
+ "packages (default: #{MYNAME == 'portinstall' ? 'on' : 'off'})") { |v|
+ $new = v
}
opts.def_option("-o", "--origin=ORIGIN",
- "Specify a port to upgrade the following pkg with") {
- |origin|
+ "Specify a port to upgrade the following pkg with") { |origin|
$origin = $portsdb.strip(origin) || origin
}
@@ -380,8 +378,8 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
}
opts.def_option("-p", "--package",
- "Build package when each port is installed") {
- |$package|
+ "Build package when each port is installed") { |v|
+ $package = v
}
opts.def_option("-P", "--use-packages",
@@ -395,19 +393,19 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
}
opts.def_option("--use-packages-only",
- "Or -PP; Use no ports but packages only") {
- |$use_packages_only|
+ "Or -PP; Use no ports but packages only") { |v|
+ $use_packages_only = v
$use_packages = true
}
opts.def_option("-q", "--quiet",
- "Be quiet when -N option specified and the package already installed") {
- |$quiet|
+ "Be quiet when -N option specified and the package already installed") { |v|
+ $quiet = v
}
opts.def_option("--noconfig",
- "Do not read pkgtools.conf") {
- |$noconfig|
+ "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
opts.def_option("-r", "--recursive",
@@ -424,14 +422,13 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
}
opts.def_option("-s", "--sudo",
- "Run commands under sudo(8) where needed") {
- |$sudo|
+ "Run commands under sudo(8) where needed") { |v|
+ $sudo = v
}
opts.def_option("-S", "--sudo-command=CMD",
"Specify an alternative to sudo(8)" << NEXTLINE <<
- "e.g. 'su root -c \"%s\"' (default: sudo)") {
- |sudo_command|
+ "e.g. 'su root -c \"%s\"' (default: sudo)") { |sudo_command|
$sudo_args = shellwords(sudo_command)
}
@@ -441,31 +438,28 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
}
opts.def_option("-v", "--verbose",
- "Be verbose") {
- |$verbose|
+ "Be verbose") { |v|
+ $verbose = v
}
opts.def_option("-w", "--noclean",
- "Do not \"make clean\" before each build") {
- |noclean|
+ "Do not \"make clean\" before each build") { |noclean|
$clean = false
}
opts.def_option("-W", "--nocleanup",
- "Do not \"make clean\" after each installation") {
- |nocleanup|
+ "Do not \"make clean\" after each installation") { |nocleanup|
$cleanup = false
}
opts.def_option("--without-env-upgrade",
- "Do not set UPGRADE_* environment variables") {
- |$without_env_upgrade|
+ "Do not set UPGRADE_* environment variables") { |v|
+ $without_env_upgrade = v
}
opts.def_option("-x", "--exclude=GLOB",
"Exclude packages matching the specified glob" << NEXTLINE <<
- "pattern") {
- |arg|
+ "pattern") { |arg|
begin
pattern = parse_pattern(arg)
rescue RegexpError => e
@@ -477,8 +471,8 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
}
opts.def_option("-y", "--yes",
- "Answer yes to all the questions") {
- |$yestoall|
+ "Answer yes to all the questions") { |v|
+ $yestoall = v
$verbose = true
$noexecute = false
}
@@ -637,7 +631,10 @@ Environment Variables [default]:
if $upward_recursive || $config
dep = []
get_all_depends(origin).each do |d|
- dep << $pkgdb.deorigin(d).to_s
+ newdep = $pkgdb.deorigin(d)
+ unless newdep.nil? then
+ dep << newdep.to_s
+ end
end
depends |= dep if $upward_recursive
end
@@ -659,7 +656,7 @@ Environment Variables [default]:
not_need_upgrade = []
depends.each do |task|
STDERR.print '.'
- next if task == ''
+ next if task.nil? or task.empty?
begin
pkg = PkgInfo.new(task)
rescue ArgumentError => e
@@ -834,7 +831,7 @@ def get_all_depends(origin, parents_list
depends = Set.new
portdir = $portsdb.portdir(origin)
- return nil if not File.directory?(portdir)
+ return [] if not File.directory?(portdir)
begin
run_make_config(portdir, origin) if $config
@@ -873,9 +870,7 @@ def get_all_depends(origin, parents_list
depends.each do |dep|
children_deps.merge(get_all_depends(dep, parents_list)) if !dep.nil?
end
- if children_deps.nil?
- next
- else
+ if !children_deps.nil?
depends.merge(children_deps)
end
@@ -932,7 +927,7 @@ def do_upgrade(pkgname)
origin = $task_options[pkgname][:origin]
- if !origin || !File.directory?($portsdb.ports_dir()+'/'+origin)
+ if !origin || !File.directory?($portsdb.ports_dir() + '/' + origin)
if !$ignore_moved and \
!config_ignore_moved?(pkg) and \
(moved = $portsdb.moved.trace(pkg.origin))
@@ -942,7 +937,7 @@ def do_upgrade(pkgname)
end
else
warning_message "Package '#{pkg.name}' has been removed from ports tree."
- $results << PkgResult.new(origin, :ignored, pkgname)
+# $results << PkgResult.new(origin, :ignored, pkgname)
return
end
else
@@ -1029,6 +1024,10 @@ def do_upgrade(pkgname)
end
def do_install(origin)
+ if origin.nil? then
+ warning_message "NIL origin passed to do_install"
+ return
+ end
if result = $results[origin]
progress_message "Skipping '#{origin}' because it has already #{result.phrase(true)}"
@@ -1147,8 +1146,8 @@ def get_beforebuild_command(origin)
commands[commands.size, 0] = config_beforebuild(origin) # maybe nil
commands.uniq!
- commands.each { |cmd| cmd.sub!(/^[;\s]+/, '') }
- commands.reject! { |cmd| cmd.empty? }
+ commands.each { |cmd| cmd.sub!(/^[;\s]+/, '') if !cmd.nil? }
+ commands.reject! { |cmd| cmd.nil? || cmd.empty? }
if commands.empty?
nil
@@ -1163,8 +1162,8 @@ def get_afterinstall_command(origin)
commands[0, 0] = config_afterinstall(origin) # maybe nil
commands.uniq!
- commands.each { |cmd| cmd.sub!(/^[;\s]+/, '') }
- commands.reject! { |cmd| cmd.empty? }
+ commands.each { |cmd| cmd.sub!(/^[;\s]+/, '') if !cmd.nil? }
+ commands.reject! { |cmd| cmd.nil? || cmd.empty? }
if commands.empty?
nil
@@ -1460,18 +1459,24 @@ def get_pkgname(origin)
cmdargs.concat(get_make_args(origin))
- output = `cd #{portdir} && #{shelljoin(*cmdargs)} -V PKGNAME -V IGNORE -V NO_IGNORE 2>&1`.to_a
+ output = `cd #{portdir} && #{shelljoin(*cmdargs)} -V PKGNAME -V IGNORE -V NO_IGNORE -V ECHO_MSG 2>&1`.scan(/.*\n/)
- if output.size != 3
+ if output.size != 4
warning_message "Makefile possibly broken: #{origin}:"
output.each { |line| STDERR.print "\t" + line }
raise MakefileBrokenError
end
- ignore = output[1].chomp
+ ignore_message = output[1].chomp
no_ignore = !output[2].chomp.empty?
+ echo_cmd = output[3].chomp
+ ignore = `#{echo_cmd} "#{ignore_message}"`
+
+ # Some packages ouptut a ':\n ' to try to look nice when using the normal
+ # ports build process. That looks really bad here, so we undo that.
+ ignore.slice!(0..2) if (ignore.match /^:\n /)
- if not ignore.empty?
+ if not ignore_message.empty?
warning_message "Port marked as IGNORE: #{origin}:"
STDERR.puts "\t" + ignore
raise IgnoreMarkError unless no_ignore
@@ -1936,7 +1941,7 @@ def uninstall_pkg(pkgname, logfile = nil
if str = backquote!(PkgDB::command(:pkg_create), '-vb', pkgname,
File.join($tmpdir, pkgname + $portsdb.pkg_sufx))
- str.each { |line|
+ str.each_line { |line|
if /^Creating .*tar ball in \'(.*)\'/ =~ line
backup_pkgfile = $1
break
Modified: user/pgollucci/portupgrade/trunk/bin/portversion
==============================================================================
--- user/pgollucci/portupgrade/trunk/bin/portversion Thu Sep 9 23:31:22 2010 (r212398)
+++ user/pgollucci/portupgrade/trunk/bin/portversion Thu Sep 9 23:37:54 2010 (r212399)
@@ -85,12 +85,11 @@ usage: #{MYNAME} [-hOqv] [-l limit_chars
exit 0
}
- opts.def_option("-c", "--command-output", "Enable command output") {
- |$command_output|
+ opts.def_option("-c", "--command-output", "Enable command output") { |v|
+ $command_output = v
}
- opts.def_option("-C", "--command-args=ARGS", "Specify the arguments for portupgrade in command#{NEXTLINE}output (default: none)") {
- |command_args|
+ opts.def_option("-C", "--command-args=ARGS", "Specify the arguments for portupgrade in command#{NEXTLINE}output (default: none)") { |command_args|
$command = 'portupgrade ' + command_args
}
@@ -99,20 +98,20 @@ usage: #{MYNAME} [-hOqv] [-l limit_chars
}
opts.def_option("--ignore-moved",
- "Ignore MOVED file") {
- |$ignore_moved|
+ "Ignore MOVED file") { |v|
+ $ignore_moved = v
}
- opts.def_option("-l", "--limit=CHARS", "Only include the packages with the specified#{NEXTLINE}status flags") {
- |$limit_chars|
+ opts.def_option("-l", "--limit=CHARS", "Only include the packages with the specified#{NEXTLINE}status flags") { |v|
+ $limit_chars = v
# XXX: workaround: optparse treats `-l=' as '-l ""'
if $limit_chars.empty?
$limit_chars = '='
end
}
- opts.def_option("-L", "--inv-limit=CHARS", "Exclude the packages with the specified#{NEXTLINE}status flags") {
- |$inv_limit_chars|
+ opts.def_option("-L", "--inv-limit=CHARS", "Exclude the packages with the specified#{NEXTLINE}status flags") { |v|
+ $inv_limit_chars = v
# XXX: workaround: optparse treats `-L=' as '-L ""'
if $inv_limit_chars.empty?
$inv_limit_chars = '='
@@ -127,34 +126,33 @@ usage: #{MYNAME} [-hOqv] [-l limit_chars
$sanity_check = false
}
- opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") {
- |$noconfig|
+ opts.def_option("-q", "--noconfig", "Do not read pkgtools.conf") { |v|
+ $noconfig = v
}
opts.def_option("-Q", "--quiet", "Do not display status chars") {
$verbose_output = :quiet
}
- opts.def_option("-r", "--recursive", "Check for all those depending on the given#{NEXTLINE}packages as well") {
- |$recursive|
+ opts.def_option("-r", "--recursive", "Check for all those depending on the given#{NEXTLINE}packages as well") { |v|
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list