RE: mythweb 0.25.1-dmo1 won't install

トップ ページ

このメッセージに返信
著者: Mark Paulus
日付:  
To: dmo-discussion
題目: RE: mythweb 0.25.1-dmo1 won't install
> -----Original Message-----
> From: Christian Marillat [mailto:marillat@free.fr]
> Sent: Thursday, June 14, 2012 2:04 AM
> To: dmo-discussion@???
> Subject: Re: mythweb 0.25.1-dmo1 won't install
>
> "Mark Paulus" <mark.paulus@???> writes:
>
> > I’m running a Debian wheezy system, and I’m trying to install
> > mythplugins-0.25.1, and
> >
> > it won’t install.
> >
> > The error is:
> >
> > Setting up mythweb (0.25.1-dmo1) …
> >
> > mv: cannot stat ‘/usr/share/mythtv/mythweb/data/*’: No such file or
> > directory
> >
> > dpkg: error processing mythweb (--configure):
> >
> > Here is the patch I created to fix this problem:
> >
> > --- mythweb.postinst.orig       2012-06-12 22:39:12.000000000 -0400

> >
> > +++ mythweb.postinst    2012-06-12 22:32:32.000000000 -0400

> >
> > @@ -58,7 +58,10 @@
> >
> >         fi

> >
> >         # Move Data to new location

> >
> > -       if [ ! -L /usr/share/mythtv/mythweb/data ]; then

> >
> > +       if [ -d /var/lib/mythtv/mythweb/data  -a ! -d  /usr/share/mythtv/mythweb/data ]; then
> > +               cd /usr/share/mythtv/mythweb && ln -s /var/lib/mythtv/mythweb/data data
> > +               chown -R www-data:www-data /var/lib/mythtv/mythweb
> > +       elif [ ! -L /usr/share/mythtv/mythweb/data ]; then
> >                 mv /usr/share/mythtv/mythweb/data/* /var/lib/mythtv/mythweb/data
> >                 rmdir /usr/share/mythtv/mythweb/data
> >                 cd /usr/share/mythtv/mythweb && ln -s /var/lib/mythtv/mythweb/data data

>
> Bad patch.
>
> /var/lib/mythtv/mythweb/data is always here as this directory is in the package.
>
> ! -d /usr/share/mythtv/mythweb/data mean that data is a symlink and this doing another symlink will fail.
>
> Christian


Ok, then what's the best way to fix it?
Right now the code says:
if [ /usr/share/mythtv/mythweb/data is not a link ]; then # assuming it's actually a directory
    move the contents of the directory to /var/lib/mythtv/mythweb/data
    remove /usr/share mythtv/mythweb/data
    link /var/lib/mythtv/mythweb/data to /usr/share/mythtv/mythweb/data
fi


The Issue I see here is that this doesn't account for the fact that /usr/share/mythtv/mythweb/data
just flat out doesn't exist, because it's actually at /var/lib/mythtv/mythweb/data.
If the directory is ALWAYS at /var/lib/mythtv/mythweb/data, do we even need the
[ ! -L /usr/share/mythtv..... ] check at all, or can we always just do the link and chown?