Switch branches/tags
Nothing to show
Commits on Feb 6, 2014
  1. replace_ext: fix matching of "any" old ext

    peff committed Feb 6, 2014
    If you pass undef as the "old" extension parameter, we will
    match any extension that does not contain a dot. We use a
    regex to do so, but it does not work; we quote the user's
    input via \Q, and therefore accidentally quote our regex.
Commits on Oct 2, 2013
  1. consistently order output of MFM::targets

    peff committed Oct 2, 2013
    We tried to sort on "$a cmp $b", but for objects that seems
    to give semi-random ordering (even though stringification is
    overloaded, it seems to use the perl pointer value).
    This mean that finalize() calls were run in a random order,
    meaning that gitignore would sometimes run before
    MFM-TARGETS, and miss that it should be part of @CLEAN.
    This should at least give us a consistent sort (and we do
    not need to bother with priorities for this particular bug
    because the names happen to sort as we want...yikes). It
    also means we can drop the ad-hoc sorting in the Makefile
Commits on Feb 1, 2012
  1. rules/doc: add binman ruleset

    peff committed Feb 1, 2012
    This is like install's allbin rule. It means "every binary
    has documentation in man1".
  2. rules: add manpage installation rules

    peff committed Feb 1, 2012
    These get the list of files from the 'man' target, so they
    are independent of the method used to create the manpages
    (the only ruleset which provides a compatible creation
    scheme now is the asciidoc/man set).
  3. rules/install: handle multiple hier functions

    peff committed Feb 1, 2012
    You can now build a hier.shlib file that has multiple hier
    functions, and trigger only a subset of them by running
    "do_install foo" (which will run hier_foo).
    This allows you to use the same script for things like
    manpage installation (which should not be required for
    installing the rest of the package).
Commits on Jan 31, 2012
  1. rules: add asciidoc man-building rules

    peff committed Jan 31, 2012
    These are ported from the fuzzydups repository, which was
    already doing something similar.
  2. rules/shell/install: be more flexible with basenames

    peff committed Jan 31, 2012
    When the hier function asks us to do:
      c /dest/path foo/bar
    we always try to write to /dest/path/foo/bar. This may not
    make sense if the "foo" part of the source path is some
    internal organization in the project, and we may want to
    write "dest/path/bar".
    Changing "c" to require the full path would not be backwards
    compatible. Therefore, we introduce a new "cb" (for
    "c-basename") function that does expect the full path. And
    it is trivial to implement "c" in terms of it.
Commits on May 3, 2011
  1. bootstrap: fix breakage with $VERSION

    peff committed May 3, 2011
    Bootstrapping has been broken since 45a7096, when we
    introduced the use of the version.plib file. This file was
    not included in the bootstrap run, causing perl to
    rightfully complain about undefined variables.
    Actually building and including it for the bootstrap is sort
    of a chicken-and-egg problem. The simplest thing is to just
    provide a "fake" version file for running the bootstrap.
Commits on Apr 10, 2011
  1. gitversion: drop leading "v"

    peff committed Apr 10, 2011
    If you use tags of the form "v1.0", let's drop the "v". It
    gives much nicer tarballs like "mfm-0.9" instead of
  2. mfm: build MFM-VERSION if dist is requested

    peff committed Apr 10, 2011
    Until now, we just assumed that MFM-VERSION was a static
    file. But with the gitversion ruleset, it may actually be
  3. mfm: provide version command

    peff committed Apr 10, 2011
    It's nice to know which version of mfm you're on, so let's
    encode it into the script at build time. This is mostly
    simple because of the recently-added rulesets.
  4. rules: add version.plib ruleset

    peff committed Apr 10, 2011
    This just builds a nice version.plib file from the
    MFM-VERSION file, handy for embedding in your program.
  5. rules: add gitversion package

    peff committed Apr 10, 2011
    This just creates the MFM-VERSION file based on the output
    of git-describe. It reads the package name from MFM-PACKAGE;
    arguably these should be totally separate, and MFM-VERSION
    should have _just_ the version. And I'm tempted to switch
    that, but it's kind of nice to just have a single file that
    ships in a dist tarball, which pollutes the directory a
    little less.
    We build the version file while mfm is run, rather than in
    the Makefile. I was tempted to do it later, but:
      1. It's nice to have it available immediately for
         "mfm dist".
      2. We don't have a proper dependency for it, anyway,
         so are choices are to build every time, or never build
         after the first time. The latter is unacceptably
         infrequent. The former would work, but we would have to
         do a lot of magic not to cascade the update when it
         hasn't actually changed.
  6. rules: allow field specifier in rule=replace

    peff committed Apr 10, 2011
    The rule=replace input assumes you have one data item per
    line. Sometimes you may also have several field separated by
    whitespace, and it's useful to pick them out individually.
    You could also, of course, have another delimiter, but I'm
    ignoring that in the interests of keeping the code simple
    (and one can always write a custom rule in that case).
  7. rules: refactor rule=replacesh into a generic form

    peff committed Apr 10, 2011
    This is a generally useful function for replacing tokens in
    other languages (like perl), or data files. Let's pull it
    out into its own rule, rule=replace.  We can then implement
    replacesh in terms of replace.
    We also add one minor feature: the input file line in the
    ruledata can now specify multiple files. This is necessary
    for rule=replacesh to be able to be implemented no top (it
    needs to include, too).
  8. let 'alias' commands specify ruledata

    peff committed Apr 10, 2011
    If a rule takes ruledata and wants to use alias, it may want
    to pass the ruledata along to the aliased version.
    It's tempting to automatically just pass along "$RULEDATA",
    but I want to keep the door open for rules which might want
    to use a slightly different or modified $RULEDATA.
  9. simpleio: read scalar refs literally

    peff committed Apr 10, 2011
    We already handle a scalar being passed (and treat it as a
    filename), or a literal filehandle being passed. This adds
    scalar refs, which are dereferenced and their contents read
    You could also do this already with IO::String, but for such
    a simple action, it's nice not to worry about the
  10. simpleio: refactor cat_scalar to avoid IO::File

    peff committed Apr 10, 2011
    There's no need to use IO::File when we could just use
    regular "open". Plus the refactoring will make it easier to
    add new features.
    We can also drop the manual "$len" parameter, since perl
    tracks that for us already.
  11. simpleio: actually cat files in cat_scalar

    peff committed Apr 10, 2011
    We correctly slurped entire files, but we would quit after
    hitting eof on the first file, meaning we didn't concatenate
    anything. This never came up because I tend to use cat on a
    single file, but the name and the code clearly imply that it
    should be handling multiple files.
Commits on Mar 21, 2011
  1. try all possible extensions when looking for rules

    peff committed Mar 21, 2011
    We previously just tried the final extension, so something
    like "" would find only "".
    Instead, we should try each of:
    I'm still unsure of the precedence ordering (which is
    currently as shown above). Matching the longer one seems the
    most sensible, though it is vulnerable to false positives if
    an intended base has dots in it.
  2. fix non-method function call without parentheses

    peff committed Mar 21, 2011
    Perl complains about this is as a bareword under use strict.
Commits on Feb 21, 2011
  1. add a README

    peff committed Feb 21, 2011
    This is mostly duplicating what's in Documentation/overview,
    but I wanted something for the github page. And the whole
    overview is a bit much.
    The important new content here is instructions on
  2. docs: update to use MFM-*

    peff committed Feb 21, 2011
    This filename change happened quite a while ago, but the
    documentation was never updated.
  3. mfm: use recursive copy on dist directories

    peff committed Feb 21, 2011
    These may be mentioned in the MFM-EXTRA file. We can also
    drop the error-checking, as SimpeIO::Copy will always die on
  4. c: add

    peff committed Feb 21, 2011
    Ported from mmake. This is just a basic "turn conf-foo into
    foo.lib" helper.
  5. c: fix broken .lib handling in rule=x

    peff committed Feb 21, 2011
    This was a mis-port from the mmake rules. I accidentally
    converted a "`cat $_`" into cat($_), thinking I was avoiding
    a needless shell invocation. But of course this is perl, not
    shell, so that shell invocation was not happening now, but
    rather was being written into the Makefile.
    Which is what obviously needs to happen, since reading the
    contents of the lib file is only useful when you're actually
