Coder Social home page Coder Social logo

Comments (7)

FrankMittelbach avatar FrankMittelbach commented on May 12, 2024

yep, we spoke about that before didn't we?

from l3build.

wspr avatar wspr commented on May 12, 2024

My take on this is that we should simply add a customisation variable or two around unpack. The easiest way, I think, would be to allow something like

unpackfiles = {"*-local.ins"}
ctanunpackfiles = {"*-ctan.ins"}

where, say, siunitx-local.ins unpacks the version of the package with an added

\typeout{This is an unreleased version of siunitx!}

This means the customisation is all up to the user and doesn't need additional logic in l3build to handle inserting conditional lines of code.

from l3build.

josephwright avatar josephwright commented on May 12, 2024

To sort out plk/biblatex#374, we'll need to address code in the area of this issue and #40. I'm working on the biblatex stuff at the moment, so I'll probably address this at the same time.

from l3build.

FrankMittelbach avatar FrankMittelbach commented on May 12, 2024

is there "any" real use case of making this optional? I mean install really is always local, no?

from l3build.

josephwright avatar josephwright commented on May 12, 2024

@FrankMittelbach I was thinking mainly that for some packages (e.g. biblatex) there is never a checked-in version with a 'live' date, so there the logic is different from that needed by e.g. the kernel.

from l3build.

josephwright avatar josephwright commented on May 12, 2024

@FrankMittelbach Hoping to work on this later on today: let me see what looks 'good'!

from l3build.

josephwright avatar josephwright commented on May 12, 2024

I took a look at how we solved things for biblatex checking, which is basically the same issue. That was done by using checkinit_hook()`:

-- For auto-editing
local tagname = "v3.17"
local tagdate = os.date("%Y-%m-%d")

function checkinit_hook()
  local file = unpackdir .. "/biblatex.sty"
  local filename = basename(file)
  local f = assert(io.open(file,"rb"))
  local content = f:read("*all")
  f:close()
  -- Deal with Unix/Windows line endings
  content = string.gsub(content .. (string.match(content,"\n$") and "" or "\n"),
    "\r\n", "\n")
  local updated_content = update_tag(filename,content,tagname,tagdate)
  if content == updated_content then
    return 0
  else
    local path = dirname(file)
    ren(path,filename,filename .. ".bak")
    f = assert(io.open(file,"w"))
    -- Convert line ends back if required during write
    -- Watch for the second return value!
    f:write((string.gsub(updated_content,"\n",os_newline)))
    f:close()
    rm(path,filename .. ".bak")
  end
  cp("biblatex.sty",unpackdir,testdir)
  return 0
end

I think a similar hook would be the best plan: I'll look to add.

from l3build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.