aboutsummaryrefslogtreecommitdiffstats
path: root/gitjoe-newrepo.pl
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-07-07 19:35:48 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-07-07 19:35:48 +0200
commit44e07caa905d14a8a709b993c4e7ac93570b97e8 (patch)
tree5f6c31fb2eb9c726a371ed4d890015a6838a4238 /gitjoe-newrepo.pl
parentUpdate serv now updates gitjoe (diff)
downloadjoe-scripts-44e07caa905d14a8a709b993c4e7ac93570b97e8.tar.gz
joe-scripts-44e07caa905d14a8a709b993c4e7ac93570b97e8.tar.bz2
joe-scripts-44e07caa905d14a8a709b993c4e7ac93570b97e8.tar.xz
joe-scripts-44e07caa905d14a8a709b993c4e7ac93570b97e8.tar.zst
joe-scripts-44e07caa905d14a8a709b993c4e7ac93570b97e8.zip
Better newrepo script, with owner and url files support
Diffstat (limited to 'gitjoe-newrepo.pl')
-rwxr-xr-xgitjoe-newrepo.pl16
1 files changed, 16 insertions, 0 deletions
diff --git a/gitjoe-newrepo.pl b/gitjoe-newrepo.pl
index 77651c4..bedb9e2 100755
--- a/gitjoe-newrepo.pl
+++ b/gitjoe-newrepo.pl
@@ -45,6 +45,22 @@ sub main {
'-c',
'/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $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');
+ print $url_fh 'git://jozanleclerc.xyz/' . $usr . '/' . chomp($repo);
+ close($url_fh);
+ system(
+ '/usr/local/bin/dash',
+ '-c',
+ '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'url'
+ );
exit;
}