DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th September 2013
jb_daefo jb_daefo is offline
Package Pilot
 
Join Date: May 2008
Posts: 197
Thanked 5 Times in 5 Posts
Wink /pkg/ question, also a *very* useful one-liner

Code:
#/# find /var/db/pkg -type d -name "p5*" | xargs -J % find -type f -name "+CONTENTS" -exec grep -H "5.12" {} \; | grep pm | head -40 | gtr -s \/ "\n" | grep p5 | sort | uniq | xargs -J % portmaster -d -B -P -i -g % && yell || yell
That code, incrementing the '-40' each time, made for the easiest upgrade of most of the ports depending upon perl (after updating perl itself) than any other perl upgrade I recall doing. I'm very concerned that its /pkg/ equivalent might not work the same or as well... If anyone using /pkg/ can report back an equivalent CLI and as to whether it works as easily, it would be appreciated. [As an aside, persons may wish to install 'gtr' (coreutils) to implement the long command fully...]
__________________
using /LOOKAT/ with /var/db/pkg files and portmaster/aliases/pipes/find/grep to meteorically speedup port upgrades/installs...
Reply With Quote
  #2   (View Single Post)  
Old 22nd September 2013
DaBSD DaBSD is offline
Fdisk Soldier
 
Join Date: Jan 2013
Posts: 46
Thanked 0 Times in 0 Posts
Default

A good one for this website: http://www.commandlinefu.com/
Reply With Quote
  #3   (View Single Post)  
Old 20th October 2013
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,080
Thanked 198 Times in 156 Posts
Default

The first bit can be simplified to grep -H '5\.12' /var/db/pkg/p5-*/+CONTENTS

sort | uniq is the same as sort -u
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.

Last edited by Carpetsmoker; 21st October 2013 at 01:03 PM.
Reply With Quote
  #4   (View Single Post)  
Old 21st October 2013
jb_daefo jb_daefo is offline
Package Pilot
 
Join Date: May 2008
Posts: 197
Thanked 5 Times in 5 Posts
Default

Not to change the topic too much, but this post is similar.

I wanted a way to check if the ports that weren't building here, yet, were packages upstream. Yesterday I found an older perl script onhand that I used just a part of. Still very beta in the first usage (below) vs the second.
I'm still a very novice perl programmer, working from others' scripts mostly.

Code:
#!/usr/local/bin/perl --q

# usage: cat pkg_version.log  | grep -v zsh |grep -v (succ , fail, nvi, ) | xargs -J % % perl pl_pp.pl %
# ... sort of buggy. Halts often

# 2nd usage: perl pl_pp.pl www/libxul www/firefox devel/boost-libs  



use strict;
use warnings;
use diagnostics;
Main( @ARGV );
exit( 0 );
sub Main {
	for my $bsdport ( @_ ) {
		system(" portmaster -PP  $bsdport " ) or die $!;
	   #	Fudge ( $dir, glob '*' );
	}
}
sub Fudge {
# some code I removed from the upstream code from perlmonks.org 
}
__________________
using /LOOKAT/ with /var/db/pkg files and portmaster/aliases/pipes/find/grep to meteorically speedup port upgrades/installs...
Reply With Quote
Reply

Tags
one-liner, perl, pkg

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PF question bug0r OpenBSD Security 7 23rd November 2009 03:54 PM
external drive partition question + fdisk question gosha OpenBSD General 15 15th June 2009 02:00 PM
DR-DOS question RJPugh Other OS 4 31st May 2009 11:10 AM
Question about Mac OS X SLA nfries88 Other BSD and UNIX/UNIX-like 9 1st January 2009 09:05 PM
Question about DNS. bigb89 FreeBSD General 10 22nd May 2008 06:08 AM


All times are GMT. The time now is 10:30 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick