Layman storage path changed from version 1.3.0 on

Anything that pertains to Portage

Moderator: Moderators

Layman storage path changed from version 1.3.0 on

Postby Fitzcarraldo » Mon Mar 01, 2010 20:23

Just a 'heads-up' for Portage users:

After doing an emerge --sync today, followed by an eselect news read all, I noticed the following bulletin regarding versions of layman from 1.3.0 on:

Code: Select all
2010-02-28-layman-storage-path-change
  Title                     Layman storage path changed from version 1.3.0 on
  Author                    Sebastian Pipping <[email protected]>
  Posted                    2010-02-28
  Revision                  1

Layman has been using /usr/local/portage/layman to store
overlay checkouts from version 1.2.3 on.  As that path 
was violating the concept of keeping portage away from
/usr/local the default of this storage location moves to

  /var/lib/layman

from version 1.3.0 on.  If you have never touched the file
/etc/layman/layman.cfg manually before, you may be tempted to let
tools like etc-update or dispatch-conf blindly accept this new version
of layman.cfg.

As that would hide all your currently installed overlays from layman
it's probably not what you want.  Your options are:

 A) Moving
   1. Move your current content to /var/lib/layman before upgrading.
   3. Update PORTDIR_OVERLAY in /var/lib/layman/make.conf accordingly.
   2. Make /etc/make.conf source /var/lib/layman/make.conf.

 B) A symlink
   Put a symlink to your current storage location at /var/lib/layman
   before upgrading layman.

 C) Configuration
   Reject the path change for layman.cfg when running tools like
   etc-update or dispatch-conf blindly.  Be aware with this way you'll
   have to do it for each layman update again.

