View | Details | Raw Unified | Return to bug 126277
Collapse All | Expand All

(-)/usr/home/akosela/downloads/bpkg-2.0.3/Makefile (-3 / +2 lines)
Lines 2-15 Link Here
2
# Date created:				24 June 2007
2
# Date created:				24 June 2007
3
# Whom:					Andy Kosela <akosela@andykosela.com>
3
# Whom:					Andy Kosela <akosela@andykosela.com>
4
#
4
#
5
# $FreeBSD: ports/ports-mgmt/bpkg/Makefile,v 1.18 2008/07/27 19:19:22 beech Exp $
5
# $FreeBSD$
6
#
6
#
7
# This port is self contained in the files directory.
7
# This port is self contained in the files directory.
8
#
8
#
9
9
10
PORTNAME=	bpkg
10
PORTNAME=	bpkg
11
PORTVERSION=	2.0.2
11
PORTVERSION=	2.0.3
12
PORTREVISION=	1
13
CATEGORIES=	ports-mgmt
12
CATEGORIES=	ports-mgmt
14
MASTER_SITES=	# none
13
MASTER_SITES=	# none
15
DISTFILES=	# none
14
DISTFILES=	# none
(-)/usr/home/akosela/downloads/bpkg-2.0.3/files/bpkg.8 (-21 / +25 lines)
Lines 23-29 Link Here
23
.\" SUCH DAMAGE.
23
.\" SUCH DAMAGE.
24
.\"
24
.\"
25
.\"
25
.\"
26
.Dd July 19, 2008
26
.Dd August 5, 2008
27
.Dt BPKG 8
27
.Dt BPKG 8
28
.Os
28
.Os
29
.Sh NAME
29
.Sh NAME
Lines 31-40 Link Here
31
.Nd a simple tool for displaying information about ports.
31
.Nd a simple tool for displaying information about ports.
32
.Sh SYNOPSIS
32
.Sh SYNOPSIS
33
.Nm
33
.Nm
34
.Op Fl bdeEfgiIjkLmMoOpqQrsSwz
34
.Op Fl bDdeFfgIijkLMmOopQqrSswz
35
.Ar pkg-name ...
35
.Ar pkg-name ...
36
.Nm
36
.Nm
37
.Op Fl cChltvZ
37
.Op Fl CchltvZ
38
.Pp
38
.Pp
39
.Sh DESCRIPTION
39
.Sh DESCRIPTION
40
.Nm
40
.Nm
Lines 46-60 Link Here
46
.Bl -tag -width F1
46
.Bl -tag -width F1
47
.It Fl b
47
.It Fl b
48
create backup package in /var/tmp/bpkg/ from a locally installed port.
48
create backup package in /var/tmp/bpkg/ from a locally installed port.
49
.It Fl c
50
clean all distfiles in /usr/ports/distfiles/* [no arguments]
51
.It Fl C
49
.It Fl C
52
clean all distfiles in /usr/ports/distfiles/* and also all working directories 
50
clean all distfiles in /usr/ports/distfiles/* and also all work directories
53
of the ports tree /usr/ports/*/*/work/ [no arguments]
51
of the ports tree /usr/ports/*/*/work/ [no arguments]
52
.It Fl c
53
clean all distfiles in /usr/ports/distfiles/* [no arguments]
54
.It Fl D
55
display size of port's source files.
54
.It Fl d
56
.It Fl d
55
display description of the port.
57
display description of the port.
56
.It Fl e
58
.It Fl e
57
configure options for the specified port using dialog(1).
59
configure OPTIONS for the specified port.
60
.It Fl F
61
browse www.freshports.org port's entry. [text WWW browser required]
58
.It Fl f
62
.It Fl f
59
show the packing list instructions for the port.
63
show the packing list instructions for the port.
60
.It Fl g
64
.It Fl g
Lines 70-109 Link Here
70
search the ports tree according to ports' descriptions.
74
search the ports tree according to ports' descriptions.
71
.It Fl k
75
.It Fl k
72
show the deinstall script (if any) for the installed port.
76
show the deinstall script (if any) for the installed port.
73
.It Fl l
74
display short info about all installed ports. [no arguments]
75
.It Fl L
77
.It Fl L
76
show the files within the installed port.
78
show the files within the installed port.
77
.It Fl m
79
.It Fl l
78
display port's Makefile.
80
display short info about all installed ports. [no arguments]
79
.It Fl M
81
.It Fl M
80
show the install-message file for the installed port.
82
show the install-message file for the installed port.
81
.It Fl o
83
.It Fl m
82
display config options for the specified port.
84
display port's Makefile.
83
.It Fl O
85
.It Fl O
84
remove config options for the specified port.
86
remove config OPTIONS for the specified port.
87
.It Fl o
88
display config OPTIONS for the specified port.
85
.It Fl p
89
.It Fl p
86
search the ports tree and display short info about the port.
90
search the ports tree and display short info about the port.
87
.It Fl q
88
show the latest available package in the FreeBSD repository. [-RELEASE]
89
.It Fl Q
91
.It Fl Q
90
show the latest available package in the FreeBSD repository. [-STABLE]
92
display the latest available package in the FreeBSD repository. [-STABLE]
93
.It Fl q
94
display the latest available package in the FreeBSD repository. [-RELEASE]
91
.It Fl r
95
.It Fl r
92
show the list of all port's dependencies.
96
show the list of all port's dependencies.
93
.It Fl s
94
show the total size occupied by files installed within the port.
95
.It Fl S
97
.It Fl S
96
search the ports tree and display info about the port.
98
search the ports tree and display info about the port.
99
.It Fl s
100
show the total size occupied by files installed within the port.
97
.It Fl t
101
.It Fl t
98
list all installed ports with dates of their installation. [no arguments]
102
list all installed ports with dates of their installation. [no arguments]
99
.It Fl w
103
.It Fl w
100
which installed port owns the specified file.
104
which installed port owns the specified file.
101
.It Fl v
105
.It Fl v
102
list all installed ports and possible updates. [no arguments]
106
list all installed ports and possible updates. [no arguments]
103
.It Fl z
104
display dynamic object dependencies for the specified port.
105
.It Fl Z
107
.It Fl Z
106
display all missing dynamic object dependencies. [no arguments] 
108
display all missing dynamic object dependencies. [no arguments] 
109
.It Fl z
110
display dynamic object dependencies for the specified port.
107
.El
111
.El
108
.Sh EXIT STATUS
112
.Sh EXIT STATUS
109
.Ex -std
113
.Ex -std
(-)/usr/home/akosela/downloads/bpkg-2.0.3/files/bpkg.sh.in (-20 / +105 lines)
Lines 309-321 Link Here
309
pkg_makefile()
309
pkg_makefile()
310
{
310
{
311
	path=`cd /usr/ports && make search path=/$pkg$ | grep -w Path | \
311
	path=`cd /usr/ports && make search path=/$pkg$ | grep -w Path | \
312
	    cut -d/ -f4,5`
312
	    sed -n 1p | cut -d/ -f4,5`
313
	[ -z "$path" ] && echo "bpkg: can't find the port in /usr/ports/"
313
	[ -z "$path" ] && echo "bpkg: can't find the port in /usr/ports/"
314
314
315
	less /usr/ports/$path/Makefile 2>/dev/null
315
	less /usr/ports/$path/Makefile 2>/dev/null
316
	exit 0
316
	exit 0
317
}
317
}
318
318
319
pkg_distinfo()
320
{
321
	path=`cd /usr/ports && make search path=/$pkg$ | grep -w Path | \
322
	    sed -n 1p | cut -d/ -f4,5`
323
	[ -z "$path" ] && echo "bpkg: can't find the port in /usr/ports/"
324
325
	for e in `cat /usr/ports/$path/distinfo 2>/dev/null | grep SIZE | \
326
	    cut -d'=' -f2`; do
327
		echo "`cat /usr/ports/$path/distinfo | grep $e | \
328
		    sed 's/SIZE// ; s/(// ; s/)//' | \
329
			cut -d' ' -f2` `convert $e`"
330
	done
331
	exit 0
332
}
333
319
make_search()
334
make_search()
320
{
335
{
321
	for e in $pkg; do
336
	for e in $pkg; do
Lines 365-373 Link Here
365
	for e in $pkg; do
380
	for e in $pkg; do
366
		echo "ls $e*" >> /tmp/bpkg.tmp
381
		echo "ls $e*" >> /tmp/bpkg.tmp
367
	done
382
	done
368
	echo "ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys/Latest/"
383
	cat /tmp/bpkg.tmp | sed s/[0-9][0-9].*/*/ > /tmp/bpkg1.tmp
