aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-07-26 15:45:10 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-07-26 15:45:10 +0200
commitafd2c07febe1ebfc3163b1ec77334df559631036 (patch)
tree69dbcf72e5c5dff8544a690e633c2dd244655115
parentTypo (diff)
downloadjoe-scripts-afd2c07febe1ebfc3163b1ec77334df559631036.tar.gz
joe-scripts-afd2c07febe1ebfc3163b1ec77334df559631036.tar.bz2
joe-scripts-afd2c07febe1ebfc3163b1ec77334df559631036.tar.xz
joe-scripts-afd2c07febe1ebfc3163b1ec77334df559631036.tar.zst
joe-scripts-afd2c07febe1ebfc3163b1ec77334df559631036.zip
Trying something cool
-rwxr-xr-xsrc/gitjoe/newrepo.pl29
1 files 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',