aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/gitjoe/newrepo.pl43
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"