Added pattern vs package handling for suse agent
This commit is contained in:
parent
ae769186d1
commit
52905dc25b
|
@ -8,7 +8,8 @@ hook_before() {
|
|||
|
||||
rpm -qa | sort > Package.versions.list
|
||||
rpm -qa --queryformat '%{NAME}.%{ARCH}\n' | sort > Package.all.list
|
||||
zypper se -i | awk '/^i\+/ { print $3 }' | sort > Package.list
|
||||
zypper se -i -t pattern | awk '/^i\+/ { print $3 }' | sort > Pattern.list
|
||||
zypper se -i -t package | awk '/^i\+/ { print $3 }' | sort > Package.list
|
||||
zypper lr -e Backup.repos
|
||||
zypper ll | awk '/.*\| package.*/ { print $3 }' > Package.lock
|
||||
|
||||
|
@ -62,6 +63,24 @@ fi
|
|||
#zypper dist-upgrade --from packman --allow-vendor-change
|
||||
#zypper install --from packman ffmpeg gstreamer-plugins-{good,bad,ugly,libav} libavcodec vlc-codecs
|
||||
|
||||
if [[ -r "Pattern.list" && "\$(wc -l --total=only Pattern.list)" -gt 0 ]]; then
|
||||
echo
|
||||
echo "=============================="
|
||||
echo "INSTALL PATTERNS"
|
||||
echo "=============================="
|
||||
echo
|
||||
echo "The following patterns are listed to be installed:"
|
||||
cat Pattern.list
|
||||
echo
|
||||
read -p "Do you want to continue to install these? [Y/n] " -n 1 -sr promptPattern
|
||||
if [[ "\$promptPattern" =~ ^[Yy] ]]; then
|
||||
echo "Yes"
|
||||
cat Pattern.list | xargs zypper install -t pattern
|
||||
else
|
||||
echo -e "Cancelled\n"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "=============================="
|
||||
echo "INSTALL PACKAGES"
|
||||
|
@ -81,7 +100,7 @@ echo "=============================="
|
|||
echo "REMOVE PACKAGES"
|
||||
echo "=============================="
|
||||
echo
|
||||
read -p "!!WARNING!! The next step is to remove packages that may not be desired. Do you want to continue? " -n 1 -sr promptRm
|
||||
read -p "!!WARNING!! The next step is to remove packages that may not be desired. Do you want to continue? [Y/n] " -n 1 -sr promptRm
|
||||
if [[ "\$promptRm" =~ ^[Yy]$ ]]; then
|
||||
# Do the thing
|
||||
echo "Yes"
|
||||
|
@ -111,7 +130,7 @@ else
|
|||
fi
|
||||
|
||||
# Package Locks
|
||||
if [[ -r "Package.lock" && "$(wc -l --total=only Package.list)" -gt 0 ]]; then
|
||||
if [[ -r "Package.lock" && "\$(wc -l --total=only Package.list)" -gt 0 ]]; then
|
||||
echo
|
||||
echo "=============================="
|
||||
echo "PACKAGE LOCKS"
|
||||
|
|
Loading…
Reference in a new issue