0010-base-files-fix-user-creation-on-sysupgrade-with-few-opkg-control-files.patch 1.1 KB

1234567891011121314151617181920212223242526
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Tue, 24 Jan 2017 18:55:13 +0100
  3. Subject: base-files: fix user creation on sysupgrade with few opkg control files
  4. If only a single opkg control file exists (which can happen with
  5. CONFIG_CLEAN_IPKG), grep would not print the file name by default. Instead
  6. of forcing it using -H, we just switch to -l (print only file names) and
  7. get rid of the cut.
  8. Add -s to suppress an error message when no control files exist.
  9. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  10. diff --git a/package/base-files/files/etc/uci-defaults/13_fix_group_user b/package/base-files/files/etc/uci-defaults/13_fix_group_user
  11. index deade5bbd1876cd3f009d4c0b18be258c3bf36d1..e6dae2419f65a830ebd039fbbfa0fd22d1a2d0a1 100644
  12. --- a/package/base-files/files/etc/uci-defaults/13_fix_group_user
  13. +++ b/package/base-files/files/etc/uci-defaults/13_fix_group_user
  14. @@ -2,7 +2,7 @@
  15. . /lib/functions.sh
  16. -for file in `grep Require-User /usr/lib/opkg/info/*.control | cut -d: -f1`; do
  17. +for file in `grep -sl Require-User /usr/lib/opkg/info/*.control`; do
  18. file="${file##*/}"
  19. file="${file%.control}"
  20. add_group_and_user "${file}"