Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally mark locally installed versions #6

Open
josephwright opened this issue Jun 25, 2017 · 7 comments
Open

Optionally mark locally installed versions #6

josephwright opened this issue Jun 25, 2017 · 7 comments
Assignees
Milestone

Comments

@josephwright
Copy link
Member

It would be useful to have install also optionally apply setversion so for example \listfiles will clearly show that development versions are in use.

@FrankMittelbach
Copy link
Member

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

@wspr
Copy link
Contributor

wspr commented Dec 28, 2017

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.

@josephwright
Copy link
Member Author

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.

@FrankMittelbach
Copy link
Member

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

@josephwright
Copy link
Member Author

@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.

@josephwright
Copy link
Member Author

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

@josephwright
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants