Browse Source

Fix update-devtable not matching dot files in home dirs

K. Lange 2 years ago
parent
commit
5b651252cd
1 changed files with 10 additions and 2 deletions
  1. 10 2
      util/update-devtable.py

+ 10 - 2
util/update-devtable.py

@@ -1,8 +1,16 @@
 #!/usr/bin/env python3
 import os
-import glob
 from pathlib import Path
 
+def getPaths(base):
+    out = []
+    for root, dirs, files in os.walk(base):
+        for i in dirs:
+            out.append(os.path.join(root,i))
+        for i in files:
+            out.append(os.path.join(root,i))
+    return out
+
 with open('util/devtable','w') as devtable:
 
     # Set sudo apps to setuid, executable, no write
@@ -15,7 +23,7 @@ with open('util/devtable','w') as devtable:
     # Copy permissions and set ownership for user files
     for user_details in [('local',1000)]:
         user, uid = user_details
-        for path in glob.glob('./base/home/{user}/**'.format(user=user),recursive=True):
+        for path in getPaths('./base/home/{user}'.format(user=user)):
             p = Path(path)
             path_mod = path.replace('./base','').rstrip('/')
             path_type = 'd' if p.is_dir() else 'f'