Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package patterns-wsl for openSUSE:Factory 
checked in at 2023-01-04 17:52:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/patterns-wsl (Old)
 and      /work/SRC/openSUSE:Factory/.patterns-wsl.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "patterns-wsl"

Wed Jan  4 17:52:38 2023 rev:4 rq:1046640 version:20221221

Changes:
--------
--- /work/SRC/openSUSE:Factory/patterns-wsl/patterns-wsl.changes        
2022-10-08 01:23:46.926031094 +0200
+++ /work/SRC/openSUSE:Factory/.patterns-wsl.new.1563/patterns-wsl.changes      
2023-01-04 17:52:50.378265393 +0100
@@ -1,0 +2,66 @@
+Wed Dec 21 03:04:19 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>
+
+- Adjusting how $PREEXISTING_COMMANDS is fed into the while loop for
+  wsl_systemd
+
+-------------------------------------------------------------------
+Wed Dec 21 01:33:32 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>
+
+- Update to version 20221221
+  * Improved tests for [boot] section when 'command=.*$' is present so
+    as to not clobber existing commands for wsl_base & wsl_gui
+  * wsl_systemd should clear ping_group_range if present and retain any
+    existing commands
+
+-------------------------------------------------------------------
+Tue Dec 20 03:27:52 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>
+
+- Update to version 20221220
+  * Reworked to avoid build race condition where it seemed like there was
+    an issue during 50-check-installtest and what happens with
+    "testing for pre/postinstall scripts that are not idempotent"
+  * Adding true %post section
+
+-------------------------------------------------------------------
+Mon Dec 19 21:16:06 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>
+
+- Adding [wsl_base,gui,systemd] tags for echo output
+- Changing %post to %pre as there seems to be a problem when
+  50-check-installtest runs as %post
+
+-------------------------------------------------------------------
+Mon Dec 19 17:11:42 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>
+
+- Update to version 20221219
+  * Adjusting wsl_systemd %post to remove ping_group_range from wsl.conf
+    when systemd is being enabled.
+
+-------------------------------------------------------------------
+Fri Dec 16 22:33:58 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>
+
+- Update to version 20221216
+  * Undoing LoadCredential changes since it's NOT what was breaking WSLg
+    integration
+  * Adjusing %post code for edits to %{_sysconfdir}/wsl.conf for:
+    * wsl_base
+    * wsl_gui
+    * wsl_systemd
+
+-------------------------------------------------------------------
+Tue Dec  6 21:27:06 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>
+
+- Update to version 20221206
+  * Updating wsl_systemd to comment out 'LoadCredential=*' for 5 systemd
+    units:
+    * systemd-tmpfiles-setup.service
+    * systemd-tmpfiles-setup-dev.service
+    * systemd-sysctl.service
+    * systemd-tmpfiles-clean.service
+    * systemd-sysusers.service
+
+-------------------------------------------------------------------
+Thu Oct 20 23:56:49 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>
+
+- Moving 'xeyes' from a "Requires" to "Recommends" for wsl_gui pattern
+
+-------------------------------------------------------------------
@@ -10 +76 @@
-Tue Feb 22 19:18:54 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com> - 
20220222
+Tue Feb 22 19:18:54 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ patterns-wsl.spec ++++++
--- /var/tmp/diff_new_pack.AthPu5/_old  2023-01-04 17:52:50.738267515 +0100
+++ /var/tmp/diff_new_pack.AthPu5/_new  2023-01-04 17:52:50.742267540 +0100
@@ -17,14 +17,16 @@
 
 
 Name:           patterns-wsl
-Version:        20220929
+Version:        20221221
 Release:        0
 Summary:        Recommended packages for Windows Subsystem for Linux, WSL, WSLg
 License:        MIT
 Group:          Metapackages
 URL:            https://github.com/sbradnick/patterns
 BuildRequires:  patterns-rpm-macros
-#BuildArch:      noarch
+BuildRequires:  systemd
+BuildRequires:  udev
+BuildArch:      noarch
 
 %description
 This is an internal package that is used to create the patterns as part
@@ -38,15 +40,49 @@
 Summary:        Base WSL packages
 Group:          Metapackages
 Provides:       pattern() = wsl_base
-Provides:       pattern-icon() = wsl
-Provides:       pattern-order() = 3420
+Provides:       pattern-icon() = pattern-generic
+#Provides:       pattern-order() = ?
 Provides:       pattern-visible()
 Requires:       bash
 Recommends:     fish
 Recommends:     zsh
 
 %description base
