summaryrefslogtreecommitdiff
path: root/tests/bin
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2023-03-24 16:21:37 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2023-03-24 16:22:17 +0100
commit4abee510e6f615101764c049fe179d5f1feb1ec9 (patch)
tree14fb7e81edcc9c0008e246b8996320c3a6b3727f /tests/bin
parentafe1fdd6025a40ccfd05eea2c71eded522393ec4 (diff)
downloadalpine-conf-4abee510e6f615101764c049fe179d5f1feb1ec9.zip
tests: add fake apk info support
fake apk info --depends gnome
Diffstat (limited to 'tests/bin')
-rwxr-xr-xtests/bin/apk17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/bin/apk b/tests/bin/apk
index cf06ed7..9868230 100755
--- a/tests/bin/apk
+++ b/tests/bin/apk
@@ -15,7 +15,7 @@ while [ $# -gt 0 ]; do
echo "DEBUG: fake apk" "$@"
cmd="$1"
;;
- audit)
+ audit|info)
cmd="$1"
;;
-p|--root)
@@ -28,6 +28,7 @@ while [ $# -gt 0 ]; do
--arch) shift ;;
--repositories-file) shift ;;
--keys-dir) shift ;;
+ -*) subopt="$1";;
[a-z]*)
pkgs="$pkgs $1"
;;
@@ -49,6 +50,20 @@ case "$cmd" in
cache|update|del)
exit 0
;;
+ info)
+ case "$subopt" in
+ -r|--depends)
+ for pkg in $pkgs; do
+ if ! [ -n "$quiet" ]; then
+ printf "%s depends on:\n\n"
+ fi
+ case "$pkg" in
+ *gnome*) printf "gnome-shell\ngvfs\n";;
+ esac
+ done
+ ;;
+ esac
+ ;;
esac
for pkg in $pkgs; do