Commits on Jan 22, 2011
  1. latex: add ps2pdf ruleset

    peff committed Jan 22, 2011
    For some reason, dvipdf cuts off the bottom of my slides.
    I'm sure there is a real fix, but a workaround in the
    meantime is to convert via ps.
  2. latex: add convert rule

    peff committed Jan 22, 2011
    This just calls imagemagick's convert. The old mmake module
    automagically detected that this should happen, but that was
    often at odds with things like dia. So let's just use an
    explicit rule.
Commits on Sep 27, 2010
  1. perl/open: return pid from open2_socket

    peff committed Sep 27, 2010
    I omitted this initially because it's a little nicer
    syntactically to return the socket instead of filling in a
    passed-in variable. However, it can be useful to have the
    spawned pid available for killing. Let's just wantarray to
    let only those callers who are interested access it.
Commits on Sep 26, 2010
  1. run finalize code in a more sane environment

    peff committed Sep 26, 2010
    We simply ran the finalize code in the regular mfm
    environment. This worked fine for the single user, which
    just wrote out the MFM-TARGETS file. However, it is
    reasonable for a rule to want to call something like
    "formake" in the finalize subroutine. Previously this would
    fail because $TARGET was not set properly. This patch sets
    $TARGET properly so that the finalize subroutine runs with
    it set, meaning it can use regular MFM calls.
    Furthermore, we didn't wrap exceptions at all, so they
    appeared to be root mfm errors. We should at least wrap them
    in an Error::Parent to mention which rule triggered the
  2. clean: add MFM-TARGETS to FILES list

    peff committed Sep 26, 2010
    We depend on this for running "make clean", so we want to
    make sure it gets shipped in "mfm dist". We put the change in instead of in because not all users
    of MFM-TARGETS will necessarily want to ship it (only those
    that ship a rule that looks at it).
Commits on Sep 7, 2010
  1. dist: fix file::copy type problems

    peff committed Sep 7, 2010
    When doing "mfm dist", we feed the @FILES list to
    File::Copy. However, that list is a mix of string filenames
    and actual MFM::Target objects. Because MFM::Target
    stringifies to the filename, in most cases this Just Works.
    However, older versions of File::Copy get confused and die.
    Let's just stringify the names manually, which takes care of
    this problem. Arguably the @FILES list should be _just_
    filenames in the first place, but it is very handy to do
    things like:
      push @FILES, $TARGET;
Commits on Aug 30, 2010
  1. add IPC::Open2::Socket module

    peff committed Aug 30, 2010
    This is basically IPC::Open2, except it uses a socketpair
    instead of separate read/write handles. That makes it easy
    to hand the resulting filehandle to modules expecting to
    talk on a socket.
  2. add shell/portability rules

    peff committed Aug 30, 2010
    These are straight from mmake; they're used by the etc
    project. Arguably "which" should be dropped, as type is
    probably more portable, but I don't use too many obscure
    systems these days, so I can't even test.
  3. add dist command

    peff committed Aug 30, 2010
    This is similar to the old "mmake dist" command. It's handy
    for making a distribution tarball. I have a few
    reservations, though:
      1. The dist command combines building and creating the
         tarball. The intent of combining is that you may want
         to borrow different files for the "dist" version (e.g.,
         ignore local rule repositories that set conf-home). The
         mmake version set MMAKE_DIST. What is the best way here
         to communicate that we are in "dist mode". Should we
         just set a flag and let user code take care of it?
         Should user code be able to mark some rule paths as
         I've left this bit unimplemented for now.
      2. Copying the entire directory structure seems wasteful,
         but is the only way to prefix the directory name using
         tar. I looked at Archive::Tar, but it is awful for
         pulling data into memory. For most projects, it would
         be fine, but this should scale properly. I could write
         my own tar code, but that seems like a maintenance
      3. It's not very configurable. At the very least, I can
         imagine wanting bzip dists. Perhaps the whole thing
         should be a "dist" target in the Makefile, but then the
         whole "do a dist mfm" doesn't quite work.