-This package contains the wsl_base pattern: recommended tools,libraries for 
using WSL.
+This package contains the wsl_base pattern: recommended 
configs,tools,libraries for using WSL.
+
+%pre base
+if [[ -f %{_sysconfdir}/wsl.conf && ! -L %{_sysconfdir}/wsl.conf ]];
+then
+  %{_bindir}/echo "* [wsl_base] Creating backup for 
%{_sysconfdir}/wsl.conf.wsl_base ..."
+  cp -v %{_sysconfdir}/wsl.conf %{_sysconfdir}/wsl.conf.wsl_base
+  BOOT_COUNT=$(%{_bindir}/grep -c "\[boot\]" %{_sysconfdir}/wsl.conf.wsl_base)
+  if [[ $BOOT_COUNT -gt 0 ]];
+  then
+    COMMAND_COUNT=$(%{_bindir}/grep -c "^command" 
%{_sysconfdir}/wsl.conf.wsl_base)
+    if [[ $COMMAND_COUNT -gt 0 ]];
+    then
+      %{_bindir}/echo "* [wsl_base] Entry exists for 'command'; chaining in 
new item ..."
+      EXISTING_COMMAND=$(%{_bindir}/grep "^command" 
%{_sysconfdir}/wsl.conf.wsl_base | %{_bindir}/cut -d= -f2-)
+      %{_bindir}/sed -i /^command/d %{_sysconfdir}/wsl.conf.wsl_base
+      %{_bindir}/sed -i 's,\[boot\],\[boot\]\n# adjusted by wsl_base 
pattern\ncommand=/usr/sbin/sysctl -w net.ipv4.ping_group_range=\\\"0 
2147483647\\\" ; '"$EXISTING_COMMAND"'\n# END: wsl_base pattern edit,g' 
%{_sysconfdir}/wsl.conf.wsl_base
+    fi
+  else
+    %{_bindir}/echo "* [wsl_base] File existed, but no [boot]; adjusting 
%{_sysconfdir}/wsl.conf.wsl_base ..."
+    %{_bindir}/echo -e "# added by wsl_base 
pattern\n[boot]\ncommand=/usr/sbin/sysctl -w net.ipv4.ping_group_range=\\\"0 
2147483647\\\"\n# END: wsl_base pattern edit" >> 
%{_sysconfdir}/wsl.conf.wsl_base
+  fi
+elif [[ -f %{_sysconfdir}/wsl.conf && -L %{_sysconfdir}/wsl.conf ]];
+then
+  %{_bindir}/echo "* [wsl_base] Current %{_sysconfdir}/wsl.conf is a symlink ; 
ensure contents you want are copied to a non-symlink %{_sysconfdir}/wsl.conf 
and reinstall the pattern ..."
+else
+  %{_bindir}/echo "* [wsl_base] No file existed; adding 
%{_sysconfdir}/wsl.conf.wsl_base ..."
+  %{_bindir}/echo -e "# added by wsl_base 
pattern\n[boot]\ncommand=/usr/sbin/sysctl -w net.ipv4.ping_group_range=\\\"0 
2147483647\\\"\n# END: wsl_base pattern edit" > %{_sysconfdir}/wsl.conf.wsl_base
+fi
+
+%post base
+if [[ -e %{_sysconfdir}/wsl.conf.wsl_base ]];
+then
+  ln -sf %{_sysconfdir}/wsl.conf.wsl_base %{_sysconfdir}/wsl.conf
+fi
 
 %files base
 %dir /usr/share/doc/packages/patterns
@@ -59,18 +95,52 @@
 Summary:        WSL GUI packages
 Group:          Metapackages
 Provides:       pattern() = wsl_gui
-Provides:       pattern-icon() = wsl
-Provides:       pattern-order() = 3420
+Provides:       pattern-icon() = pattern-generic
+#Provides:       pattern-order() = ?
 Provides:       pattern-visible()
 Requires:       lato-fonts
-Requires:       xeyes
 Recommends:     adwaita-icon-theme
 Recommends:     gnome-icon-theme
 Recommends:     noto-sans-fonts
 Recommends:     powerline-fonts
+Recommends:     xeyes
 
 %description gui
