List Info

Thread: upgrade when directory changes to symlink




upgrade when directory changes to symlink
user name
2007-04-09 05:53:42
rpm can't handle such situation (tested on 4.4.7 but it
seems that 4.4.9 has 
the same problem) where directory changes into symlink on
upgrade. See 
attached spec files.

Couldn't rpm deal with this situation ? Like mv dir
dir.rpmsave maybe?

[arekmtarm ~/rpm/SPECS]$ touch ../SOURCES/x
[arekmtarm ~/rpm/SPECS]$ rpmbuild -bb test1.spec
2>&1 | grep 'Wrote'
Wrote: /home/users/arekm/rpm/RPMS/test-1-1.i686.rpm
[arekmtarm ~/rpm/SPECS]$ rpmbuild -bb test2.spec
2>&1 | grep 'Wrote'
Wrote: /home/users/arekm/rpm/RPMS/test-1-2.i686.rpm
[arekmtarm ~/rpm/SPECS]$ sudo 
rpm -Uvh /home/users/arekm/rpm/RPMS/test-1-1.i686.rpm
Preparing...               
########################################### [100%]
   1:test                  
########################################### [100%]
[arekmtarm ~/rpm/SPECS]$ sudo 
rpm -Fvh /home/users/arekm/rpm/RPMS/test-1-2.i686.rpm
Preparing...               
########################################### [100%]
   1:test                  
########################################### [100%]
error: unpacking of archive failed on file /test: cpio:
rename failed - Is a 
directory
zsh: exit 1     sudo rpm -Fvh
/home/users/arekm/rpm/RPMS/test-1-2.i686.rpm
[arekmtarm ~/rpm/SPECS]$


-- 
Arkadiusz Mi¶kiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/

_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel

  
  
Re: upgrade when directory changes to symlink
country flaguser name
United States
2007-04-09 06:25:31
On Apr 9, 2007, at 6:53 AM, Arkadiusz Miskiewicz wrote:

>
> rpm can't handle such situation (tested on 4.4.7 but it
seems that  
> 4.4.9 has
> the same problem) where directory changes into symlink
on upgrade. See
> attached spec files.
>
> Couldn't rpm deal with this situation ? Like mv dir
dir.rpmsave maybe?
>

Use %pretrans
     mv dir dir.rpmsave
     ln -s dir.rpmsave dir

A general solution has to propagate the directory and all
its  
contents, checking
for ENOSPC and more , worrying abt multiple mount points
within the  
tree.

> [arekmtarm ~/rpm/SPECS]$ touch ../SOURCES/x
> [arekmtarm ~/rpm/SPECS]$ rpmbuild -bb test1.spec
2>&1 | grep 'Wrote'
> Wrote: /home/users/arekm/rpm/RPMS/test-1-1.i686.rpm
> [arekmtarm ~/rpm/SPECS]$ rpmbuild -bb test2.spec
2>&1 | grep 'Wrote'
> Wrote: /home/users/arekm/rpm/RPMS/test-1-2.i686.rpm
> [arekmtarm ~/rpm/SPECS]$ sudo
> rpm -Uvh /home/users/arekm/rpm/RPMS/test-1-1.i686.rpm
> Preparing...                 
> ########################################### [100%]
>    1:test                    
> ########################################### [100%]
> [arekmtarm ~/rpm/SPECS]$ sudo
> rpm -Fvh /home/users/arekm/rpm/RPMS/test-1-2.i686.rpm
> Preparing...                 
> ########################################### [100%]
>    1:test                    
> ########################################### [100%]
> error: unpacking of archive failed on file /test: cpio:
rename  
> failed - Is a
> directory
> zsh: exit 1     sudo rpm -Fvh
/home/users/arekm/rpm/RPMS/ 
> test-1-2.i686.rpm
> [arekmtarm ~/rpm/SPECS]$
>

Yep.

73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel

Re: upgrade when directory changes to symlink
user name
2007-04-09 10:56:37
On Monday 09 of April 2007, Jeff Johnson wrote:
> On Apr 9, 2007, at 6:53 AM, Arkadiusz Miskiewicz
wrote:
> > rpm can't handle such situation (tested on 4.4.7
but it seems that
> > 4.4.9 has
> > the same problem) where directory changes into
symlink on upgrade. See
> > attached spec files.
> >
> > Couldn't rpm deal with this situation ? Like mv
dir dir.rpmsave maybe?
>
> Use %pretrans
>      mv dir dir.rpmsave
>      ln -s dir.rpmsave dir
>
> A general solution has to propagate the directory and
all its
> contents, checking
> for ENOSPC and more , worrying abt multiple mount
points within the
> tree.

What if I do that in %pre? What's difference between doing
that in %pre 
and %pretrans in this case?

-- 
Arkadiusz Mi¶kiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel

Re: upgrade when directory changes to symlink
country flaguser name
United States
2007-04-09 11:01:54
On Apr 9, 2007, at 11:56 AM, Arkadiusz Miskiewicz wrote:

> On Monday 09 of April 2007, Jeff Johnson wrote:
>> On Apr 9, 2007, at 6:53 AM, Arkadiusz Miskiewicz
wrote:
>>> rpm can't handle such situation (tested on
4.4.7 but it seems that
>>> 4.4.9 has
>>> the same problem) where directory changes into
symlink on  
>>> upgrade. See
>>> attached spec files.
>>>
>>> Couldn't rpm deal with this situation ? Like mv
dir dir.rpmsave  
>>> maybe?
>>
>> Use %pretrans
>>      mv dir dir.rpmsave
>>      ln -s dir.rpmsave dir
>>
>> A general solution has to propagate the directory
and all its
>> contents, checking
>> for ENOSPC and more , worrying abt multiple mount
points within the
>> tree.
>
> What if I do that in %pre? What's difference between
doing that in % 
> pre
> and %pretrans in this case?
>

%pre is too late, rpm goes to great lengths to disambiguate
paths that
follow symlinks, essentially by stating every directory for
a  
(dev,inode) pair
in something that rpm calls a fingerprint.

So %pretrans before fingerprint creation is what is needed
to replace a
directory with a symlink.

73 de Jeff

_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )