Added pattern vs package handling for suse agent
This commit is contained in:
parent
ae769186d1
commit
52905dc25b
1 changed files with 22 additions and 3 deletions
|
@ -8,7 +8,8 @@ hook_before() {
|
||||||
|
|
||||||
rpm -qa | sort > Package.versions.list
|
rpm -qa | sort > Package.versions.list
|
||||||
rpm -qa --queryformat '%{NAME}.%{ARCH}\n' | sort > Package.all.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 lr -e Backup.repos
|
||||||
zypper ll | awk '/.*\| package.*/ { print $3 }' > Package.lock
|
zypper ll | awk '/.*\| package.*/ { print $3 }' > Package.lock
|
||||||
|
|
||||||
|
@ -62,6 +63,24 @@ fi
|
||||||
#zypper dist-upgrade --from packman --allow-vendor-change
|
#zypper dist-upgrade --from packman --allow-vendor-change
|
||||||
#zypper install --from packman ffmpeg gstreamer-plugins-{good,bad,ugly,libav} libavcodec vlc-codecs
|
#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 "=============================="
|
echo "=============================="
|
||||||
echo "INSTALL PACKAGES"
|
echo "INSTALL PACKAGES"
|
||||||
|
@ -81,7 +100,7 @@ echo "=============================="
|
||||||
echo "REMOVE PACKAGES"
|
echo "REMOVE PACKAGES"
|
||||||
echo "=============================="
|
echo "=============================="
|
||||||
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
|
if [[ "\$promptRm" =~ ^[Yy]$ ]]; then
|
||||||
# Do the thing
|
# Do the thing
|
||||||
echo "Yes"
|
echo "Yes"
|
||||||
|
@ -111,7 +130,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Package Locks
|
# 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 "=============================="
|
echo "=============================="
|
||||||
echo "PACKAGE LOCKS"
|
echo "PACKAGE LOCKS"
|
||||||
|
|
Loading…
Reference in a new issue