Determining what a port will install... (more than pretty-print-*) [Soln]

From: Eric Schuele (e.schuele_at_computer.org)
Date: 10/03/05

  • Next message: Eric Schuele: "Re: Determining what a port will install... (more than pretty-print-*) [Soln]"
    Date: Mon, 03 Oct 2005 11:55:28 -0500
    To: FreeBSD Questions <freebsd-questions@freebsd.org>
    
    

    Hello,

    Some time back I posted a question regarding how to determine what
    ports/packages would need to be installed on my machine when I install a
    new (new to the local machine) port.

    For example, if I do not presently have openoffice installed... what
    will get installed when I 'make install clean' it? Note that I want the
    differences between what is needed to build/run the port and what is
    already present on the machine.

    At the time no one responded with a clear way to do this... so I finally
    had a few minutes to write a script to do it for me. I thought someone
    else might find it useful... So I'm posting it here for comments and
    thoughts (be gentle, I'm new to awk).

    I find it useful, especially for laptops... which may have a small HDD
    and little memory. I generally try to install the minimum necessary to
    do my work.

    #! /bin/sh

    # Script to determine the differences between what is necessary for
    # a port, and what is already present on the local machine.

    make pretty-print-build-depends-list | \
      awk '{
             count = 0
             pkgs = ""
             for(i=5; i<=NF-2; i++) {
              pkg = $i
            
              if (index(pkg, "\"") == 1)
                {pkg = substr(pkg, 2, length(pkg)-1)}
              if (index(pkg, "\"") > 1)
                 {pkg = substr(pkg, 1, length(pkg)-1)}
                    
               if ( system("pkg_info -e " pkg) == 1) {
                 pkgs = pkgs " " pkg
                 count++
               }
             }

             if ( count ) {
               print "You need the following (build) perequisites:"
               print pkgs
             }
             else {
               print "All (build) prerequisites are present."
             }

           }'

    make pretty-print-run-depends-list | \
      awk '{
             count = 0
             pkgs = ""
             for(i=5; i<=NF-2; i++) {
              pkg = $i
            
              if (index(pkg, "\"") == 1)
                {pkg = substr(pkg, 2, length(pkg)-1)}
              if (index(pkg, "\"") > 1)
                 {pkg = substr(pkg, 1, length(pkg)-1)}
                    
               if ( system("pkg_info -e " pkg) == 1) {
                 pkgs = pkgs " " pkg
                 count++
               }
             }

             if ( count ) {
               print "You need the following (run) perequisites:"
               print pkgs
             }
             else {
               print "All (run) prerequisites are present."
             }

           }'

    -- 
    Regards,
    Eric
    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
    

  • Next message: Eric Schuele: "Re: Determining what a port will install... (more than pretty-print-*) [Soln]"

    Relevant Pages

    • Re: a script to add a new printer
      ... You install first the port and the driver, ... >> with the MS Windows 2003 Server Resource Kit from a script. ...
      (microsoft.public.scripting.wsh)
    • Is FreeBSD ready for desktop (Mozilla Flash)
      ... monitor,, somehow the install fails to detect ... "Macromedia Flash plugin is not available for FreeBSD. ... I quote again "Install the www/linuxpluginwrapper port. ... servers, ...
      (comp.unix.bsd.freebsd.misc)
    • New software uploaded by Denise on Oct 23 07:10:00 -4 2006
      ... and starting compiling the 'bar' port. ... and now where should you install your terminators? ... filter option may run a filter on the wrong type of file and cause ... FreeBSD does not currently support IBM's microchannel bus. ...
      (Linux-Kernel)
    • Re: KMDF Fakemodem not working
      ... I'm using the `Windows Vista and Windows Server Longhorn x86 Checked Build ... install the fakemodem with devcon: ... INf in the sample should tell you how to use devcon to install the driver. ... Why do I need to choose a COM port? ...
      (microsoft.public.development.device.drivers)
    • Re: Trend CSM 3 config problems
      ... Or, use the autopcc method, either by adding the line to the login script, or by browsing to the autopcc file manually from a client machine. ... When I click the link and Internet Explorer opens up, I get the same port 4343 error message on the client as well. ... there's a 'click here' to install. ...
      (microsoft.public.windows.server.sbs)