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

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

Issue 542135: Fix the creation of .list files for dpkg with maintainer scripts (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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 else 91 else
92 # TODO: Eventually should be upgraded to a full error. 92 # TODO: Eventually should be upgraded to a full error.
93 echo "** Warning: Ignoring missing whitelist for ${p}." 93 echo "** Warning: Ignoring missing whitelist for ${p}."
94 fi 94 fi
95 fi 95 fi
96 96
97 # Run our maintainer script for this package if we have one. 97 # Run our maintainer script for this package if we have one.
98 local chromium_postinst="${SRC_ROOT}/package_scripts/${p}.postinst" 98 local chromium_postinst="${SRC_ROOT}/package_scripts/${p}.postinst"
99 if [ -f "$chromium_postinst" ]; then 99 if [ -f "$chromium_postinst" ]; then
100 echo "Running: $chromium_postinst" 100 echo "Running: $chromium_postinst"
101 ROOT="$FLAGS_root" SRC_ROOT="$SRC_ROOT" sh -x $chromium_postinst 101 ROOT="$FLAGS_root" SRC_ROOT="$SRC_ROOT" $chromium_postinst
102 fi 102 fi
103 done 103 done
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"
(...skipping 17 matching lines...) Expand all
129 # TODO: Eventually should be upgraded to a full error. 129 # TODO: Eventually should be upgraded to a full error.
130 echo "** Warning: Ignoring missing whitelist for ${p}." 130 echo "** Warning: Ignoring missing whitelist for ${p}."
131 fi 131 fi
132 fi 132 fi
133 133
134 # Copy the info files 134 # Copy the info files
135 local files=$(ls "$tmpdir" | grep -v control) 135 local files=$(ls "$tmpdir" | grep -v control)
136 for f in $files; do 136 for f in $files; do
137 cp "${tmpdir}/${f}" "${dpkg_info}/${package}.${f}" 137 cp "${tmpdir}/${f}" "${dpkg_info}/${package}.${f}"
138 done 138 done
139 touch "${dpkg_info}/${package}.list" # TODO: Proper .list files. 139 dpkg -c "$p" | sed 's,.* \.\/,/,; s/ -> .*//; s,^/$,/.,; s,/$,,' > \
140 "${dpkg_info}/${package}.list"
140 141
141 # Mark the package as installed successfully. 142 # Mark the package as installed successfully.
142 echo "Status: install ok installed" >> "$dpkg_status" 143 echo "Status: install ok installed" >> "$dpkg_status"
143 cat "${tmpdir}/control" >> "$dpkg_status" 144 cat "${tmpdir}/control" >> "$dpkg_status"
144 echo "" >> "$dpkg_status" 145 echo "" >> "$dpkg_status"
145 146
146 rm -rf "$tmpdir" 147 rm -rf "$tmpdir"
147 148
148 # Run our maintainer script for this package if we have one. 149 # Run our maintainer script for this package if we have one.
149 local chromium_preinst="${SRC_ROOT}/package_scripts/${package}.preinst" 150 local chromium_preinst="${SRC_ROOT}/package_scripts/${package}.preinst"
(...skipping 19 matching lines...) Expand all
169 do_unpack $@ 170 do_unpack $@
170 elif [ $FLAGS_remove -eq $FLAGS_TRUE ]; then 171 elif [ $FLAGS_remove -eq $FLAGS_TRUE ]; then
171 # We log but ignore remove requests. 172 # We log but ignore remove requests.
172 echo "Ignoring remove: $@" 173 echo "Ignoring remove: $@"
173 else 174 else
174 echo "dpkg_no_scripts.sh: Unknown or missing command." 175 echo "dpkg_no_scripts.sh: Unknown or missing command."
175 exit 1 176 exit 1
176 fi 177 fi
177 178
178 exit 0 179 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