From a9068330419617b71437d0ce54de71205eabb814 Mon Sep 17 00:00:00 2001
From: Petr Baudis
Date: Tue, 10 Oct 2006 04:48:06 +0200
Subject: [PATCH] Support for README storing
---
TODO | 1 -
cgi/Git/RepoCGI.pm | 6 ++++++
cgi/p/editproj.cgi | 1 +
cgi/regproj.cgi | 1 +
clone.sh | 4 ++--
5 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/TODO b/TODO
index daa30a3..e69de29 100644
--- a/TODO
+++ b/TODO
@@ -1 +0,0 @@
-README.html
diff --git a/cgi/Git/RepoCGI.pm b/cgi/Git/RepoCGI.pm
index 5d4831c..a7720a4 100644
--- a/cgi/Git/RepoCGI.pm
+++ b/cgi/Git/RepoCGI.pm
@@ -223,6 +223,7 @@ our %propmap = (
url => 'base_url',
email => 'owner',
desc => 'description',
+ README => 'README',
hp => 'homepage',
);
@@ -408,6 +409,10 @@ sub cgi_fill {
length($self->{desc}) <= 1024
or $repo->err("Short description length > 1kb!");
+ $self->{README} = $repo->wparam('README');
+ length($self->{README}) <= 8192
+ or $repo->err("README length > 8kb!");
+
$self->{hp} = $repo->wparam('hp');
if ($self->{hp}) {
valid_web_url($self->{hp})
@@ -427,6 +432,7 @@ sub form_defaults {
email => $self->{email},
url => $self->{url},
desc => html_esc($self->{desc}),
+ README => html_esc($self->{README}),
hp => $self->{hp},
users => $self->{users},
);
diff --git a/cgi/p/editproj.cgi b/cgi/p/editproj.cgi
index 7be440e..a53a3a7 100755
--- a/cgi/p/editproj.cgi
+++ b/cgi/p/editproj.cgi
@@ -53,6 +53,7 @@ so perhaps you will need to click a lot.
Repository URL:
Description:
Homepage URL:
+
README (lt 8kb):
Users:
EOT
diff --git a/cgi/regproj.cgi b/cgi/regproj.cgi
index 28e8455..5aa44a2 100755
--- a/cgi/regproj.cgi
+++ b/cgi/regproj.cgi
@@ -61,6 +61,7 @@ and redistributing it does not violate any law of Czech Republic. Have fun!
E-mail contact:
Description:
Homepage URL:
+
README (lt 8kb):
Hosting mode:
Mirror mode. Repository URL:
Push mode.
diff --git a/clone.sh b/clone.sh
index b384228..0541c86 100755
--- a/clone.sh
+++ b/clone.sh
@@ -29,8 +29,8 @@ bang git clone --bare "$url" repodir
GIT_DIR=repodir bang git repack -a -d
! [ -d /srv/git/"$proj".git ]
bang mv repodir /srv/git/"$proj".git
-bang chmod g+w base_url owner description homepage
-bang mv base_url owner description homepage /srv/git/"$proj".git/
+bang chmod g+w base_url owner description homepage README
+bang mv base_url owner description homepage README /srv/git/"$proj".git/
cd .. && rm -r "$proj"
# NO bang AT THIS POINT! rm -r depends on cwd.
echo "Congratulations! You can adjust the project settings in the future at http://repo.or.cz/m/p/editproj.cgi." | mail -s "[repo.or.cz] $proj clone completed" "$mail",pasky@ucw.cz
--
2.11.4.GIT