Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: src/scripts/dpkg_no_scripts.sh

Issue 551177: Add check for dpkg info and mkdir if it doesn't exist (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # This script can be used to replace the "dpkg" binary as far as the 7 # This script can be used to replace the "dpkg" binary as far as the
8 # "apt-get install" command is concerned. When "apt-get install foo" 8 # "apt-get install" command is concerned. When "apt-get install foo"
9 # runs it will make two calls to dpkg like: 9 # runs it will make two calls to dpkg like:
10 # dpkg --status-fd ## --unpack --auto-deconfigure /path/to/foo.deb 10 # dpkg --status-fd ## --unpack --auto-deconfigure /path/to/foo.deb
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 if [ -n "$fallback_packages" ]; then 105 if [ -n "$fallback_packages" ]; then
106 dpkg --root="$FLAGS_root" --configure $fallback_packages 106 dpkg --root="$FLAGS_root" --configure $fallback_packages
107 fi 107 fi
108 } 108 }
109 109
110 do_unpack() { 110 do_unpack() {
111 local dpkg_status="$FLAGS_root/var/lib/dpkg/status" 111 local dpkg_status="$FLAGS_root/var/lib/dpkg/status"
112 local dpkg_info="$FLAGS_root/var/lib/dpkg/info/" 112 local dpkg_info="$FLAGS_root/var/lib/dpkg/info/"
113 113
114 if [ ! -d "$dpkg_info" ]
115 then
116 mkdir -p "$dpkg_info"
117 fi
118
114 for p in "$@"; do 119 for p in "$@"; do
115 local package=$(dpkg-deb --field "$p" Package) 120 local package=$(dpkg-deb --field "$p" Package)
116 local tmpdir=$(mktemp -d) 121 local tmpdir=$(mktemp -d)
117 122
118 dpkg-deb --control "$p" "$tmpdir" 123 dpkg-deb --control "$p" "$tmpdir"
119 124
120 local preinst="${tmpdir}/preinst" 125 local preinst="${tmpdir}/preinst"
121 local postinst="${tmpdir}/postinst" 126 local postinst="${tmpdir}/postinst"
122 if has_missing_whitelist "$package" "$preinst" "$postinst"; then 127 if has_missing_whitelist "$package" "$preinst" "$postinst"; then
123 if [ $FLAGS_dpkg_fallback -eq $FLAGS_TRUE ]; then 128 if [ $FLAGS_dpkg_fallback -eq $FLAGS_TRUE ]; then
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 do_unpack $@ 175 do_unpack $@
171 elif [ $FLAGS_remove -eq $FLAGS_TRUE ]; then 176 elif [ $FLAGS_remove -eq $FLAGS_TRUE ]; then
172 # We log but ignore remove requests. 177 # We log but ignore remove requests.
173 echo "Ignoring remove: $@" 178 echo "Ignoring remove: $@"
174 else 179 else
175 echo "dpkg_no_scripts.sh: Unknown or missing command." 180 echo "dpkg_no_scripts.sh: Unknown or missing command."
176 exit 1 181 exit 1
177 fi 182 fi
178 183
179 exit 0 184 exit 0
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698