369
	ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys/Latest/ < /tmp/bpkg.tmp
384
370
	rm /tmp/bpkg.tmp
385
	echo "ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/Latest/"
386
	ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys/Latest/ < /tmp/bpkg1.tmp > /tmp/bpkg2.tmp
387
	ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys/All/ < /tmp/bpkg1.tmp > /tmp/bpkg3.tmp
388
389
	n=1
390
	for e in `cat /tmp/bpkg2.tmp | awk '{print $9}' | cut -d. -f1`; do
391
		size_pkg=`cat /tmp/bpkg2.tmp | sed '/^[A-Z]/d' | \
392
		    sed -n ${n}p | awk '{print $11}' | cut -d/ -f3`
393
		size=`cat /tmp/bpkg3.tmp | grep $size_pkg | awk '{print $5}'`
394
		mtime=`cat /tmp/bpkg3.tmp | grep $size_pkg | \
395
		    awk '{print $6, $7, $8}'` 
396
		echo "$e -> $size_pkg `convert $size` [$mtime]"
397
		n=`expr $n + 1`
398
	done
399
	rm /tmp/bpkg*.tmp
371
	exit 0
400
	exit 0
372
}
401
}
373
402
Lines 378-386 Link Here
378
	for e in $pkg; do
407
	for e in $pkg; do
