Bug #8921

Provider portupgrade don't work with 'P' option when install port

Added by Kiril Varnakov 10 months ago. Updated 7 days ago.

Status:Needs More Information Start date:08/10/2011
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:provider
Target version:2.7.x
Affected Puppet version:2.6.7 Branch:
Keywords:
Votes: 1

Description

Hi. I don’t understand, why options -P not intagrated to puppet, but if i add it to portupgrade.rb manualy, it does not work.


--- portupgrade.rb      2011-08-11 11:02:55.000000000 +0400
+++ portupgrade.rb.patch        2011-08-11 10:48:32.000000000 +0400
@@ -84,7 +84,7 @@
     def install
       Puppet.debug "portupgrade.install() - Installation call on #{@resource[:name]}"
       # -M: yes, we're a batch, so don't ask any questions
-       cmdline = ["-P -M BATCH=yes", @resource[:name]]
+       cmdline = ["-M BATCH=yes", @resource[:name]]

     #         FIXME: it's possible that portinstall prompts for data so locks up.
     begin

On puppet agent:


debug: Puppet::Type::Package::ProviderPortupgrade: Executing '/usr/local/sbin/portinstall -P -M BATCH=yes security/sudo'
err: /Stage[main]/Sudo/Package[security/sudo]/ensure: change from absent to present failed:

History

Updated by Nan Liu 10 months ago

  • Status changed from Unreviewed to Needs More Information

Are you installing local packages from PKG_PATH or a remote location? Can you explain why you expect -P do be the default option for bsd? I’m assuming to avoid compilation.

Can you provide a bit more info on the platform you are running puppet? and are you able to execute the command non-interactively? Would the -P option ever prompt for anything interactively? Maybe a sample output? /usr/local/sbin/portinstall -P -M BATCH=yes security/sudo

Updated by Kiril Varnakov 10 months ago

FreeBSD 8.2-RELEASE-p1 – i386. I installed packages from local mashine and have already compilation packages.

Manualy write:

test002# /usr/local/sbin/portinstall -P -M BATCH=yes security/sudo
[Updating the pkgdb  in /var/db/pkg ... - 53 packages found (-1 +0) (...) done]
[Gathering depends for security/sudo ..... done]
--->  Checking for the latest package of 'security/sudo'
--->  Found a package of 'security/sudo': /home/.FreeBSD/packages/All/sudo-1.8.1_5.tbz (sudo-1.8.1_5)
--->  Installing 'sudo-1.8.1_5' from a package
--->  Installing the new version via the package
[Updating the pkgdb  in /var/db/pkg ... - 54 packages found (-0 +1) . done]

I tried to register in pkgtools.conf:

PORTUPGRADE_ARGS = ENV ['PORTUPGRADE'] + '-P'

but this is the same as the patch.

My pkgtools.conf also have:

  ENV['PORTSDIR'] ||= '/usr/ports'
  ENV['PACKAGES'] ||= '/home/.FreeBSD/packages'
  ENV['PKG_PATH'] ||= '/home/.FreeBSD/packages/All'
  ENV['PKG_BACKUP_DIR'] ||= ENV['PKG_PATH']
  ENV['PKG_FETCH'] = 'false'

Updated by Kiril Varnakov 9 months ago

Maybe puppet delete my environment, which i set in pkgtools.conf?

Updated by Piotr Florczyk 6 months ago

I had the same problem. Just change:

cmdline = ["-M BATCH=yes", @resource[:name]]

to:

cmdline = ["-M BATCH=yes", "-P", @resource[:name]]

and for binary only packages:

cmdline = ["--batch", "-PP", @resource[:name]]

Sample output:

debug: Puppet::Type::Package::ProviderPortupgrade: Executing '/usr/local/sbin/portinstall --batch -PP security/sudo'
notice: /Stage[main]/Sudo/Package[security/sudo]/ensure: created

Works fine for me :)

Updated by Michael Stahnke 4 months ago

  • Target version changed from 2.6.x to 2.7.x

2.6.x is closed. Moving to 2.7.x

Updated by Kiril Varnakov 7 days ago

Yes, if “-P”, “-M BATCH=yes” – work!!! But not “-P -M BATCH=yes”.

Also available in: Atom PDF