mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
Add helper scripts for packaging
This commit is contained in:
parent
e40eab97ee
commit
506e08eb82
2 changed files with 87 additions and 0 deletions
23
tools/check_so_changes.sh
Executable file
23
tools/check_so_changes.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ $# -eq 1 ] && since=$1 || {
|
||||
since=$(git describe --tags | cut -d'-' -f1)
|
||||
since=$(git show $since | sed '/Date/!d;s/Date: *//')
|
||||
}
|
||||
|
||||
check_changes()
|
||||
{
|
||||
git fetch origin
|
||||
changes=$(git log --pretty=oneline --since="$since" --remotes -- c_src | wc -l)
|
||||
[ $((changes)) -eq 0 ] || echo "* $1"
|
||||
}
|
||||
|
||||
echo "Checking library changes since $since..."
|
||||
for dep in deps/*/c_src
|
||||
do
|
||||
cd ${dep%/c_src}
|
||||
check_changes $(echo $dep | cut -d'/' -f2)
|
||||
cd ../..
|
||||
done
|
||||
check_changes jlib
|
||||
echo "Done."
|
64
tools/generate-guide-html.pl
Executable file
64
tools/generate-guide-html.pl
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use File::Slurp;
|
||||
use IPC::Run3;
|
||||
|
||||
my $index = read_file("content/admin/guide/index.md");
|
||||
my @files;
|
||||
my %refs;
|
||||
my $idx = 0;
|
||||
|
||||
while ($index =~ /\[.*?\]\[(.*?)\]/g) {
|
||||
$refs{$1} = $idx++;
|
||||
}
|
||||
|
||||
while ($index =~ /\[(.*?)\]:\s*(\S+)/g) {
|
||||
$files[$refs{$1}] = $2 if exists $refs{$1};
|
||||
}
|
||||
|
||||
my @css = ("static/shared/css/docs.style.min.css", "static/shared/css/pygments.min.css");
|
||||
my $css = join("\n", map {read_file($_)} @css);
|
||||
|
||||
$css.= "
|
||||
.TOC { float: left; width: 20% }
|
||||
#content { float: left; width: 70%; }
|
||||
code {
|
||||
background: inherit;
|
||||
color: inherit;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-size: inherit !important;
|
||||
font-family: inherit;
|
||||
}
|
||||
";
|
||||
$css =~ s/\n/\n /g;
|
||||
|
||||
my $in;
|
||||
|
||||
$in="---
|
||||
title: ejabberd Installation and Operation Guide
|
||||
bodyclass: nocomment
|
||||
HTML header: <style>$css</style>
|
||||
---
|
||||
|
||||
{{TOC}}
|
||||
<div id='content'>
|
||||
";
|
||||
|
||||
$idx = 1;
|
||||
for (@files) {
|
||||
s/\/$/.md/;
|
||||
my $content = read_file("content".$_);
|
||||
$content =~ s/^---.*?---\s*//s;
|
||||
$content =~ s/\[(.*?)\]\[(.*?)\]/[$1][$idx$2]/g;
|
||||
$content =~ s/\[(.*?)\]:/[$idx$1]:/g;
|
||||
$in.= "$content\n\n";
|
||||
$idx++;
|
||||
}
|
||||
my $out;
|
||||
run3("multimarkdown", \$in, \$out, \undef);
|
||||
|
||||
$out =~ s/class="TOC"/id="sidebar" class="TOC"/;
|
||||
|
||||
write_file("guide.html", $out);
|
Loading…
Add table
Add a link
Reference in a new issue