Add update-packages-list script.
This commit is contained in:
parent
9c1441287c
commit
2e2e666797
1 changed files with 26 additions and 0 deletions
26
update-packages-list
Executable file
26
update-packages-list
Executable file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check for an /etc/os-release.
|
||||||
|
[[ ! -e /etc/os-release ]] && {
|
||||||
|
printf "%s: %s\\n" "${BASH_SOURCE[0]}" "No /etc/os-release to determine system." >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Source system info.
|
||||||
|
. /etc/os-release
|
||||||
|
|
||||||
|
# Create package list depending on system type.
|
||||||
|
case "$ID" in
|
||||||
|
'slackware')
|
||||||
|
/usr/sbin/slackpkg -batch=on -default_answer=y generate-template "$(hostname --short)" >/dev/null
|
||||||
|
;;
|
||||||
|
'void')
|
||||||
|
/usr/sbin/xbps-query -l | awk '{ print $2 }' | rev | cut -d- -f2- | rev >/etc/pkglist
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf "%s: %s\\n" "${BASH_SOURCE[0]}" "Unsupported system." >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
Loading…
Add table
Add a link
Reference in a new issue