Bläddra i källkod

add latest packages

ruki 4 år sedan
förälder
incheckning
1ca5686a45
4 ändrade filer med 41 tillägg och 17 borttagningar
  1. 3 2
      _coverpage.md
  2. 23 1
      build.lua
  3. 12 12
      sitemap.xml
  4. 3 2
      zh-cn/_coverpage.md

+ 3 - 2
_coverpage.md

@@ -4,8 +4,9 @@
 
 > A cross-platform C/C++ package manager based on Xmake
 
-- Simple, lightweight, cross-platform
-- Modern C/C++ package manager, support distributed repositories
+- *Simple, lightweight, cross-platform*
+- *Modern C/C++ package manager, support distributed repositories*
+- **News: openexr, blosc, libelf**
 
 [Gitee](https://gitee.com/tboox/xrepo/)
 [Github](https://github.com/xmake-io/xrepo/)

+ 23 - 1
build.lua

@@ -279,6 +279,23 @@ function write_package(file, pkg, plat, archs)
     file:print("")
 end
 
+-- get latest added packages
+-- git -c pager.log=false log --diff-filter=A --stat --max-count=5 --format=%aD
+function latest_packages()
+    local latest  = {}
+    local results = os.iorunv("git -c pager.log=false log --diff-filter=A --stat --max-count=5 --format=%aD")
+    if results then
+        for _, line in ipairs(results:split('\n', {plain = true})) do
+            line = line:split('|')[1]
+            line = line:trim()
+            if line:endswith("xmake.lua") then
+                table.insert(latest, path.filename(path.directory(line)))
+            end
+        end
+    end
+    return table.slice(latest, 1, 3)
+end
+
 -- build packages
 function build_packages()
     -- clone xmake-repo
@@ -286,11 +303,12 @@ function build_packages()
     local repodir = path.join(os.tmpdir(), "xrepo-docs", "xmake-repo")
     print("clone %s => %s", url, repodir)
     os.tryrm(repodir)
-    git.clone(url, {depth = 1, outputdir = repodir})
+    git.clone(url, {outputdir = repodir})
 
     -- load packages
     os.cd(repodir)
     local packages = import("scripts.packages", {rootdir = repodir, anonymous = true})()
+    local latest = latest_packages()
     os.cd("-")
 
     -- get total packages
@@ -350,6 +368,10 @@ function build_packages()
         end
         file:close()
     end
+
+    -- generate latest added packages
+    io.gsub("_coverpage.md", "%*%*News:.*%*%*", "**News: " .. table.concat(latest, ", ") .. "**")
+    io.gsub("zh-cn/_coverpage.md", "%*%*News:.*%*%*", "**News: " .. table.concat(latest, ", ") .. "**")
 end
 
 -- main entry

+ 12 - 12
sitemap.xml

@@ -12,62 +12,62 @@
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/index.html</loc>
-  <lastmod>2020-11-01T11:11:10+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2020-11-01T11:11:10+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2020-11-01T11:11:11+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/msys.html</loc>
-  <lastmod>2020-11-01T11:11:11+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/macosx.html</loc>
-  <lastmod>2020-11-01T11:11:11+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/android.html</loc>
-  <lastmod>2020-11-01T11:11:11+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/windows.html</loc>
-  <lastmod>2020-11-01T11:11:11+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/bsd.html</loc>
-  <lastmod>2020-11-01T11:11:11+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/linux.html</loc>
-  <lastmod>2020-11-01T11:11:12+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/cross.html</loc>
-  <lastmod>2020-11-01T11:11:12+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/mingw.html</loc>
-  <lastmod>2020-11-01T11:11:12+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/iphoneos.html</loc>
-  <lastmod>2020-11-01T11:11:12+08:00</lastmod>
+  <lastmod>2020-11-01T13:28:59+08:00</lastmod>
 </url>
 
 </urlset>

+ 3 - 2
zh-cn/_coverpage.md

@@ -4,8 +4,9 @@
 
 > 一个基于 Xmake 的跨平台 C/C++ 包管理器
 
-- 简单,轻量,跨平台
-- 现代化的 C/C++ 包管理工具,分布式仓库支持
+- *简单,轻量,跨平台*
+- *现代化的 C/C++ 包管理工具,分布式仓库支持*
+- **News: openexr, blosc, libelf**
 
 [Gitee](https://gitee.com/tboox/xrepo/)
 [GitHub](https://github.com/xmake-io/xrepo/)