Re: Determining the date a given port was installed

2015-01-08 Thread Adam Mercer
On Wed, Jan 7, 2015 at 11:42 PM, Ryan Schmidt ryandes...@macports.org wrote:

 And the port location command can help you with that. So you could use:

 $ ls -l $(port -q location zlib)
 -rw-r--r--  1 root  wheel  211184 Sep 21 03:27 
 /opt/local/var/macports/software/zlib/zlib-1.2.8_0+universal.darwin_14.i386-x86_64.tbz2

 Or even:

 $ ls -lT $(port -q location zlib) | awk '{print $6 $7 $8 $9}'
 Sep 21 03:27:38 2014

Thanks, that's perfect!

Cheers

Adam
___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users


Re: Determining the date a given port was installed

2015-01-08 Thread Clemens Lang
Hi,

- On 8 Jan, 2015, at 18:32, Adam Mercer ramer...@gmail.com wrote:

 $ ls -lT $(port -q location zlib) | awk '{print $6 $7 $8 $9}'
 Sep 21 03:27:38 2014

I agree, that's a lot simpler. But why rely on the output formatting of ls
and use awk to parse it? Why not just

 $ stat -t '%Y-%m-%d %H:%M' -f '%Sc' $(port -q location zlib)

which allows you to change the output formatting and doesn't print anything
but the requested time?

-- 
Clemens Lang
___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users


Re: Determining the date a given port was installed

2015-01-08 Thread Dave Horsfall
On Thu, 8 Jan 2015, Clemens Lang wrote:

  $ stat -t '%Y-%m-%d %H:%M' -f '%Sc' $(port -q location zlib)
 
 which allows you to change the output formatting and doesn't print 
 anything but the requested time?

I think the key here is port -q location ..., something I never knew 
existed until now.

``This new learning amazes me, Sir Bedevere.  Explain again how sheeps
  bladders may be employed in the prevention of earthquakes.''

-- 
Dave Horsfall DTM (VK2KFU)  Bliss is a MacBook with a FreeBSD server.
http://www.horsfall.org/spam.html (and check the home page whilst you're there)
___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users


Re: Determining the date a given port was installed

2015-01-08 Thread Ryan Schmidt

On Jan 8, 2015, at 11:41 AM, Clemens Lang wrote:

 $ ls -lT $(port -q location zlib) | awk '{print $6 $7 $8 $9}'
 Sep 21 03:27:38 2014
 
 I agree, that's a lot simpler. But why rely on the output formatting of ls
 and use awk to parse it? Why not just
 
 $ stat -t '%Y-%m-%d %H:%M' -f '%Sc' $(port -q location zlib)
 
 which allows you to change the output formatting and doesn't print anything
 but the requested time?

I wasn't aware of the stat command. Good to know!

___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users


Re: Determining the date a given port was installed

2015-01-08 Thread Clemens Lang
On January 8, 2015 6:54:02 PM CET, Dave Horsfall d...@horsfall.org wrote:
I think the key here is port -q location ..., something I never knew 
existed until now.

Agreed. I've started documenting it in a couple of places for the all-new man 
pages in 2.4: 
https://trac.macports.org/browser/trunk/base/doc/port-platform.1.txt?marks=30-31
-- 
Clemens Lang
___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users


Re: Determining the date a given port was installed

2015-01-07 Thread Ryan Schmidt
On Jan 7, 2015, at 4:50 PM, Adam Mercer wrote:
 
 On Wed, Jan 7, 2015 at 1:20 PM, René J.V. wrote:
 
 You could also look at the files in ${prefix}/var/macports/software/${name}
 
 That seems to be the most straightforward approach, thanks.

And the port location command can help you with that. So you could use:

$ ls -l $(port -q location zlib)
-rw-r--r--  1 root  wheel  211184 Sep 21 03:27 
/opt/local/var/macports/software/zlib/zlib-1.2.8_0+universal.darwin_14.i386-x86_64.tbz2

Or even:

$ ls -lT $(port -q location zlib) | awk '{print $6 $7 $8 $9}'
Sep 21 03:27:38 2014

___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users


Re: Determining the date a given port was installed

2015-01-07 Thread Adam Mercer
On Wed, Jan 7, 2015 at 1:20 PM, René J.V. rjvber...@gmail.com wrote:

 You could also look at the files in ${prefix}/var/macports/software/${name}

That seems to be the most straightforward approach, thanks.

Cheers

Adam
___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users


Re: Determining the date a given port was installed

2015-01-07 Thread Clemens Lang
Hi,

- On 7 Jan, 2015, at 19:26, Adam Mercer r...@macports.org wrote:

 Is there a way to determine the date that a given port was installed?
 So far I've just been looking at the date of files provided by the
 port but I'm wondering if there is a better way to determine this?

There is:

echo $'.load $mp_src/src/cregistry/macports.sqlext\nSELECT name, date FROM 
ports WHERE name LIKE $port;' | sqlite3 
$prefix/var/macports/registry/registry.db

Replace variables as necessary.

-- 
Clemens Lang
___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users


Re: Determining the date a given port was installed

2015-01-07 Thread René J . V . Bertin
On Wednesday January 07 2015 12:26:20 Adam Mercer wrote:

 Is there a way to determine the date that a given port was installed?
 So far I've just been looking at the date of files provided by the
 port but I'm wondering if there is a better way to determine this?

You could also look at the files in ${prefix}/var/macports/software/${name}

R.
___
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users