error: %post(yum-3.2.8-11.2.x86_64) scriptlet failed

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

error: %post(yum-3.2.8-11.2.x86_64) scriptlet failed

Werner Flamme
Hi,

I updated yum via apt :-) and got:

warning: /etc/yum.repos.d/* moved to /etc/yum/repos.d/*
mv: cannot stat `/etc/yum.repos.d/*': No such file or directory
error: %post(yum-3.2.8-11.2.x86_64) scriptlet failed, exit status 1

Maybe a construct like
NOFFILES=$(LANG=C ls -lR /etc/yum.repos.d/ | tail -n 1 | cut -d' ' -f2)
if [ "$NOFFILES" -ne 0 ]; then ...
will avoid the error? ;-)

Regards,
Werner

--
Werner Flamme, Abt. WKDV
Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
Permoserstr. 15 - 04318 Leipzig
Tel.: (0341) 235-1921 - Fax (0341) 235-451921
http://www.ufz.de - eMail: [hidden email]
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: error: %post(yum-3.2.8-11.2.x86_64) scriptlet failed

Christoph Thiel
On Wed, Jan 23, 2008 at 03:58:24PM +0100, Werner Flamme wrote:

> I updated yum via apt :-) and got:
>
> warning: /etc/yum.repos.d/* moved to /etc/yum/repos.d/*
> mv: cannot stat `/etc/yum.repos.d/*': No such file or directory
> error: %post(yum-3.2.8-11.2.x86_64) scriptlet failed, exit status 1
>
> Maybe a construct like
> NOFFILES=$(LANG=C ls -lR /etc/yum.repos.d/ | tail -n 1 | cut -d' ' -f2)
> if [ "$NOFFILES" -ne 0 ]; then ...
> will avoid the error? ;-)

Any patch to the specfile will be greatly appreciated ;)


Best,
Christoph
--
Christoph Thiel, Tech. Project Management, Research & Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: error: %post(yum-3.2.8-11.2.x86_64) scriptlet failed

Pavol Rusnak-2
Christoph Thiel wrote:
> Any patch to the specfile will be greatly appreciated ;)

Problems is that expression /etc/yum.repos.d/* will expand to
/etc/yum.repos.d/* when there are no files in /etc/yum.repos.d
directory. Short hack is attached (not tested though :))

--
Best Regards / S pozdravom,

Pavol RUSNAK                                       SUSE LINUX, s.r.o
Package Maintainer                                Lihovarska 1060/12
PGP 0xA6917144                                     19000 Praha 9, CR
prusnak[at]suse.cz                                http://www.suse.cz

--- yum.spec
+++ yum.spec
@@ -136,10 +136,11 @@ if [ -e "$OCONF" ] ; then
     mv "$OCONF" "$NCONF"
 fi
 # migrate /etc/yum.repos.d to /etc/yum/repos.d/
-if [ -e "/etc/yum.repos.d" ] ; then
+if [ -d "/etc/yum.repos.d" ] ; then
     if [ ! -d "/etc/yum/repos.d" ] ; then
         mkdir "/etc/yum/repos.d"
     fi
+    if [ "/etc/yum.repos.d/*" != '/etc/yum.repos.d/*']; then
     for i in /etc/yum.repos.d/*;
     do
       NCONF="/etc/yum/repos.d/`basename $i`"
@@ -152,6 +153,7 @@ if [ -e "/etc/yum.repos.d" ] ; then
       echo "warning: $OCONF moved to $NCONF" >&2
       mv "$OCONF" "$NCONF"
     done
+    fi
 fi
 
 %clean
Reply | Threaded
Open this post in threaded view
|

Re: error: %post(yum-3.2.8-11.2.x86_64) scriptlet failed

Christoph Thiel
Thank you very much. Applied.


Best,
Christoph

On Wed, Jan 23, 2008 at 04:29:40PM +0100, Pavol Rusnak wrote:

> Christoph Thiel wrote:
> > Any patch to the specfile will be greatly appreciated ;)
>
> Problems is that expression /etc/yum.repos.d/* will expand to
> /etc/yum.repos.d/* when there are no files in /etc/yum.repos.d
> directory. Short hack is attached (not tested though :))
>
> --
> Best Regards / S pozdravom,
>
> Pavol RUSNAK                                       SUSE LINUX, s.r.o
> Package Maintainer                                Lihovarska 1060/12
> PGP 0xA6917144                                     19000 Praha 9, CR
> prusnak[at]suse.cz                                http://www.suse.cz

> --- yum.spec
> +++ yum.spec
> @@ -136,10 +136,11 @@ if [ -e "$OCONF" ] ; then
>      mv "$OCONF" "$NCONF"
>  fi
>  # migrate /etc/yum.repos.d to /etc/yum/repos.d/
> -if [ -e "/etc/yum.repos.d" ] ; then
> +if [ -d "/etc/yum.repos.d" ] ; then
>      if [ ! -d "/etc/yum/repos.d" ] ; then
>          mkdir "/etc/yum/repos.d"
>      fi
> +    if [ "/etc/yum.repos.d/*" != '/etc/yum.repos.d/*']; then
>      for i in /etc/yum.repos.d/*;
>      do
>        NCONF="/etc/yum/repos.d/`basename $i`"
> @@ -152,6 +153,7 @@ if [ -e "/etc/yum.repos.d" ] ; then
>        echo "warning: $OCONF moved to $NCONF" >&2
>        mv "$OCONF" "$NCONF"
>      done
> +    fi
>  fi
>  
>  %clean


--
Christoph Thiel, Tech. Project Management, Research & Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]