-This package contains the wsl_gui pattern: recommended tools,libraries for 
using WSLg.
+This package contains the wsl_gui pattern: recommended configs,tools,libraries 
for using WSLg.
+
+%pre gui
+if [[ -f %{_sysconfdir}/wsl.conf && ! -L %{_sysconfdir}/wsl.conf ]];
+then
+  %{_bindir}/echo "* [wsl_gui] Creating backup for 
%{_sysconfdir}/wsl.conf.wsl_gui ..."
+  cp -v %{_sysconfdir}/wsl.conf %{_sysconfdir}/wsl.conf.wsl_gui
+  BOOT_COUNT=$(%{_bindir}/grep -c "\[boot\]" %{_sysconfdir}/wsl.conf.wsl_gui)
+  if [[ $BOOT_COUNT -gt 0 ]];
+  then
+    COMMAND_COUNT=$(%{_bindir}/grep -c "^command" 
%{_sysconfdir}/wsl.conf.wsl_gui)
+    if [[ $COMMAND_COUNT -gt 0 ]];
+    then
+      %{_bindir}/echo "* [wsl_gui] Entry exists for 'command'; chaining in new 
item ..."
+      EXISTING_COMMAND=$(%{_bindir}/grep "^command" 
%{_sysconfdir}/wsl.conf.wsl_gui | %{_bindir}/cut -d= -f2-)
+      %{_bindir}/sed -i /^command/d %{_sysconfdir}/wsl.conf.wsl_gui
+      %{_bindir}/sed -i 's,\[boot\],\[boot\]\n# adjusted by wsl_gui 
pattern\ncommand=/usr/sbin/sysctl -w net.ipv4.ping_group_range=\\\"0 
2147483647\\\" ; '"$EXISTING_COMMAND"'\n# END: wsl_gui pattern edit,g' 
%{_sysconfdir}/wsl.conf.wsl_gui
+    fi
+  else
+    %{_bindir}/echo "* [wsl_gui] File existed, but no [boot]; adjusting 
%{_sysconfdir}/wsl.conf.wsl_gui ..."
+    %{_bindir}/echo -e "# added by wsl_gui 
pattern\n[boot]\ncommand=/usr/sbin/sysctl -w net.ipv4.ping_group_range=\\\"0 
2147483647\\\"\n# END: wsl_gui pattern edit" >> %{_sysconfdir}/wsl.conf.wsl_gui
+  fi
+elif [[ -f %{_sysconfdir}/wsl.conf && -L %{_sysconfdir}/wsl.conf ]];
+then
+  %{_bindir}/echo "* [wsl_gui] Current %{_sysconfdir}/wsl.conf is a symlink ; 
ensure contents you want are copied to a non-symlink %{_sysconfdir}/wsl.conf 
and reinstall the pattern ..."
+else
+  %{_bindir}/echo "* [wsl_gui] No file existed; adding 
%{_sysconfdir}/wsl.conf.wsl_gui ..."
+  %{_bindir}/echo -e "# added by wsl_gui 
pattern\n[boot]\ncommand=/usr/sbin/sysctl -w net.ipv4.ping_group_range=\\\"0 
2147483647\\\"\n# END: wsl_gui pattern edit" > %{_sysconfdir}/wsl.conf.wsl_gui
+fi
+
+%post gui
+if [[ -e %{_sysconfdir}/wsl.conf.wsl_gui ]];
+then
+  ln -sf %{_sysconfdir}/wsl.conf.wsl_gui %{_sysconfdir}/wsl.conf
+fi
 
 %files gui
 %dir /usr/share/doc/packages/patterns
@@ -83,26 +153,66 @@
 Summary:        WSL systemd setup
 Group:          Metapackages
 Provides:       pattern() = wsl_systemd
-Provides:       pattern-icon() = wsl
-Provides:       pattern-order() = 3420
+Provides:       pattern-icon() = pattern-generic
+#Provides:       pattern-order() = ?
 Provides:       pattern-visible()
+Requires:       systemd
 
 %description systemd
-This package contains the wsl_systemd pattern: provides /etc/wsl.conf and 
/sbin/init symlink where required.
+This package contains the wsl_systemd pattern: adjusts or provides 
%{_sysconfdir}/wsl.conf and /sbin/init symlink where required.
 
-#%%if 0%%{?suse_version} == 1500
-#%%endif
-%post systemd
+%pre systemd -p /bin/bash
 if [[ ! -L /sbin/init ]];
 then
-  %{_bindir}/echo "ADDING /sbin/init -> /usr/lib/systemd/systemd SYMLINK."
+  %{_bindir}/echo "* [wsl_systemd] Adding /sbin/init -> 
/usr/lib/systemd/systemd symlink."
   %{_bindir}/ln -s %{_systemd_util_dir}/systemd /sbin/init
