From afd2c07febe1ebfc3163b1ec77334df559631036 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 26 Jul 2020 15:45:10 +0200 Subject: Trying something cool --- src/gitjoe/newrepo.pl | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/gitjoe/newrepo.pl b/src/gitjoe/newrepo.pl index d0d938a..eb24e7e 100755 --- a/src/gitjoe/newrepo.pl +++ b/src/gitjoe/newrepo.pl @@ -24,21 +24,26 @@ sub main { $repo = $repo . '.git'; } $repo = $repo . '/'; + mkdir $home_dir . $repo, 0755; system( - '/usr/local/bin/dash', - '-c', - '/bin/mkdir -v ' . $home_dir . $repo + '/usr/local/bin/git', + '-C', + $home_dir . $repo, + 'init', + '--bare' ); - system( - '/usr/local/bin/dash', - '-c', - '/usr/local/bin/git -C ' . $home_dir . $repo . ' init --bare' - ); - system( - '/usr/local/bin/dash', - '-c', - '/usr/sbin/chown -v -R ' . $usr . ':' . $usr . ' ' . $home_dir . $repo + my (undef, undef, $uid, $gid) = getpwnam($usr); + find( + sub { + chown $uid, $gid, $_; + }, + $home_dir . $repo ); + # system( + # '/usr/local/bin/dash', + # '-c', + # '/usr/sbin/chown -v -R ' . $usr . ':' . $usr . ' ' . $home_dir . $repo + # ); system( '/usr/local/bin/dash', '-c', -- cgit v1.2.3