| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | #!/bin/sh | | 1 | #!/bin/sh |
2 | | | 2 | |
3 | # $NetBSD: pkg_rolling-replace.sh,v 1.15 2007/12/02 02:11:05 tnn Exp $ | | 3 | # $NetBSD: pkg_rolling-replace.sh,v 1.16 2008/01/11 13:29:37 gdt Exp $ |
4 | #<license> | | 4 | #<license> |
5 | # Copyright (c) 2006 BBN Technologies Corp. All rights reserved. | | 5 | # Copyright (c) 2006 BBN Technologies Corp. All rights reserved. |
6 | # | | 6 | # |
7 | # Redistribution and use in source and binary forms, with or without | | 7 | # Redistribution and use in source and binary forms, with or without |
8 | # modification, are permitted provided that the following conditions | | 8 | # modification, are permitted provided that the following conditions |
9 | # are met: | | 9 | # are met: |
10 | # 1. Redistributions of source code must retain the above copyright | | 10 | # 1. Redistributions of source code must retain the above copyright |
11 | # notice, this list of conditions and the following disclaimer. | | 11 | # notice, this list of conditions and the following disclaimer. |
12 | # 2. Redistributions in binary form must reproduce the above copyright | | 12 | # 2. Redistributions in binary form must reproduce the above copyright |
13 | # notice, this list of conditions and the following disclaimer in the | | 13 | # notice, this list of conditions and the following disclaimer in the |
14 | # documentation and/or other materials provided with the distribution. | | 14 | # documentation and/or other materials provided with the distribution. |
15 | # 3. Neither the name of BBN Technologies nor the names of its contributors | | 15 | # 3. Neither the name of BBN Technologies nor the names of its contributors |
16 | # may be used to endorse or promote products derived from this software | | 16 | # may be used to endorse or promote products derived from this software |
| @@ -148,26 +148,27 @@ check_packages_w_flag() | | | @@ -148,26 +148,27 @@ check_packages_w_flag() |
148 | fi | | 148 | fi |
149 | done | | 149 | done |
150 | } | | 150 | } |
151 | | | 151 | |
152 | # echo dep->pkg edges for all installed packages | | 152 | # echo dep->pkg edges for all installed packages |
153 | depgraph_installed() | | 153 | depgraph_installed() |
154 | { | | 154 | { |
155 | ${PKG_INFO} -N '*' | ${AWK} ' \ | | 155 | ${PKG_INFO} -N '*' | ${AWK} ' \ |
156 | /^Information for/ { \ | | 156 | /^Information for/ { \ |
157 | pkg=$3; sub("-[0-9][^-]*:$", "", pkg); \ | | 157 | pkg=$3; sub("-[0-9][^-]*:$", "", pkg); \ |
158 | print pkg" "pkg; \ | | 158 | print pkg" "pkg; \ |
159 | state=1; \ | | 159 | state=1; \ |
160 | } \ | | 160 | } \ |
| | | 161 | /^\** PACKAGE MAY NOT BE DELETED \**$/ { state=3; } \ |
161 | /^./ { \ | | 162 | /^./ { \ |
162 | if (state == 2) { \ | | 163 | if (state == 2) { \ |
163 | dep=$1; sub("-[0-9][^-]*$", "", dep); \ | | 164 | dep=$1; sub("-[0-9][^-]*$", "", dep); \ |
164 | print dep" "pkg; \ | | 165 | print dep" "pkg; \ |
165 | } \ | | 166 | } \ |
166 | } \ | | 167 | } \ |
167 | /^Built using/ { \ | | 168 | /^Built using/ { \ |
168 | state=2 \ | | 169 | state=2 \ |
169 | } \ | | 170 | } \ |
170 | ' | | 171 | ' |
171 | } | | 172 | } |
172 | | | 173 | |
173 | # usage: who_requires pkg --in-graph DEPGRAPH | | 174 | # usage: who_requires pkg --in-graph DEPGRAPH |