tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

directory migration on upgrade


I am packaging glusterfs-3.3.1 and I encounter a minor problem in the
upgrade scenario.

glusterfs-3.2.7 had its config in ${SYSCONFDIR}/glusterd
glusterfs-3.3.1 has its config in ${VARBASE}/lib/glusterd

I am not big fan of /var/lib stuff, but it seems wise to stick to
upstream approach. I understand the rationale is that the config file
should not be touched by hand and are modified only by command line
tools, hence the storage in /var

glusterfs 3.3.1 make install performa the migration: it checks for
${SYSCONFDIR}/glusterd being a directory, moves it to
${VARBASE}/lib/glusterd, and make a symlink from previous to new

How can I handle that in pkgsrc? I tried adding this at the end of

@exec test -d ${SYSCONFDIR}/glusterd -a ! -d ${VARBASE}/lib/glusterd &&
${MKDIR} -p ${VARBASE}/lib/ && mv ${SYSCONFDIR}/glusterd
${VARBASE}/lib/glusterd && ${LN} -s ${VARBASE}/lib/glusterd

This is the result at pkg_add time:

# pkg_add glusterfs
Executing 'test -d ${SYSCONFDIR}/glusterd -a ! -d
${VARBASE}/lib/glusterd && /bin/mkdir -p -p ${VARBASE}/lib/ && mv
${SYSCONFDIR}/glusterd  ${VARBASE}/lib/glusterd && /bin/ln -s
${VARBASE}/lib/glusterd  ${SYSCONFDIR}/glusterd'
pkg_add: command 'test -d ${SYSCONFDIR}/glusterd -a ! -d
${VARBASE}/lib/glusterd && /bin/mkdir -p -p ${VARBASE}/lib/ && mv
${SYSCONFDIR}/glusterd  ${VARBASE}/lib/glusterd && /bin/ln -s
${VARBASE}/lib/glusterd  ${SYSCONFDIR}/glusterd' failed

Any advice? How should it be done? Or should I just add a line about the
migration in MESSAGE?

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index