Autopatch plugin need some testing

Duncan Gibson duncan.gibson at xs4all.nl
Sat Jun 30 11:10:38 CEST 2007


I wrote:
> ... but I don't quite see what the major advantage of a separate
> _patches directory outside zlocal will be.

    Oops. My mistake. That should have said zlocal/$MODULE. I didn't
    re-read the original message again while I worked on the draft
    and it snowballed.

ElAngelo gave an example of the use of _patches:
> For linux-2.6 i have a patch for reading the temps of my core2duo and
> I no longer need to edit that linux-2.6 module to make sure i run the
> latest and greatest kernel which is just marvelous... Especially in the
> case of the kernel as the minor updates are already patches so it would
> require way too much work to keep this going.

    Good. That was the sort of concrete example that I needed to get
    my head around the proposal. I'm not working at the leading edge
    or doing anything more than basic customisation of Lunar for my
    hardware.

Ratler explained the reason for the proposal:
> I expect that a lunar update will bump any outdated modules and if I
> have a local patch for one of those modules I want it to be applied if
> possible without the need to do lvu unedit && lvu edit again to get the
> latest changes. Thus the only sane option is to have _patches directory
> inside zlocal. Also it's a lot easier to find what custom patches you
> have for modules if they are in a seperate dir. Also if you accidently
> do a lvu unedit for a module containing _patches dir it will be gone as
> well, which is really bad. To circumvent that a patch for the core tool
> would be needed and I'm pretty sure sofar would say no to that.

    I'm not doing the level of system development that you are doing. I
    only have a few modules in zlocal at any time so it isn't too much
    effort to track them and keep them up to date if required. I don't
    have this problem of recurrent upgrades. If I submit the module and
    it is accepted, then I can remove my zlocal version. If a new module
    isn't added to the moonbase, then I have no update problems anyway.
    I also have a script that I use to see whether zlocal modules might
    need updating. I thought I'd posted it on a forum, but I can't find
    it anymore, so I'll append it at the bottom. No doubt you all have
    something similar already :-)

Cheers
Duncan / engelsman

#!/bin/sh

. /etc/lunar/config

if [[ "${ZLOCAL_OVERRIDES:-off}" != "on" ]] ; then
  echo "ZLOCAL_OVERRIDES != \"on\" so not checking further"
else
  for MODULE in $(list_modules zlocal); do
    ZVERSION="$(installed_version $MODULE)"
    if [ -z "$ZVERSION" ] ; then
      echo "zlocal/$MODULE (not installed!)"
    else
      LINE=$(grep "^$MODULE:" $MODULE_STATUS | awk -F: '{print "ZDATE="$2}')
      eval $LINE
      ZINFO="zlocal/$MODULE ($ZVERSION installed $ZDATE)"
      ZLOCAL_OVERRIDES="off"
      section="$(find_section $MODULE)"
      if [ -z "$section" -o "$section" == "zlocal" ] ; then
        echo "$ZINFO"
      else
        run_details $MODULE > /dev/null
        MINFO="$section/$MODULE ($VERSION updated $UPDATED)"
        if [ "$ZDATE" -lt "$UPDATED" ] ; then
          echo "$ZINFO  older than  $MINFO"
        else
          echo "$ZINFO  newer than  $MINFO"
        fi
      fi
      ZLOCAL_OVERRIDES="on"
    fi
  done
fi





More information about the Lunar-dev mailing list