-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
apt-get
executable file
·38 lines (33 loc) · 963 Bytes
/
apt-get
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
INSTALL=
. /usr/local/share/buildinfo/scripts/buildinfo_base.sh
REAL_COMMAND=$(get_command apt-get)
if [ -z "$REAL_COMMAND" ]; then
echo "The command apt-get does not exist." 1>&2
exit 1
fi
VERSION_FILE="/usr/local/share/buildinfo/versions/versions-deb"
if [ "$ENABLE_VERSION_CONTROL_DEB" == "y" ]; then
for para in $@
do
if [[ "$para" != -* ]]; then
continue
fi
if [ ! -z "$INSTALL" ]; then
if [[ "$para" == *=* ]]; then
continue
elif [[ "$para" == *=* ]]; then
continue
else
package=$para
if ! grep -q "^${package}=" $VERSION_FILE; then
echo "The version of the package ${package} is not specified."
exit 1
fi
fi
elif [[ "$para" == "install" ]]; then
INSTALL=y
fi
done
fi
$REAL_COMMAND "$@"