-  if [[ -e /etc/wsl.conf ]];
+fi
+if [[ -f %{_sysconfdir}/wsl.conf && ! -L %{_sysconfdir}/wsl.conf ]];
+then
+  %{_bindir}/echo "* [wsl_systemd] Creating backup for 
%{_sysconfdir}/wsl.conf.wsl_systemd ..."
+  cp -v %{_sysconfdir}/wsl.conf %{_sysconfdir}/wsl.conf.wsl_systemd
+  BOOT_COUNT=$(%{_bindir}/grep -c "\[boot\]" 
%{_sysconfdir}/wsl.conf.wsl_systemd)
+  if [[ $BOOT_COUNT -gt 0 ]];
+  then
+    COMMAND_COUNT=$(%{_bindir}/grep -c "^command" 
%{_sysconfdir}/wsl.conf.wsl_systemd)
+    if [[ $COMMAND_COUNT -gt 0 ]];
+    then
+      %{_bindir}/echo "* [wsl_systemd] Entry exists for 'command'; looking for 
and removing ping_group_range (if found) ..."
+      CMDS_TO_KEEP=""
+      PREEXISTING_COMMANDS=$(%{_bindir}/grep ^command 
%{_sysconfdir}/wsl.conf.wsl_systemd | %{_bindir}/cut -d= -f2- | %{_bindir}/awk 
-F';' '{for (i=1; i<=NF; ++i) {print $i}}')
+      while read -r line
+      do
+        LINE_CHECK=$(%{_bindir}/echo $line | grep -v ping_group_range)
+        if [[ ! -z $LINE_CHECK ]];
   then
-    cp /etc/wsl.conf /etc/wsl.conf.$(date +%s)
+          if [[ -z $CMDS_TO_KEEP ]];
+          then
+            CMDS_TO_KEEP=$(%{_bindir}/echo "$LINE_CHECK")
+          else
+            CMDS_TO_KEEP=$(%{_bindir}/echo "$CMDS_TO_KEEP ; $LINE_CHECK")
+          fi
+        fi
+      done <<< "$PREEXISTING_COMMANDS"
+      %{_bindir}/sed -i 's,^command.*$,command='"$CMDS_TO_KEEP"',g' 
%{_sysconfdir}/wsl.conf.wsl_systemd
   fi
-  %{_bindir}/echo "ADDING /etc/wsl.conf ..."
-  %{_bindir}/echo -e "# added by wsl_systemd pattern\n[boot]\nsystemd=true\n# 
END: wsl_systemd pattern edit" > %{_sysconfdir}/wsl.conf
+    %{_bindir}/echo "* [wsl_systemd] Adjusting 
%{_sysconfdir}/wsl.conf.wsl_systemd ..."
+    %{_bindir}/sed -i 's,\[boot\],\[boot\]\n# adjusted by wsl_systemd 
pattern\nsystemd=true\n# END: wsl_systemd pattern edit,g' 
%{_sysconfdir}/wsl.conf.wsl_systemd
+  else
+    %{_bindir}/echo "* [wsl_systemd] File existed, but no [boot]; adjusting 
%{_sysconfdir}/wsl.conf.wsl_systemd ..."
+    %{_bindir}/echo -e "# added by wsl_systemd 
pattern\n[boot]\nsystemd=true\n# END: wsl_systemd pattern edit" >> 
%{_sysconfdir}/wsl.conf.wsl_systemd
+  fi
+elif [[ -f %{_sysconfdir}/wsl.conf && -L %{_sysconfdir}/wsl.conf ]];
+then
+  %{_bindir}/echo "* [wsl_systemd] Current %{_sysconfdir}/wsl.conf is a 
symlink ; ensure contents you want are copied to a non-symlink 
%{_sysconfdir}/wsl.conf and reinstall the pattern ..."
+else
+  %{_bindir}/echo "* [wsl_systemd] No file existed; adding 
%{_sysconfdir}/wsl.conf.wsl_systemd ..."
+  %{_bindir}/echo -e "# added by wsl_systemd pattern\n[boot]\nsystemd=true\n# 
END: wsl_systemd pattern edit" > %{_sysconfdir}/wsl.conf.wsl_systemd
+fi
+
+%post systemd
+if [[ -e %{_sysconfdir}/wsl.conf.wsl_systemd ]];
+then
+  ln -sf %{_sysconfdir}/wsl.conf.wsl_systemd %{_sysconfdir}/wsl.conf
 fi
 
 %files systemd

Reply via email to