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

Collapse All | Expand All

(-)/tmp/portinfo.rb (-3 / +5 lines)
Lines 34-41 Link Here
34
  include Comparable
34
  include Comparable
35
35
36
  FIELDS = [ :pkgname, :origin, :prefix, :comment, :descr_file,
36
  FIELDS = [ :pkgname, :origin, :prefix, :comment, :descr_file,
37
             :maintainer, :categories, :build_depends, :run_depends, :www ]
37
             :maintainer, :categories, :build_depends, :run_depends, :www,
38
  LIST_FIELDS = [ :categories, :build_depends, :run_depends ]
38
             :extract_depends, :patch_depends, :fetch_depends ]
39
  LIST_FIELDS = [ :categories, :build_depends, :run_depends,
40
                  :extract_depends, :patch_depends, :fetch_depends ]
39
  PORTS_DIR_FIELDS = [ :origin, :descr_file ]
41
  PORTS_DIR_FIELDS = [ :origin, :descr_file ]
40
  NFIELDS = FIELDS.size
42
  NFIELDS = FIELDS.size
41
  FIELD_SEPARATOR = '|'
43
  FIELD_SEPARATOR = '|'
Lines 135-141 Link Here
135
  end
137
  end
136
138
137
  def all_depends()
139
  def all_depends()
138
    build_depends | run_depends
140
    build_depends | run_depends | extract_depends | patch_depends | fetch_depends
139
  end
141
  end
140
142
141
  def self.match?(pattern, origin)
143
  def self.match?(pattern, origin)
(-)bin/portupgrade (-8 / +19 lines)
Lines 192-197 Link Here
192
  $fetch_only = false
192
  $fetch_only = false
193
  $fetch_recursive = false
193
  $fetch_recursive = false
194
  $force = false
194
  $force = false
195
  $force_all = false
195
  $keep_going = false
196
  $keep_going = false
196
  $ignore_moved = false
197
  $ignore_moved = false
197
  $interactive = false
198
  $interactive = false
Lines 244-250 Link Here
244
    opts.def_option("-a", "--all",
245
    opts.def_option("-a", "--all",
245
		    "Do with all the installed packages") { |v|
246
		    "Do with all the installed packages") { |v|
246
      $all = v
247
      $all = v
247
      $recursive = false
248
      $upward_recursive = false
248
      $upward_recursive = false
249
    }
249
    }
250
250
Lines 297-303 Link Here
297
297
298
    opts.def_option("-f", "--force",
298
    opts.def_option("-f", "--force",
299
		    "Force the upgrade of a port even if it is to be a" << NEXTLINE <<
299
		    "Force the upgrade of a port even if it is to be a" << NEXTLINE <<
300
		    "downgrade or just a reinstall, or the port is held") { |v|
300
		    "downgrade or just a reinstall, or the port is held" << NEXTLINE <<
301
		    "Specified twice, --force-all is implied") { |v|
302
      if $force
303
	$force_all = v
304
      end
305
      $force = v
306
    }
307
308
    opts.def_option("--force_all",
309
                    "Or -ff; Force upgrade or reinstall of all ports") { |v|
310
      $force_all = v
301
      $force = v
311
      $force = v
302
    }
312
    }
303
313
Lines 417-423 Link Here
417
    opts.def_option("-r", "--recursive",
427
    opts.def_option("-r", "--recursive",
418
		    "Do with all those depending on the given packages" << NEXTLINE <<
428
		    "Do with all those depending on the given packages" << NEXTLINE <<
419
		    "as well") {
429
		    "as well") {
420
      $recursive = true unless $all
430
      $recursive = true
421
    }
431
    }
