View | Details | Raw Unified | Return to bug 177365 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-bin_portupgrade (+91 lines)
Line 0 Link Here
1
--- bin/portupgrade.orig	2015-05-15 00:13:41 UTC
2
+++ bin/portupgrade
3
@@ -193,6 +193,7 @@ def init_global
4
   $fetch_only = false
5
   $fetch_recursive = false
6
   $force = false
7
+  $force_all = false
8
   $keep_going = false
9
   $ignore_moved = false
10
   $interactive = false
11
@@ -245,7 +246,6 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
12
     opts.def_option("-a", "--all",
13
 		    "Do with all the installed packages") { |v|
14
       $all = v
15
-      $recursive = false
16
       $upward_recursive = false
17
     }
18
 
19
@@ -298,7 +298,17 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
20
 
21
     opts.def_option("-f", "--force",
22
 		    "Force the upgrade of a port even if it is to be a" << NEXTLINE <<
23
-		    "downgrade or just a reinstall, or the port is held") { |v|
24
+		    "downgrade or just a reinstall, or the port is held" << NEXTLINE <<
25
+		    "Specified twice, --force-all is implied") { |v|
26
+      if $force
27
+	$force_all = v
28
+      end
29
+      $force = v
30
+    }
31
+
32
+    opts.def_option("--force_all",
33
+                    "Or -ff; Force upgrade or reinstall of all ports") { |v|
34
+      $force_all = v
35
       $force = v
36
     }
37
 
38
@@ -418,7 +428,7 @@ usage: #{MYNAME} [-habcCDDefFiklnOpPPqrR
39
     opts.def_option("-r", "--recursive",
40
 		    "Do with all those depending on the given packages" << NEXTLINE <<
41
 		    "as well") {
42
-      $recursive = true unless $all
43
+      $recursive = true
44
     }
45
 
46
     opts.def_option("-R", "--upward-recursive",
47
@@ -596,7 +606,7 @@ Environment Variables [default]:
48
 	      $pkgdb.glob(pattern, false).each do |pkgname|
49
 		first ||= pkgname
50
 
51
-		list |= $pkgdb.recurse(pkgname, $recursive, false, $sanity_check)
52
+		list |= $pkgdb.recurse(pkgname, $recursive && !(arg.equal? all), false, $sanity_check)
53
 	      end
54
 	    rescue => e
55
               raise e if e.class == PkgDB::NeedsPkgNGSupport
56
@@ -611,14 +621,14 @@ Environment Variables [default]:
57
 	      end
58
 	    end
59
 
60
-	    upgrade_tasks |= list
61
+	    list -= upgrade_tasks
62
 
63
 	    found = true
64
 
65
 	    # Check packages for updates and gather dependecies
66
 	    depends = []
67
 	    not_need_upgrade = []
68
-	    upgrade_tasks.each do |task|
69
+	    list.each do |task|
70
 	      pkg = PkgInfo.new(task)
71
 	      if task == first && $origin
72
 		origin = $origin
73
@@ -670,7 +680,7 @@ Environment Variables [default]:
74
 		end
75
 		name =~ /^(.+)-([^-]+)$/
76
 		newversion = PkgVersion.new($2)
77
-		if newversion <= pkg.version && !$force
78
+		if newversion <= pkg.version && !($force_all || ($force && !(arg.equal? all)))
79
 		  not_need_upgrade << task
80
 		  next
81
 		end
82
@@ -678,7 +688,8 @@ Environment Variables [default]:
83
 		#install_tasks |= get_notinstalled_depends(origin)
84
 	      end
85
 	    end
86
-	    upgrade_tasks -= not_need_upgrade
87
+	    list -= not_need_upgrade
88
+	    upgrade_tasks |= list
89
 
90
 	    # Check dependencies for updates
91
 	    depends -= ['']
(-)files/patch-man_portupgrade.1 (+75 lines)
Line 0 Link Here
1
--- man/portupgrade.1.orig	2015-05-15 00:13:41 UTC
2
+++ man/portupgrade.1
3
@@ -188,6 +188,21 @@ Force the upgrade of a package even if i
4
 a reinstall of the same version, or the port is held by user using the
5
 HOLD_PKGS variable in
6
 .Pa pkgtools.conf .
7
+This option is ignored when combined with 
8
+.Fl a
9
+or 
10
+.Ar '*'
11
+as
12
+.Ar pkgname_glob .
13
+.Pp
14
+.It Fl ff
15
+.It Fl -force-all
16
+Force the upgrade or reinstallation of all packages when combined with
17
+.Fl a
18
+or
19
+.Ar '*'
20
+as
21
+.Ar pkgname_glob .
22
 .Pp
23
 .It Fl F
24
 .It Fl -fetch-only
25
@@ -335,6 +350,12 @@ Do not read the configuration file -
26
 .It Fl r
27
 .It Fl -recursive
28
 Act on all those packages depending on the given packages as well.
29
+This option is ignored when combined with 
30
+.Fl a
31
+or 
32
+.Ar '*'
33
+as
34
+.Ar pkgname_glob .
35
 .Pp
36
 .It Fl R
37
 .It Fl -upward-recursive
38
@@ -648,6 +669,37 @@ from a version comparison.
39
 is the option to specify an exclusion pattern.
40
 .Pp
41
 .It
42
+Rebuild and reinstall all ports that depend on
43
+.Ar sdl ,
44
+and upgrade all other ports in the proper order:
45
+.Pp
46
+.Dl portupgrade -arf sdl
47
+.Pp
48
+The
49
+.Fl f
50
+/
51
+.Fl -force
52
+and
53
+.Fl r
54
+/
55
+.Fl -recursive
56
+options only apply to the explicitly specified port(s) and not to
57
+all of the ports implied by
58
+.Fl a
59
+/
60
+.Fl all .
61
+.Pp
62
+.It
63
+Rebuild and reinstall all ports:
64
+.Pp
65
+.Dl portupgrade -aff
66
+.Pp
67
+.Fl ff
68
+/
69
+.Fl -force-all
70
+option applies to all ports.
71
+.Pp
72
+.It
73
 Rebuild and reinstall all that ports that were installed prior to the date
74
 2001-09-20:
75
 .Pp

Return to bug 177365