PS: This news item is a reaction to users having run into this problem
(see bug #306233).  Thanks to Volker Hemmann for reporting.


As I hadn't merged layman for a while and my current version was still in the 1.2.* series, I did the following:

1. cp -r /usr/local/portage/layman /var/lib/layman

2. Changed /var/lib/layman/make.conf from:
Code: Select all
PORTDIR_OVERLAY="
/usr/local/portage/layman/sabayon
/usr/local/portage/layman/kde
$PORTDIR_OVERLAY
"

to:
Code: Select all
PORTDIR_OVERLAY="
/var/lib/layman/sabayon
/var/lib/layman/kde
$PORTDIR_OVERLAY
"

Of course your contents of /var/lib/layman/make.conf will depend on which overlays you have added. In my case, as you can see, I have the Sabayon overlay and the KDE Testing overlay added.

3. Changed the following line in /etc/make.conf from:
Code: Select all
source /usr/local/portage/layman/make.conf

to:
Code: Select all
source /var/lib/layman/make.conf


4. Changed the following line in /etc/layman/layman.cfg from:
Code: Select all
storage   : /usr/local/portage/layman

to:
Code: Select all
storage   : /var/lib/layman

(Actually I don't think Step 4 is necessary because, once you have merged layman-1.3.0 or greater, etc-update or despatch-conf will update /etc/layman/layman.cfg anyway, but I didn't want to take any chances.)

5. emerge -1v =layman-1.3.2-r1

6. etc-proposals
(If you are not familiar with etc-proposals then use etc-update or despatch-conf to update the config files.)

7. layman -S

8. eix-update

9. rm -rf /usr/local/portage/layman
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8077
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Layman storage path changed from version 1.3.0 on

Postby wolfden » Tue Mar 02, 2010 10:51

cp -r /usr/local/portage/layman /var/lib/layman


I think that should be
Code: Select all
cp -r /usr/local/portage/layman /var/lib/
otherwise one will end up with /var/lib/layman/layman

nice howto tho :D
wolfden
Sharecropper
 
Posts: 9051
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: Layman storage path changed from version 1.3.0 on

Postby Fitzcarraldo » Tue Mar 02, 2010 12:02

Are you sure about that, wolfden? Here's exactly what I typed, as reported by Bash's history command:

Code: Select all
438  emerge --sync
439  eselect news
440  eselect news read all
441  layman -S
442  layman -S
443  eix-update
444  eselect news read all
445  ls /usr/local/portage/layman
446  eselect news read allls /var/lib/layman
447  ls /var/lib/layman
448  cp --help
449  ls /usr/local/portage/layman
450  ls /usr/local/portage/layman
451  cp /usr/local/portage/layman /var/lib/layman
452  cp -r /usr/local/portage/layman /var/lib/layman
453  nano /var/lib/layman/make.conf
454  nano /etc/make.conf
455  nano /etc/layman/layman.cfg
456  eix layman
457  emerge -1v layman
458  etc-proposals
459  nano /etc/layman/layman.cfg
460  eix eix
461  emerge -1v eix
462  layman -S
463  eix eix
464  eix-update
465  nano /var/lib/layman/make.conf
466  nano /etc/make.conf
467  nano /etc/layman/layman.cfg
468  ls /usr/local/portage/layman/
469  rm -rf /usr/local/portage/layman


Notice command no. 451? I forgot the '-r' so it didn't copy the sub-directories.

Notice command no. 452? cp -r /usr/local/portage/layman /var/lib/layman which resulted in the following:

Code: Select all
acertm8215 ~ # cd /var/lib/layman
acertm8215 layman # ls
cache_65bd38402ac8431067b54904bd2ed2d1.xml  cache_ac494f50f5736be7871962c0dec7b3bb.xml  kde  make.conf  overlays.xml  sabayon
acertm8215 layman #


Looks alright to me! No /var/lib/layman/layman exists. :D
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8077
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Layman storage path changed from version 1.3.0 on

Postby wolfden » Tue Mar 02, 2010 12:35

I dunno, but it did here

Code: Select all
wolf64 test # mkdir -p /usr/local/portage/layman
wolf64 test # cd /var/lib/layman
wolf64 layman # ls
cache_ac494f50f5736be7871962c0dec7b3bb.xml  make.conf  overlays.xml  sabayon
wolf64 layman # cp -r /usr/local/portage/layman /var/lib/layman
wolf64 layman # ls
cache_ac494f50f5736be7871962c0dec7b3bb.xml  layman  make.conf  overlays.xml  sabayon


:wink:
wolfden
Sharecropper
 
Posts: 9051
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: Layman storage path changed from version 1.3.0 on

Postby wolfden » Tue Mar 02, 2010 12:53

I bet I know why

Code: Select all
mkdir -p /var/lib/layman


you didn't do that, so if the path exists already that will happen
wolfden
Sharecropper
 
Posts: 9051
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: Layman storage path changed from version 1.3.0 on

Postby Fitzcarraldo » Tue Mar 02, 2010 13:04

Code: Select all
acertm8215 ~ # ls
dead.letter
acertm8215 ~ # mkdir -p test_directory_1/layman
acertm8215 ~ # ls test_directory_1
layman
acertm8215 ~ # touch test_directory_1/layman/test_file_1
acertm8215 ~ # touch test_directory_1/layman/test_file_2
acertm8215 ~ # ls test_directory_1
layman
acertm8215 ~ # ls test_directory_1/layman
test_file_1  test_file_2
acertm8215 ~ # mkdir test_directory_2
acertm8215 ~ # ls test_directory_2
acertm8215 ~ # cp -r test_directory_1/layman test_directory_2/layman
acertm8215 ~ # ls test_directory_2
layman
acertm8215 ~ # ls test_directory_2/layman
test_file_1  test_file_2
acertm8215 ~ #


:D
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8077
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Layman storage path changed from version 1.3.0 on

Postby wolfden » Tue Mar 02, 2010 15:10

well what in the world, I must be too tired, as I am seeing the same commands producing two different results.
wolfden
Sharecropper
 
Posts: 9051
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: Layman storage path changed from version 1.3.0 on

Postby Fitzcarraldo » Tue Mar 02, 2010 15:15

No, you're not. Your hunch was correct:

Code: Select all
acertm8215 ~ # ls   
dead.letter         
acertm8215 ~ # mkdir -p test_directory_1/layman
acertm8215 ~ # ls test_directory_1             
layman
acertm8215 ~ # touch test_directory_1/layman/test_file_1
acertm8215 ~ # touch test_directory_1/layman/test_file_2
acertm8215 ~ # ls test_directory_1
layman
acertm8215 ~ # ls test_directory_1/layman
test_file_1  test_file_2
acertm8215 ~ # mkdir test_directory_2
acertm8215 ~ # ls test_directory_2
acertm8215 ~ # cp -r test_directory_1/layman test_directory_2/layman
acertm8215 ~ # ls test_directory_2
layman
acertm8215 ~ # ls test_directory_2/layman
test_file_1  test_file_2
acertm8215 ~ # mkdir -p test_directory_3/layman
acertm8215 ~ # ls test_directory_3
layman
acertm8215 ~ # touch test_directory_3/layman/test_file_3
acertm8215 ~ # touch test_directory_3/layman/test_file_4
acertm8215 ~ # ls test_directory_3
layman
acertm8215 ~ # ls test_directory_3/layman
test_file_3  test_file_4
acertm8215 ~ # cp -r test_directory_1/layman test_directory_3/layman
acertm8215 ~ # ls test_directory_3
layman
acertm8215 ~ # ls test_directory_3/layman
layman  test_file_3  test_file_4
acertm8215 ~ #


If the directory does not exist then everything happens correctly, which was my case. If the directory already exists, which was your case because you used the mkdir -p command first, then, if you enter the following command:
cp -r /usr/local/portage/layman /var/lib/layman
then you end up with /layman/layman/ as shown in my last experiment above.

Since the /var/lib/layman/ directory does not exist if a person is using layman-1.2.* then there would be no problem to use the command cp -r /usr/local/portage/layman /var/lib/layman. If it does exist and that person didn't create it then something must be wrong with that person's installation, in which case, after checking the contents of /usr/local/portage/layman/make.conf, /etc/make.conf and /etc/layman/layman.cfg to ensure they have not already been altered, I personally would be inclined to do: rm -rf /var/lib/layman before performing the copy from /usr/local/portage/layman/.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8077
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom


Return to Portage|Emerge Package Managers

Who is online

Users browsing this forum: No registered users and 1 guest