From 888596f1f6931d5ddfc9101803e3fd812df71a9c Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 13 Sep 2026 01:11:50 +0000 Subject: [PATCH] Student artifacts: populate the home_tar manifest; do not archive the primary user twice - CheckTars.py wrote the per-image home_tar manifest from `tar czf` stdout, which is empty, so the manifest never listed anything and home_tar seed files (documents, bookmarks, notes) were collected into the student .lab archive whenever the image was built the same day the lab was started. `tar czvf` produces the list the designer guide describes. - Student.py otherUsers() skipped only the primary user's top directory and then walked into its subdirectories, so every deliverable appeared a second time under other_users//. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01MQfHVX14NCvhJwMM4BqDpL --- scripts/labtainer-student/bin/CheckTars.py | 4 ++-- scripts/labtainer-student/lab_bin/Student.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/labtainer-student/bin/CheckTars.py b/scripts/labtainer-student/bin/CheckTars.py index d1ec05e5..7517d70a 100755 --- a/scripts/labtainer-student/bin/CheckTars.py +++ b/scripts/labtainer-student/bin/CheckTars.py @@ -158,7 +158,7 @@ def CheckTars(container_dir, image_name, logger): os.chdir(tmp_loc) full_tar = os.path.join(full, tar_name) if f == 'home_tar': - cmd = 'tar czf %s --owner=:1000 --group=:1000 `ls -A -1` > %s' % (full_tar, manifest) + cmd = 'tar czvf %s --owner=:1000 --group=:1000 `ls -A -1` > %s' % (full_tar, manifest) else: cmd = 'tar czf %s --owner=root --group=root `ls -A -1`' % (full_tar) os.system(cmd) @@ -192,7 +192,7 @@ def CheckTars(container_dir, image_name, logger): os.chdir(tmp_loc) full_tar = os.path.join(full, tar_name) if f == 'home_tar': - cmd = 'tar czf %s `ls -A -1` > %s' % (full_tar, manifest) + cmd = 'tar czvf %s `ls -A -1` > %s' % (full_tar, manifest) else: cmd = 'tar czf %s `ls -A -1`' % (full_tar) os.system(cmd) diff --git a/scripts/labtainer-student/lab_bin/Student.py b/scripts/labtainer-student/lab_bin/Student.py index a46adf6d..e2fec61c 100755 --- a/scripts/labtainer-student/lab_bin/Student.py +++ b/scripts/labtainer-student/lab_bin/Student.py @@ -81,7 +81,9 @@ def otherUsers(start_time, zipoutput, studentHomeDir, skip_list, dt_skip_list, s udir = '/home' os.chdir('/home') for rootdir, subdirs, files in os.walk(udir): - if rootdir == studentHomeDir: + # the primary user's tree is archived by main(); walking into it here duplicated every + # deliverable under other_users// (os.walk descends past the top match) + if rootdir == studentHomeDir or rootdir.startswith(studentHomeDir + '/'): continue newdir = rootdir.replace(udir, '.') # TBD FIX this