From baa11d8146a89089fd13ac9d2cb07a0f739cc7e0 Mon Sep 17 00:00:00 2001 From: zzz Date: Tue, 26 Jun 2018 19:11:53 +0000 Subject: [PATCH] Console: Move modified flags to new directory, in prep for symlinking original flags dir to package for package installs (ticket #2270) --- apps/routerconsole/jsp/flags.jsp | 21 +++++++++++++--- build.xml | 23 +++++++++--------- .../icons/{flags => flags16x11}/a0.png | Bin .../icons/{flags => flags16x11}/a1.png | Bin .../icons/{flags => flags16x11}/a2.png | Bin .../icons/{flags => flags16x11}/ap.png | Bin .../icons/{flags => flags16x11}/bl.png | Bin .../icons/{flags => flags16x11}/bq.png | Bin .../icons/{flags => flags16x11}/ch.png | Bin .../icons/{flags => flags16x11}/cw.png | Bin .../icons/{flags => flags16x11}/eu.png | Bin .../icons/{flags => flags16x11}/gg.png | Bin .../icons/{flags => flags16x11}/im.png | Bin .../icons/{flags => flags16x11}/je.png | Bin .../icons/{flags => flags16x11}/lang_ar.png | Bin .../icons/{flags => flags16x11}/lang_gl.png | Bin .../icons/{flags => flags16x11}/np.png | Bin .../icons/{flags => flags16x11}/ss.png | Bin .../icons/{flags => flags16x11}/sx.png | Bin 19 files changed, 28 insertions(+), 16 deletions(-) rename installer/resources/icons/{flags => flags16x11}/a0.png (100%) rename installer/resources/icons/{flags => flags16x11}/a1.png (100%) rename installer/resources/icons/{flags => flags16x11}/a2.png (100%) rename installer/resources/icons/{flags => flags16x11}/ap.png (100%) rename installer/resources/icons/{flags => flags16x11}/bl.png (100%) rename installer/resources/icons/{flags => flags16x11}/bq.png (100%) rename installer/resources/icons/{flags => flags16x11}/ch.png (100%) rename installer/resources/icons/{flags => flags16x11}/cw.png (100%) rename installer/resources/icons/{flags => flags16x11}/eu.png (100%) rename installer/resources/icons/{flags => flags16x11}/gg.png (100%) rename installer/resources/icons/{flags => flags16x11}/im.png (100%) rename installer/resources/icons/{flags => flags16x11}/je.png (100%) rename installer/resources/icons/{flags => flags16x11}/lang_ar.png (100%) rename installer/resources/icons/{flags => flags16x11}/lang_gl.png (100%) rename installer/resources/icons/{flags => flags16x11}/np.png (100%) rename installer/resources/icons/{flags => flags16x11}/ss.png (100%) rename installer/resources/icons/{flags => flags16x11}/sx.png (100%) diff --git a/apps/routerconsole/jsp/flags.jsp b/apps/routerconsole/jsp/flags.jsp index 2e87c2ccd..49cd0deb3 100644 --- a/apps/routerconsole/jsp/flags.jsp +++ b/apps/routerconsole/jsp/flags.jsp @@ -11,21 +11,34 @@ * flags.jsp?c=de => icons/flags/de.png * flags.jsp?c=de&s=48 => icons/flags48x48/de.png * 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"); if (c != null && (c.length() == 2 || c.length() == 7) && c.replaceAll("[a-z0-9_]", "").length() == 0) { - String flagSet = "flags"; + String flagSet = "flags16x11"; String s = request.getParameter("s"); if ("48".equals(s)) { flagSet = "flags48x48"; } java.io.OutputStream cout = response.getOutputStream(); - String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath(); - String file = "docs" + java.io.File.separatorChar + "icons" + java.io.File.separatorChar + - flagSet + java.io.File.separatorChar + c + ".png"; + String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath() + + java.io.File.separatorChar + + "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); + 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(); if (lastmod > 0) { long iflast = request.getDateHeader("If-Modified-Since"); diff --git a/build.xml b/build.xml index bc667218b..e4cca1a23 100644 --- a/build.xml +++ b/build.xml @@ -1330,11 +1330,9 @@ + - - - @@ -1496,10 +1494,14 @@ - - + + @@ -2726,11 +2728,8 @@ - - - - - + + diff --git a/installer/resources/icons/flags/a0.png b/installer/resources/icons/flags16x11/a0.png similarity index 100% rename from installer/resources/icons/flags/a0.png rename to installer/resources/icons/flags16x11/a0.png diff --git a/installer/resources/icons/flags/a1.png b/installer/resources/icons/flags16x11/a1.png similarity index 100% rename from installer/resources/icons/flags/a1.png rename to installer/resources/icons/flags16x11/a1.png diff --git a/installer/resources/icons/flags/a2.png b/installer/resources/icons/flags16x11/a2.png similarity index 100% rename from installer/resources/icons/flags/a2.png rename to installer/resources/icons/flags16x11/a2.png diff --git a/installer/resources/icons/flags/ap.png b/installer/resources/icons/flags16x11/ap.png similarity index 100% rename from installer/resources/icons/flags/ap.png rename to installer/resources/icons/flags16x11/ap.png diff --git a/installer/resources/icons/flags/bl.png b/installer/resources/icons/flags16x11/bl.png similarity index 100% rename from installer/resources/icons/flags/bl.png rename to installer/resources/icons/flags16x11/bl.png diff --git a/installer/resources/icons/flags/bq.png b/installer/resources/icons/flags16x11/bq.png similarity index 100% rename from installer/resources/icons/flags/bq.png rename to installer/resources/icons/flags16x11/bq.png diff --git a/installer/resources/icons/flags/ch.png b/installer/resources/icons/flags16x11/ch.png similarity index 100% rename from installer/resources/icons/flags/ch.png rename to installer/resources/icons/flags16x11/ch.png diff --git a/installer/resources/icons/flags/cw.png b/installer/resources/icons/flags16x11/cw.png similarity index 100% rename from installer/resources/icons/flags/cw.png rename to installer/resources/icons/flags16x11/cw.png diff --git a/installer/resources/icons/flags/eu.png b/installer/resources/icons/flags16x11/eu.png similarity index 100% rename from installer/resources/icons/flags/eu.png rename to installer/resources/icons/flags16x11/eu.png diff --git a/installer/resources/icons/flags/gg.png b/installer/resources/icons/flags16x11/gg.png similarity index 100% rename from installer/resources/icons/flags/gg.png rename to installer/resources/icons/flags16x11/gg.png diff --git a/installer/resources/icons/flags/im.png b/installer/resources/icons/flags16x11/im.png similarity index 100% rename from installer/resources/icons/flags/im.png rename to installer/resources/icons/flags16x11/im.png diff --git a/installer/resources/icons/flags/je.png b/installer/resources/icons/flags16x11/je.png similarity index 100% rename from installer/resources/icons/flags/je.png rename to installer/resources/icons/flags16x11/je.png diff --git a/installer/resources/icons/flags/lang_ar.png b/installer/resources/icons/flags16x11/lang_ar.png similarity index 100% rename from installer/resources/icons/flags/lang_ar.png rename to installer/resources/icons/flags16x11/lang_ar.png diff --git a/installer/resources/icons/flags/lang_gl.png b/installer/resources/icons/flags16x11/lang_gl.png similarity index 100% rename from installer/resources/icons/flags/lang_gl.png rename to installer/resources/icons/flags16x11/lang_gl.png diff --git a/installer/resources/icons/flags/np.png b/installer/resources/icons/flags16x11/np.png similarity index 100% rename from installer/resources/icons/flags/np.png rename to installer/resources/icons/flags16x11/np.png diff --git a/installer/resources/icons/flags/ss.png b/installer/resources/icons/flags16x11/ss.png similarity index 100% rename from installer/resources/icons/flags/ss.png rename to installer/resources/icons/flags16x11/ss.png diff --git a/installer/resources/icons/flags/sx.png b/installer/resources/icons/flags16x11/sx.png similarity index 100% rename from installer/resources/icons/flags/sx.png rename to installer/resources/icons/flags16x11/sx.png