summaryrefslogtreecommitdiff
path: root/list-installed.d
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-11-05 11:16:37 -0400
committerJoey Hess <joey@kitenet.net>2014-11-05 11:16:37 -0400
commit80a7b7fb320a907a60a270070d495b1122904e7a (patch)
treecd3eaae41850941ea26007a10cecf8c2a3f2b547 /list-installed.d
parent6335925c321c39aad3556d7afb5651902659c559 (diff)
add format marker for package list
to avoid spamming commit message with big diff when format changes
Diffstat (limited to 'list-installed.d')
-rwxr-xr-xlist-installed.d/50list-installed29
1 files changed, 19 insertions, 10 deletions
diff --git a/list-installed.d/50list-installed b/list-installed.d/50list-installed
index ac34202..2ac569a 100755
--- a/list-installed.d/50list-installed
+++ b/list-installed.d/50list-installed
@@ -1,12 +1,21 @@
#!/bin/sh
-# Output to stdout a *sorted* list of all currently installed
-# (or removed but still with config-files) packages, in the
-# format "package version\n" (or something similar).
-if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
- dpkg-query -W -f '${Status}\t${Package} ${Version} ${Architecture}\n' | \
- egrep '(ok installed|ok config-files)' | cut -f2,3
-elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
- rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
-elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
- pacman -Q
+if [ "$1" = fmt ]; then
+ # If the list format changes, change the fmt
+ if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
+ echo 2
+ else
+ echo ""
+ fi
+else
+ # Output to stdout a *sorted* list of all currently installed
+ # (or removed but still with config-files) packages, in the
+ # format "package version\n" (or something similar).
+ if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
+ dpkg-query -W -f '${Status}\t${Package} ${Version} ${Architecture}\n' | \
+ egrep '(ok installed|ok config-files)' | cut -f2,3
+ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
+ rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
+ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
+ pacman -Q
+ fi
fi