422
432
423
    opts.def_option("-R", "--upward-recursive",
433
    opts.def_option("-R", "--upward-recursive",
Lines 601-607 Link Here
601
	      $pkgdb.glob(pattern, false).each do |pkgname|
611
	      $pkgdb.glob(pattern, false).each do |pkgname|
602
		first ||= pkgname
612
		first ||= pkgname
603
613
604
		list |= $pkgdb.recurse(pkgname, $recursive, false, $sanity_check)
614
		list |= $pkgdb.recurse(pkgname, $recursive && !(arg.equal? all), false, $sanity_check)
605
	      end
615
	      end
606
	    rescue => e
616
	    rescue => e
607
              raise e if e.class == PkgDB::NeedsPkgNGSupport
617
              raise e if e.class == PkgDB::NeedsPkgNGSupport
Lines 616-629 Link Here
616
	      end
626
	      end
617
	    end
627
	    end
618
628
619
	    upgrade_tasks |= list
629
	    list -= upgrade_tasks
620
630
621
	    found = true
631
	    found = true
622
632
623
	    # Check packages for updates and gather dependecies
633
	    # Check packages for updates and gather dependecies
624
	    depends = []
634
	    depends = []
625
	    not_need_upgrade = []
635
	    not_need_upgrade = []
626
	    upgrade_tasks.each do |task|
636
	    list.each do |task|
627
	      pkg = PkgInfo.new(task)
637
	      pkg = PkgInfo.new(task)
628
	      if task == first && $origin
638
	      if task == first && $origin
629
		origin = $origin
639
		origin = $origin
Lines 675-681 Link Here
675
		end
685
		end
676
		name =~ /^(.+)-([^-]+)$/
686
		name =~ /^(.+)-([^-]+)$/
677
		newversion = PkgVersion.new($2)
687
		newversion = PkgVersion.new($2)
678
		if newversion <= pkg.version && !$force
688
		if newversion <= pkg.version && !($force_all || ($force && !(arg.equal? all)))
679
		  not_need_upgrade << task
689
		  not_need_upgrade << task
680
		  next
690
		  next
681
		end
691
		end
Lines 683-689 Link Here
683
		#install_tasks |= get_notinstalled_depends(origin)
693
		#install_tasks |= get_notinstalled_depends(origin)
684
	      end
694
	      end
685
	    end
695
	    end
686
	    upgrade_tasks -= not_need_upgrade
696
	    list -= not_need_upgrade
697
	    upgrade_tasks |= list
687
698
688
	    # Check dependencies for updates
699
	    # Check dependencies for updates
689
	    depends -= ['']
700
	    depends -= ['']
(-)man/portupgrade.1 (-1 / +53 lines)
Lines 1-5 Link Here
1
.\"
1
.\"
2
.Dd October 14, 2012
2
.Dd January 7, 2013
3
.Dt PORTUPGRADE 1
3
.Dt PORTUPGRADE 1
4
.Os FreeBSD
4
.Os FreeBSD
5
.Sh NAME
5
.Sh NAME
Lines 188-193 Link Here
188
a reinstall of the same version, or the port is held by user using the
188
a reinstall of the same version, or the port is held by user using the
189
HOLD_PKGS variable in
189
HOLD_PKGS variable in
190
.Pa pkgtools.conf .
190
.Pa pkgtools.conf .
191
This option is ignored when combined with 
192
.Fl a
193
or 
194
.Ar '*'
195
as
196
.Ar pkgname_glob .
197
.Pp
198
.It Fl ff
199
.It Fl -force-all
200
Force the upgrade or reinstallation of all packages when combined with
201
.Fl a
202
or
203
.Ar '*'
204
as
205
.Ar pkgname_glob .
191
.Pp
206
.Pp
192
.It Fl F
207
.It Fl F
193
.It Fl -fetch-only
208
.It Fl -fetch-only
Lines 335-340 Link Here
335
.It Fl r
350
.It Fl r
336
.It Fl -recursive
351
.It Fl -recursive
337
Act on all those packages depending on the given packages as well.
352
Act on all those packages depending on the given packages as well.
353
This option is ignored when combined with 
354
.Fl a
355
or 
356
.Ar '*'
357
as
358
.Ar pkgname_glob .
338
.Pp
359
.Pp
339
.It Fl R
360
.It Fl R
340
.It Fl -upward-recursive
361
.It Fl -upward-recursive
Lines 648-653 Link Here
648
is the option to specify an exclusion pattern.
669
is the option to specify an exclusion pattern.
649
.Pp
670
.Pp
650
.It
671
.It
672
Rebuild and reinstall all ports that depend on
673
.Ar sdl ,
674
and upgrade all other ports in the proper order:
675
.Pp
676
.Dl portupgrade -arf sdl
677
.Pp
678
The
679
.Fl f
680
/
681
.Fl -force
682
and
683
.Fl r
684
/
685
.Fl -recursive
686
options only apply to the explicitly specified port(s) and not to
687
all of the ports implied by
688
.Fl a
689
/
690
.Fl all .
691
.Pp
692
.It
693
Rebuild and reinstall all ports:
694
.Pp
695
.Dl portupgrade -aff
696
.Pp
697
.Fl ff
698
/
699
.Fl -force-all
700
option applies to all ports.
701
.Pp
702
.It
651
Rebuild and reinstall all that ports that were installed prior to the date
703
Rebuild and reinstall all that ports that were installed prior to the date
652
2001-09-20:
704
2001-09-20:
653
.Pp
705
.Pp

Return to bug 177365