379
		echo "ls $e*" >> /tmp/bpkg.tmp
408
		echo "ls $e*" >> /tmp/bpkg.tmp
380
	done
409
	done
410
	cat /tmp/bpkg.tmp | sed s/[0-9][0-9].*/*/ > /tmp/bpkg1.tmp
411
381
	echo "ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/Latest/"
412
	echo "ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/Latest/"
382
	ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/Latest/ < /tmp/bpkg.tmp
413
	ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/Latest/ < /tmp/bpkg1.tmp > /tmp/bpkg2.tmp
383
	rm /tmp/bpkg.tmp
414
	ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/All/ < /tmp/bpkg1.tmp > /tmp/bpkg3.tmp
415
416
	n=1
417
	for e in `cat /tmp/bpkg2.tmp | awk '{print $9}' | cut -d. -f1`; do
418
		size_pkg=`cat /tmp/bpkg2.tmp | sed '/^[A-Z]/d' | \
419
		    sed -n ${n}p | awk '{print $11}' | cut -d/ -f3`
420
		size=`cat /tmp/bpkg3.tmp | grep $size_pkg | awk '{print $5}'`
421
		mtime=`cat /tmp/bpkg3.tmp | grep $size_pkg | \
422
		    awk '{print $6, $7, $8}'` 
423
		echo "$e -> $size_pkg `convert $size` [$mtime]"
424
		n=`expr $n + 1`
425
	done
426
	rm /tmp/bpkg*.tmp
384
	exit 0
427
	exit 0
385
}
428
}
386
429
Lines 569-574 Link Here
569
	exit 0
612
	exit 0
570
}
613
}
571
614
615
pkg_freshports()
616
{
617
	browser=`ls /usr/local/bin/w3m 2>/dev/null || \
618
	    ls /usr/local/bin/lynx 2>/dev/null || \
619
		ls /usr/local/bin/links 2>/dev/null`
620
	if [ -z "$browser" ]; then
621
		echo "bpkg: text WWW browser required"
622
	else
623
		echo "Loading..."
624
		path=`cd /usr/ports && make search path=/$pkg | grep -w Path | \
625
		    sed -n 1p | cut -d/ -f4,5`
626
		$browser http://www.freshports.org/$path
627
	fi
628
	exit 0
629
}
630
572
make_ldd()
631
make_ldd()
573
{
632
{
574
	for e in $pkg; do
633
	for e in $pkg; do
Lines 801-812 Link Here
801
	exit 0
860
	exit 0
802
}
861
}
803
862
863
convert()
864
{
865
	kilo=$(echo "scale=1; $1/1024" | bc )
866
	kiloint=$(echo "$1/1024" | bc )
867
868
	mega=$(echo "scale=1; $kilo/1024" | bc )
869
	megaint=$(echo "$kilo/1024" | bc )
870
871
	giga=$(echo "scale=1; $mega/1024" | bc )
872
	gigaint=$(echo "$mega/1024" | bc )
873
874
	if [ $kiloint -lt 1 ]; then
875
		echo "$1 bytes"
876
	elif [ $megaint -lt 1 ]; then
877
		echo "${kilo}K"
878
	elif [ $gigaint -lt 1 ]; then
879
		echo "${mega}M"
880
	else
881
		echo "${giga}G"
882
	fi
883
}
884
804
help()
885
help()
805
{
886
{
806
	echo "bpkg version `pkg_info -xI bpkg | cut -d- -f2 | cut -d' ' -f1`" 
887
	echo "bpkg version `pkg_info -xI bpkg | cut -d- -f2 | cut -d' ' -f1`" 
807
	echo ""
888
	echo ""
808
	echo "Usage: bpkg [-bdefgiIjkLmMoOpqQrsSwz] pkg-name ..."
889
	echo "Usage: bpkg [-bDdeFfgIijkLMmOopQqrSswz] pkg-name ..."
809
	echo "       bpkg [-cChltvZ]"
890
	echo "       bpkg [-CchltvZ]"
810
	echo ""
891
	echo ""
811
	echo "Please see the bpkg(8) man page for more information"
892
	echo "Please see the bpkg(8) man page for more information"
812
	echo ""
893
	echo ""
Lines 816-869 Link Here
816
# End of functions
897
# End of functions
817
###############################################################################
898
###############################################################################
818
899
819
while getopts b:d:e:f:g:i:I:j:k:L:m:M:o:O:p:q:Q:r:s:S:w:z:cChltvZ opts; do
900
while getopts b:D:d:e:F:f:g:I:i:j:k:L:M:m:O:o:p:Q:q:r:S:s:w:z:CchltvZ opts; do
820
	case $opts in
901
	case $opts in
821
		b) pkg=$OPTARG
902
		b) pkg=$OPTARG
822
		   pkg_backup;;
903
		   pkg_backup;;
904
		D) pkg=$OPTARG
905
		   pkg_distinfo;;
823
		d) pkg=$OPTARG
906
		d) pkg=$OPTARG
824
		   pkg_info-x;;
907
		   pkg_info-x;;
825
		e) pkg=$OPTARG
908
		e) pkg=$OPTARG
826
		   make_config;;
909
		   make_config;;
910
		F) pkg=$OPTARG
911
		   pkg_freshports;;
827
		f) pkg=$OPTARG
912
		f) pkg=$OPTARG
828
		   pkg_info-xf;;
913
		   pkg_info-xf;;
829
		g) pkg=$OPTARG
914
		g) pkg=$OPTARG
830
		   pkg_info-xg;;
915
		   pkg_info-xg;;
831
		i) pkg=$OPTARG
832
		   make_search;;
833
		I) pkg=$OPTARG
916
		I) pkg=$OPTARG
834
		   pkg_info-xI;;
917
		   pkg_info-xI;;
918
		i) pkg=$OPTARG
919
		   make_search;;
835
		j) pkg=$OPTARG
920
		j) pkg=$OPTARG
836
		   make_search_info;;
921
		   make_search_info;;
837
		k) pkg=$OPTARG
922
		k) pkg=$OPTARG
838
		   pkg_info-xk;;
923
		   pkg_info-xk;;
839
		L) pkg=$OPTARG
924
		L) pkg=$OPTARG
840
		   pkg_info-xL;;
925
		   pkg_info-xL;;
841
		m) pkg=$OPTARG
842
		   pkg_makefile;;
843
		M) pkg=$OPTARG
926
		M) pkg=$OPTARG
844
		   pkg_info-xD;;
927
		   pkg_info-xD;;
845
		o) pkg=$OPTARG
928
		m) pkg=$OPTARG
846
		   make_showc;;
929
		   pkg_makefile;;
847
		O) pkg=$OPTARG
930
		O) pkg=$OPTARG
848
		   make_rmc;;
931
		   make_rmc;;
932
		o) pkg=$OPTARG
933
		   make_showc;;
849
		p) pkg=$OPTARG
934
		p) pkg=$OPTARG
850
		   pkg_path;;
935
		   pkg_path;;
851
		q) pkg=$OPTARG
852
		   pkg_ftp;;
853
		Q) pkg=$OPTARG
936
		Q) pkg=$OPTARG
854
		   pkg_latestftp;;
937
		   pkg_latestftp;;
938
		q) pkg=$OPTARG
939
		   pkg_ftp;;
855
		r) pkg=$OPTARG
940
		r) pkg=$OPTARG
856
		   pkg_info-xr;;
941
		   pkg_info-xr;;
857
		s) pkg=$OPTARG
858
		   pkg_info-xs;;
859
		S) pkg=$OPTARG
942
		S) pkg=$OPTARG
860
		   make_search_S;;
943
		   make_search_S;;
944
		s) pkg=$OPTARG
945
		   pkg_info-xs;;
861
		w) pkg=$OPTARG
946
		w) pkg=$OPTARG
862
		   pkg_which-;;
947
		   pkg_which-;;
863
		z) pkg=$OPTARG
948
		z) pkg=$OPTARG
864
		   make_ldd;;
949
		   make_ldd;;
865
		c) pkg_clean;;
866
		C) pkg_clean2;;
950
		C) pkg_clean2;;
951
		c) pkg_clean;;
867
		h) help;;
952
		h) help;;
868
		l) pkg_inf;;
953
		l) pkg_inf;;
869
		t) pkg_time;;
954
		t) pkg_time;;

Return to bug 126277