diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-26 15:52:32 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-26 15:52:32 +0200 |
commit | 1cdc615726308279890ecdce55d0c8567ac66f17 (patch) | |
tree | fbf23ea2b93bbd00374ac4d14f1e899fc131092c | |
parent | Do I need that (diff) | |
download | joe-scripts-1cdc615726308279890ecdce55d0c8567ac66f17.tar.gz joe-scripts-1cdc615726308279890ecdce55d0c8567ac66f17.tar.bz2 joe-scripts-1cdc615726308279890ecdce55d0c8567ac66f17.tar.xz joe-scripts-1cdc615726308279890ecdce55d0c8567ac66f17.tar.zst joe-scripts-1cdc615726308279890ecdce55d0c8567ac66f17.zip |
Test
-rwxr-xr-x | src/gitjoe/newrepo.pl | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/gitjoe/newrepo.pl b/src/gitjoe/newrepo.pl index dd26730..c7bdc6b 100755 --- a/src/gitjoe/newrepo.pl +++ b/src/gitjoe/newrepo.pl @@ -40,59 +40,28 @@ sub main { }, $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', - '/usr/bin/touch ' . $home_dir . $repo . 'git-daemon-export-ok' - ); - system( - '/usr/local/bin/dash', - '-c', - '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'git-daemon-export-ok' + '/usr/bin/touch', + $home_dir . $repo . 'git-daemon-export-ok' ); + chown $uid, $gid, $home_dir . $repo . 'git-daemon-export-ok'; open(my $owner_fh, '>:encoding(UTF-8)', $home_dir . $repo . 'owner'); print $owner_fh $usr; close($owner_fh); - system( - '/usr/local/bin/dash', - '-c', - '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'owner' - ); open(my $url_fh, '>:encoding(UTF-8)', $home_dir . $repo . 'url'); substr($repo, -1) = ""; print $url_fh 'git://jozanleclerc.xyz/' . $usr . '/' . $repo; close($url_fh); $repo = $repo . '/'; - system( - '/usr/local/bin/dash', - '-c', - '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'url' - ); + open(my $desc_fh, '>:encoding(UTF-8)', $home_dir . $repo . 'description'); if ($argc >= 3) { - open(my $desc_fh, '>:encoding(UTF-8)', $home_dir . $repo . 'description'); print $desc_fh $desc; - close($desc_fh); - system( - '/usr/local/bin/dash', - '-c', - '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'description' - ); } else { - open(my $desc_fh, '>:encoding(UTF-8)', $home_dir . $repo . 'description'); print $desc_fh 'No description yet'; - close($desc_fh); - system( - '/usr/local/bin/dash', - '-c', - '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'description' - ); } + close($desc_fh); + chown $uid, $gid, $home_dir . $repo . 'description'; substr($repo, -1) = ""; print "Created git repository " . colored($repo, 'bold green') . " for user " . colored($usr, 'bold') . ".\n"; print "Remote url: " . colored($usr . '@jozanleclerc.xyz:' . $repo, 'bold green') . "\n" |