Console: Move modified flags to new directory,

in prep for symlinking original flags dir to package
for package installs (ticket #2270)
This commit is contained in:
zzz
2018-06-26 19:11:53 +00:00
parent 2d24f21327
commit baa11d8146
19 changed files with 28 additions and 16 deletions

View File

@@ -11,21 +11,34 @@
* flags.jsp?c=de => icons/flags/de.png * flags.jsp?c=de => icons/flags/de.png
* flags.jsp?c=de&s=48 => icons/flags48x48/de.png * flags.jsp?c=de&s=48 => icons/flags48x48/de.png
* with headers set so the browser caches. * with headers set so the browser caches.
*
* As of 0.9.36:
* All new and changed flags must go in the flags16x11/ dir,
* which will be checked first by flags.jsp.
* The flags/ dir is the original set from famfamfam,
* which may be symlinked in package installs.
*
*/ */
String c = request.getParameter("c"); String c = request.getParameter("c");
if (c != null && if (c != null &&
(c.length() == 2 || c.length() == 7) && (c.length() == 2 || c.length() == 7) &&
c.replaceAll("[a-z0-9_]", "").length() == 0) { c.replaceAll("[a-z0-9_]", "").length() == 0) {
String flagSet = "flags"; String flagSet = "flags16x11";
String s = request.getParameter("s"); String s = request.getParameter("s");
if ("48".equals(s)) { if ("48".equals(s)) {
flagSet = "flags48x48"; flagSet = "flags48x48";
} }
java.io.OutputStream cout = response.getOutputStream(); java.io.OutputStream cout = response.getOutputStream();
String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath(); String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath() +
String file = "docs" + java.io.File.separatorChar + "icons" + java.io.File.separatorChar + java.io.File.separatorChar +
flagSet + java.io.File.separatorChar + c + ".png"; "docs" + java.io.File.separatorChar + "icons";
String file = flagSet + java.io.File.separatorChar + c + ".png";
java.io.File ffile = new java.io.File(base, file); java.io.File ffile = new java.io.File(base, file);
if (!ffile.exists()) {
// fallback to flags dir, which will be symlinked to /usr/share/flags/countries/16x11 for package builds
file = "flags" + java.io.File.separatorChar + c + ".png";
ffile = new java.io.File(base, file);
}
long lastmod = ffile.lastModified(); long lastmod = ffile.lastModified();
if (lastmod > 0) { if (lastmod > 0) {
long iflast = request.getDateHeader("If-Modified-Since"); long iflast = request.getDateHeader("If-Modified-Since");

View File

@@ -1330,11 +1330,9 @@
</copy> </copy>
<copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" /> <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
<copy todir="pkg-temp/docs/icons/flags" > <copy todir="pkg-temp/docs/icons/flags" >
<!-- base flags/ dir only. flags16x11/ and flags48x48/ dirs already copied by prepConsoleDocs target -->
<fileset dir="installer/resources/icons/flags" /> <fileset dir="installer/resources/icons/flags" />
</copy> </copy>
<copy todir="pkg-temp/docs/icons/flags48x48" >
<fileset dir="installer/resources/icons/flags48x48" />
</copy>
</target> </target>
<target name="copyjetty" depends="copyjetty-unlesspkg" > <target name="copyjetty" depends="copyjetty-unlesspkg" >
@@ -1496,10 +1494,14 @@
<copy todir="pkg-temp/docs/" > <copy todir="pkg-temp/docs/" >
<fileset dir="installer/resources/readme/" includes="readme*.html" /> <fileset dir="installer/resources/readme/" includes="readme*.html" />
<fileset dir="installer/resources/proxy/" includes="*.ht" /> <fileset dir="installer/resources/proxy/" includes="*.ht" />
<!-- lang_ar.png added in 0.8.4; a1,a2,je, and eu.png added in 0.8.9; gg.png added in 0.8.10; <!--
im.png added in 0.8.12; cw.png added in 0.9.5; ap,bl,bq,ss,sx added in 0.9.21; As of 0.9.36:
lang_gl added in 0.9.28; a0.png added in 0.9.31 --> All new and changed flags must go in the flags16x11/ dir,
<fileset dir="installer/resources/" includes="icons/flags/lang_ar.png icons/flags/gg.png icons/flags/je.png icons/flags/eu.png icons/flags/im.png icons/flags/a1.png icons/flags/a2.png icons/flags/cw.png icons/flags/ap.png icons/flags/bl.png icons/flags/bq.png icons/flags/ss.png icons/flags/sx.png icons/flags/lang_gl.png icons/flags/a0.png" /> which will be checked first by flags.jsp.
The flags/ dir is the original set from famfamfam,
which may be symlinked in package installs.
-->
<fileset dir="installer/resources/" includes="icons/flags16x11/*" />
<!-- flags48x48 added in 0.9.32 --> <!-- flags48x48 added in 0.9.32 -->
<fileset dir="installer/resources/" includes="icons/flags48x48/*" /> <fileset dir="installer/resources/" includes="icons/flags48x48/*" />
</copy> </copy>
@@ -2726,11 +2728,8 @@
<fileset dir="installer/resources/themes/console/images/" /> <fileset dir="installer/resources/themes/console/images/" />
</copy> </copy>
<!-- FLAGs for language icon (not for ip)--> <!-- FLAGs for language icon (not for ip)-->
<copy todir="pkg-temp/docs/icons/flags" > <copy todir="pkg-temp/docs/icons" >
<fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" /> <fileset dir="installer/resources/icons" />
</copy>
<copy todir="pkg-temp/docs/icons/flags48x48" >
<fileset dir="installer/resources/icons/flags48x48" />
</copy> </copy>
<mkdir dir="pkg-temp/webapps" /> <mkdir dir="pkg-temp/webapps" />
<copy todir="pkg-temp/webapps/"> <copy todir="pkg-temp/webapps/">

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 143 B

View File

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 143 B

View File

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 143 B

View File

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

View File

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 435 B

View File

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 347 B

View File

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 697 B

View File

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 469 B

View File

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 418 B

View File

Before

Width:  |  Height:  |  Size: 413 B

After

Width:  |  Height:  |  Size: 413 B

View File

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 491 B

View File

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 228 B

View File

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 459 B

View File

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 418 B

View File

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 333 B

View File

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 377 B