Merge from vendor branch GDB:
[dragonfly.git] / tools / tools / portsinfo / portsinfo.sh
1 #!/bin/sh
2 # Copyright (c) April 1997 Wolfram Schneider <wosch@FreeBSD.org>, Berlin.
3 #
4 # portsinfo - Generate list of new ports for last two weeks.
5 #
6 # $FreeBSD: src/tools/tools/portsinfo/portsinfo.sh,v 1.5 1999/08/28 00:54:32 peter Exp $
7 # $DragonFly: src/tools/tools/portsinfo/Attic/portsinfo.sh,v 1.2 2003/06/17 04:29:11 dillon Exp $
8
9 PATH=/bin:/usr/bin:/usr/local/bin:$PATH; export PATH
10
11 host=http://www.freebsd.org
12 url=$host/cgi/ports.cgi
13 time='?type=new&time=2+week+ago&sektion=all'
14 time2='?type=changed&time=2+week+ago&sektion=all'
15 info=yes
16
17 if [ x"$info" = xyes ]; then
18
19 cat <<'EOF'
20 Introduction
21 ------------
22
23 The FreeBSD Ports Collection offers a simple way for users and
24 administrators to install applications. Each "port" listed here
25 contains any patches necessary to make the original application source
26 code compile and run on FreeBSD. Installing an application is as
27 simple as downloading the port, unpacking it and typing make in the
28 port directory. The Makefile automatically fetches the application
29 source code, either from a local disk or via ftp, unpacks it on your
30 system, applies the patches, and compiles. If all goes well, simply
31 type make install to install the application.
32
33 For more information about using ports, see the ports collection
34
35         http://www.freebsd.org/handbook/ports.html
36 and
37         http://www.freebsd.org/ports/
38
39 EOF
40
41     lynx -dump $host/ports/ |
42         perl -ne '/^[ ]*There are currently/ && s/^\s+// && print && exit'
43
44 cat <<EOF
45
46
47 New ports added last two weeks
48 ------------------------------
49
50 EOF
51
52
53 fi
54
55
56 lynx -nolist -dump -reload -nostatus "$url$time" | 
57     grep -v "Description :" |
58 perl -ne 'print if (/^\s*Category/ .. /__________________/)' |
59     grep -v ________ | 
60 perl -ne 'if (/^\s*Category/) { 
61                 print; for(1..50) {print "="}; print "\n";
62           } else { print}'
63
64 cat <<EOF
65
66
67 Updated ports last two weeks
68 -----------------------------------
69
70 EOF
71
72 lynx -nolist -dump -reload -nostatus "$url$time2" |
73     grep -v "Description :" |
74 perl -ne 's/\[INLINE\]\s*//g; print if (/Category/ .. /XXXXYYYYZZZZ/)' |      
75 perl -ne 'if (/^\s*Category/) {
76                 print; for(1..50) {print "="}; print "\n";
77           } else { print}'
78
79 cat <<EOF
80
81 This information was produced by
82         $url
83
84 EOF
85