[source] base-files: fix user creation on sysupgrade with few opkg control files

LEDE Commits lede-commits at lists.infradead.org
Fri Jan 27 01:11:03 PST 2017


neoraider pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/a1f918cd92c4afcdd3a9caceba030f9eb435c265

commit a1f918cd92c4afcdd3a9caceba030f9eb435c265
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Tue Jan 24 18:55:13 2017 +0100

    base-files: fix user creation on sysupgrade with few opkg control files
    
    If only a single opkg control file exists (which can happen with
    CONFIG_CLEAN_IPKG), grep would not print the file name by default. Instead
    of forcing it using -H, we just switch to -l (print only file names) and
    get rid of the cut.
    
    Add -s to suppress an error message when no control files exist.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/base-files/files/etc/uci-defaults/13_fix_group_user | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
index deade5b..e6dae24 100644
--- a/package/base-files/files/etc/uci-defaults/13_fix_group_user
+++ b/package/base-files/files/etc/uci-defaults/13_fix_group_user
@@ -2,7 +2,7 @@
 
 . /lib/functions.sh
 
-for file in `grep Require-User /usr/lib/opkg/info/*.control | cut -d: -f1`; do
+for file in `grep -sl Require-User /usr/lib/opkg/info/*.control`; do
 	file="${file##*/}"
 	file="${file%.control}"
 	add_group_and_user "${file}"



More information about the lede-commits mailing list