all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* update-profiles.sh
@ 2023-04-24 11:22 Gottfried
  2023-04-24 12:05 ` update-profiles.sh Wojtek Kosior via
  0 siblings, 1 reply; 5+ messages in thread
From: Gottfried @ 2023-04-24 11:22 UTC (permalink / raw)
  To: Gary Johnson, help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 3223 bytes --]

Hi,

Sorry,
you provided me already with a script for activating all profiles at login,
I don’t know at the moment, why I have mixed it up with other things
and  I didn’t use it.
------------------------------------------------------------
in the meantime all packages are available at login
through the help of Martin
------------------------------------------------------------

so I tried to use your "update-profiles.sh"
I placed it in my home directory: ~/gfp
and changed one sentence, my the place of the profiles:

update-profiles.sh

#!/bin/sh

GUIX_MANIFESTS=$HOME/sys/guix/manifests
GUIX_PROFILES=home/gfp/Projekte

for dir in $GUIX_PROFILES/*
do
     name=$(basename "$dir")
     manifest=$GUIX_MANIFESTS/$name.scm
     profile=$dir/$name
     if [ -r $manifest ]
     then
         guix package --manifest="$manifest" --profile="$profile"
     fi
     unset profile
     unset manifest
     unset name
done

-------------------------------------------------

but running it, it seems not doing anything.

sometimes it’s difficult for me, to know so little, not knowing what I 
have to do, not knowing the basics ...

Is it connected with the other script to activate the profiles at login?
so that it doesn’t work?
I guess both scripts are independent.

or is the path to it wrong?
I have the directory
~/gfp/Projekte

and in it many directories/which are the different profiles, e.g: 
Musescore, Musik, Emacs, Calibre, Gnucash, Icecat, Libreoffice, 
Photoflare, Lilypond

and in each of these directories a scm.file with the same name but in 
small letters like: musescore.scm, musik.scm, emacs.scm ...



Kind regards

Gottfried

> I believe I already provided you with the code for updating profiles and
> activating them, but here it is again for reference:
> 
> ```update-profiles.sh
> #!/bin/sh
> 
> GUIX_MANIFESTS=$HOME/sys/guix/manifests
> GUIX_PROFILES=$HOME/sys/guix/profiles
> 
> for dir in $GUIX_PROFILES/*
> do
>     name=$(basename "$dir")
>     manifest=$GUIX_MANIFESTS/$name.scm
>     profile=$dir/$name
>     if [ -r $manifest ]
>     then
>         guix package --manifest="$manifest" --profile="$profile"
>     fi
>     unset profile
>     unset manifest
>     unset name
> done
> ```
> 
> ```activate-profiles.sh
> #!/bin/sh
> 
> GUIX_PROFILES=$HOME/sys/guix/profiles
> 
> for dir in $GUIX_PROFILES/*
> do
>     name=$(basename "$dir")
>     profile=$dir/$name
>     if [ -f "$profile"/etc/profile ]
>     then
>         GUIX_PROFILE="$profile"
>         . "$GUIX_PROFILE"/etc/profile
>         export MANPATH="$GUIX_PROFILE/share/man${MANPATH:+:}$MANPATH"
>         export INFOPATH="$GUIX_PROFILE/share/info${INFOPATH:+:}$INFOPATH"
>     fi
>     unset profile
>     unset name
> done
> ```
> 
> These scripts both loop over my manifests or profiles directories,
> running the upgrade or activate commands on each one. If you want to
> exclude a profile from being upgraded with this script, you can just
> take away its manifest's read permissons like so:
> 
> ```
> chmod -r $HOME/sys/guix/manifests/my-excluded-manifest.scm
> ```
> 
> Good luck,
>   Gary



[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: update-profiles.sh
  2023-04-24 11:22 update-profiles.sh Gottfried
@ 2023-04-24 12:05 ` Wojtek Kosior via
  2023-04-24 15:42   ` update-profiles.sh Gottfried
  0 siblings, 1 reply; 5+ messages in thread
From: Wojtek Kosior via @ 2023-04-24 12:05 UTC (permalink / raw)
  To: Gottfried; +Cc: Gary Johnson, help-guix

[-- Attachment #1: Type: text/plain, Size: 4913 bytes --]

Hi Gottfried,

I see several problems with `update-profiles.sh`.
- You wrote `GUIX_PROFILES=home/gfp/Projekte`, without leading slash.
  This makes the shell treat this path as a relative one. You need to
  use either `/home/gfp/Projekte` or just '$HOME/Projekte'.
- This script assumes manifests to be stored in a completely different
  place than they really are in your case.
- There's no need to `unset` the loop variables at every iteration. At
  least as long as this script is executed and not sourced. I'm
  mentioning this although a few extraneous `unset`s are not going to
  cause problems. Don't worry too much about this.

I edited the script. Try with this version

```
#!/bin/sh

GUIX_PROFILES=$HOME/Projekte

for dir in $GUIX_PROFILES/*
do
     name=$(basename "$dir" | tr '[:upper:]' '[:lower:]')
     manifest="$dir"/$name.scm
     profile=$dir/$name
     if [ -r $manifest ]
     then
         guix package --manifest="$manifest" --profile="$profile"
     fi
done
```

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)


On Mon, 24 Apr 2023 11:22:46 +0000
Gottfried <gottfried@posteo.de> wrote:

> Hi,
> 
> Sorry,
> you provided me already with a script for activating all profiles at login,
> I don’t know at the moment, why I have mixed it up with other things
> and  I didn’t use it.
> ------------------------------------------------------------
> in the meantime all packages are available at login
> through the help of Martin
> ------------------------------------------------------------
> 
> so I tried to use your "update-profiles.sh"
> I placed it in my home directory: ~/gfp
> and changed one sentence, my the place of the profiles:
> 
> update-profiles.sh
> 
> #!/bin/sh
> 
> GUIX_MANIFESTS=$HOME/sys/guix/manifests
> GUIX_PROFILES=home/gfp/Projekte
> 
> for dir in $GUIX_PROFILES/*
> do
>      name=$(basename "$dir")
>      manifest=$GUIX_MANIFESTS/$name.scm
>      profile=$dir/$name
>      if [ -r $manifest ]
>      then
>          guix package --manifest="$manifest" --profile="$profile"
>      fi
>      unset profile
>      unset manifest
>      unset name
> done
> 
> -------------------------------------------------
> 
> but running it, it seems not doing anything.
> 
> sometimes it’s difficult for me, to know so little, not knowing what I 
> have to do, not knowing the basics ...
> 
> Is it connected with the other script to activate the profiles at login?
> so that it doesn’t work?
> I guess both scripts are independent.
> 
> or is the path to it wrong?
> I have the directory
> ~/gfp/Projekte
> 
> and in it many directories/which are the different profiles, e.g: 
> Musescore, Musik, Emacs, Calibre, Gnucash, Icecat, Libreoffice, 
> Photoflare, Lilypond
> 
> and in each of these directories a scm.file with the same name but in 
> small letters like: musescore.scm, musik.scm, emacs.scm ...
> 
> 
> 
> Kind regards
> 
> Gottfried
> 
> > I believe I already provided you with the code for updating profiles and
> > activating them, but here it is again for reference:
> > 
> > ```update-profiles.sh
> > #!/bin/sh
> > 
> > GUIX_MANIFESTS=$HOME/sys/guix/manifests
> > GUIX_PROFILES=$HOME/sys/guix/profiles
> > 
> > for dir in $GUIX_PROFILES/*
> > do
> >     name=$(basename "$dir")
> >     manifest=$GUIX_MANIFESTS/$name.scm
> >     profile=$dir/$name
> >     if [ -r $manifest ]
> >     then
> >         guix package --manifest="$manifest" --profile="$profile"
> >     fi
> >     unset profile
> >     unset manifest
> >     unset name
> > done
> > ```
> > 
> > ```activate-profiles.sh
> > #!/bin/sh
> > 
> > GUIX_PROFILES=$HOME/sys/guix/profiles
> > 
> > for dir in $GUIX_PROFILES/*
> > do
> >     name=$(basename "$dir")
> >     profile=$dir/$name
> >     if [ -f "$profile"/etc/profile ]
> >     then
> >         GUIX_PROFILE="$profile"
> >         . "$GUIX_PROFILE"/etc/profile
> >         export MANPATH="$GUIX_PROFILE/share/man${MANPATH:+:}$MANPATH"
> >         export INFOPATH="$GUIX_PROFILE/share/info${INFOPATH:+:}$INFOPATH"
> >     fi
> >     unset profile
> >     unset name
> > done
> > ```
> > 
> > These scripts both loop over my manifests or profiles directories,
> > running the upgrade or activate commands on each one. If you want to
> > exclude a profile from being upgraded with this script, you can just
> > take away its manifest's read permissons like so:
> > 
> > ```
> > chmod -r $HOME/sys/guix/manifests/my-excluded-manifest.scm
> > ```
> > 
> > Good luck,
> >   Gary  
> 
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: update-profiles.sh
  2023-04-24 12:05 ` update-profiles.sh Wojtek Kosior via
@ 2023-04-24 15:42   ` Gottfried
  2023-04-24 18:11     ` update-profiles.sh Wojtek Kosior via
  0 siblings, 1 reply; 5+ messages in thread
From: Gottfried @ 2023-04-24 15:42 UTC (permalink / raw)
  To: Wojtek Kosior; +Cc: Gary Johnson, help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 6160 bytes --]

Hi,
thanks for help

I tried this script in the terminal.

1.
gfp@Tuxedo ~$ ./update-profiles.sh

it said
guix package: Error: Profile /home/gfp/Projects/Calibre/calibre is 
locked by another process

I didn’t open calibre, so what could be the problem?


2. it installed almost all packages from all profiles
without icecat, probably because I had it opened.

3. It did not install my "Musik" profile with several packages.
is locked by another process

I am not sure about that, because I haven't opened any of those packages.


So we have success.
Thank you very much.
You saved me a lot of time and headache.


Kind regards

Gottfried


> #!/bin/sh
>> 
>> GUIX_PROFILES=$HOME/Projekte
>> 
>> for dir in $GUIX_PROFILES/*
>> do
>>       name=$(basename "$dir" | tr '[:upper:]' '[:lower:]')
>>       manifest="$dir"/$name.scm
>>       profile=$dir/$name
>>       if [ -r $manifest ]
>>       then
>>           guix package --manifest="$manifest" --profile="$profile"
>>       fi
>> done



Am 24.04.23 um 14:05 schrieb Wojtek Kosior:
> Hi Gottfried,
> 
> I see several problems with `update-profiles.sh`.
> - You wrote `GUIX_PROFILES=home/gfp/Projekte`, without leading slash.
>    This makes the shell treat this path as a relative one. You need to
>    use either `/home/gfp/Projekte` or just '$HOME/Projekte'.
> - This script assumes manifests to be stored in a completely different
>    place than they really are in your case.
> - There's no need to `unset` the loop variables at every iteration. At
>    least as long as this script is executed and not sourced. I'm
>    mentioning this although a few extraneous `unset`s are not going to
>    cause problems. Don't worry too much about this.
> 
> I edited the script. Try with this version
> 
> ```
> #!/bin/sh
> 
> GUIX_PROFILES=$HOME/Projekte
> 
> for dir in $GUIX_PROFILES/*
> do
>       name=$(basename "$dir" | tr '[:upper:]' '[:lower:]')
>       manifest="$dir"/$name.scm
>       profile=$dir/$name
>       if [ -r $manifest ]
>       then
>           guix package --manifest="$manifest" --profile="$profile"
>       fi
> done
> ```
> 
> -- (sig_start)
> website: https://koszko.org/koszko.html
> PGP: https://koszko.org/key.gpg
> fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> 
> ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> -- (sig_end)
> 
> 
> On Mon, 24 Apr 2023 11:22:46 +0000
> Gottfried <gottfried@posteo.de> wrote:
> 
>> Hi,
>>
>> Sorry,
>> you provided me already with a script for activating all profiles at login,
>> I don’t know at the moment, why I have mixed it up with other things
>> and  I didn’t use it.
>> ------------------------------------------------------------
>> in the meantime all packages are available at login
>> through the help of Martin
>> ------------------------------------------------------------
>>
>> so I tried to use your "update-profiles.sh"
>> I placed it in my home directory: ~/gfp
>> and changed one sentence, my the place of the profiles:
>>
>> update-profiles.sh
>>
>> #!/bin/sh
>>
>> GUIX_MANIFESTS=$HOME/sys/guix/manifests
>> GUIX_PROFILES=home/gfp/Projekte
>>
>> for dir in $GUIX_PROFILES/*
>> do
>>       name=$(basename "$dir")
>>       manifest=$GUIX_MANIFESTS/$name.scm
>>       profile=$dir/$name
>>       if [ -r $manifest ]
>>       then
>>           guix package --manifest="$manifest" --profile="$profile"
>>       fi
>>       unset profile
>>       unset manifest
>>       unset name
>> done
>>
>> -------------------------------------------------
>>
>> but running it, it seems not doing anything.
>>
>> sometimes it’s difficult for me, to know so little, not knowing what I
>> have to do, not knowing the basics ...
>>
>> Is it connected with the other script to activate the profiles at login?
>> so that it doesn’t work?
>> I guess both scripts are independent.
>>
>> or is the path to it wrong?
>> I have the directory
>> ~/gfp/Projekte
>>
>> and in it many directories/which are the different profiles, e.g:
>> Musescore, Musik, Emacs, Calibre, Gnucash, Icecat, Libreoffice,
>> Photoflare, Lilypond
>>
>> and in each of these directories a scm.file with the same name but in
>> small letters like: musescore.scm, musik.scm, emacs.scm ...
>>
>>
>>
>> Kind regards
>>
>> Gottfried
>>
>>> I believe I already provided you with the code for updating profiles and
>>> activating them, but here it is again for reference:
>>>
>>> ```update-profiles.sh
>>> #!/bin/sh
>>>
>>> GUIX_MANIFESTS=$HOME/sys/guix/manifests
>>> GUIX_PROFILES=$HOME/sys/guix/profiles
>>>
>>> for dir in $GUIX_PROFILES/*
>>> do
>>>      name=$(basename "$dir")
>>>      manifest=$GUIX_MANIFESTS/$name.scm
>>>      profile=$dir/$name
>>>      if [ -r $manifest ]
>>>      then
>>>          guix package --manifest="$manifest" --profile="$profile"
>>>      fi
>>>      unset profile
>>>      unset manifest
>>>      unset name
>>> done
>>> ```
>>>
>>> ```activate-profiles.sh
>>> #!/bin/sh
>>>
>>> GUIX_PROFILES=$HOME/sys/guix/profiles
>>>
>>> for dir in $GUIX_PROFILES/*
>>> do
>>>      name=$(basename "$dir")
>>>      profile=$dir/$name
>>>      if [ -f "$profile"/etc/profile ]
>>>      then
>>>          GUIX_PROFILE="$profile"
>>>          . "$GUIX_PROFILE"/etc/profile
>>>          export MANPATH="$GUIX_PROFILE/share/man${MANPATH:+:}$MANPATH"
>>>          export INFOPATH="$GUIX_PROFILE/share/info${INFOPATH:+:}$INFOPATH"
>>>      fi
>>>      unset profile
>>>      unset name
>>> done
>>> ```
>>>
>>> These scripts both loop over my manifests or profiles directories,
>>> running the upgrade or activate commands on each one. If you want to
>>> exclude a profile from being upgraded with this script, you can just
>>> take away its manifest's read permissons like so:
>>>
>>> ```
>>> chmod -r $HOME/sys/guix/manifests/my-excluded-manifest.scm
>>> ```
>>>
>>> Good luck,
>>>    Gary



[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: update-profiles.sh
  2023-04-24 15:42   ` update-profiles.sh Gottfried
@ 2023-04-24 18:11     ` Wojtek Kosior via
  2023-04-25 15:51       ` update-profiles.sh Gottfried
  0 siblings, 1 reply; 5+ messages in thread
From: Wojtek Kosior via @ 2023-04-24 18:11 UTC (permalink / raw)
  To: Gottfried; +Cc: Gary Johnson, help-guix

[-- Attachment #1: Type: text/plain, Size: 8454 bytes --]

> Hi,
> thanks for help
> 
> I tried this script in the terminal.
> 
> 1.
> gfp@Tuxedo ~$ ./update-profiles.sh
> 
> it said
> guix package: Error: Profile /home/gfp/Projects/Calibre/calibre is 
> locked by another process
> 
> I didn’t open calibre, so what could be the problem?

Oooops, there's probably been a mistake.

Looking at your emails from an older thread, it seems your profile
paths were like "/home/gfp/Projects/Calibre/guix-profil" and
"/home/gfp/Projects/Musik/guix-profil". Is that correct, is there
"guix-profil" at the end of every profile path? And here, with this
script, I erroneously assumed profile paths like
"/home/gfp/Projects/Calibre/calibre" and
"/home/gfp/Projects/Musik/musik". I apologize :(

We need to adapt the script to use the correct profile paths. I think
you could use something like

```
#!/bin/sh

GUIX_PROFILES=$HOME/Projekte

for dir in $GUIX_PROFILES/*
do
     name="$(basename "$dir" | tr '[:upper:]' '[:lower:]')"
     manifest="$dir"/"$name".scm
     profile="$dir"/guix-profil
     if [ -r $manifest ]
     then
         guix package --manifest="$manifest" --profile="$profile"
     fi
done
```

Also, the script I prepared previously probably created some extraneous
profiles at the paths it was trying to use. Again, sorry if this
happened. You might want to remove the extra profiles you'll find.

Good luck,
Wojtek

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)


On Mon, 24 Apr 2023 15:42:38 +0000
Gottfried <gottfried@posteo.de> wrote:

> Hi,
> thanks for help
> 
> I tried this script in the terminal.
> 
> 1.
> gfp@Tuxedo ~$ ./update-profiles.sh
> 
> it said
> guix package: Error: Profile /home/gfp/Projects/Calibre/calibre is 
> locked by another process
> 
> I didn’t open calibre, so what could be the problem?
> 
> 
> 2. it installed almost all packages from all profiles
> without icecat, probably because I had it opened.
> 
> 3. It did not install my "Musik" profile with several packages.
> is locked by another process
> 
> I am not sure about that, because I haven't opened any of those packages.
> 
> 
> So we have success.
> Thank you very much.
> You saved me a lot of time and headache.
> 
> 
> Kind regards
> 
> Gottfried
> 
> 
> > #!/bin/sh  
> >> 
> >> GUIX_PROFILES=$HOME/Projekte
> >> 
> >> for dir in $GUIX_PROFILES/*
> >> do
> >>       name=$(basename "$dir" | tr '[:upper:]' '[:lower:]')
> >>       manifest="$dir"/$name.scm
> >>       profile=$dir/$name
> >>       if [ -r $manifest ]
> >>       then
> >>           guix package --manifest="$manifest" --profile="$profile"
> >>       fi
> >> done  
> 
> 
> 
> Am 24.04.23 um 14:05 schrieb Wojtek Kosior:
> > Hi Gottfried,
> > 
> > I see several problems with `update-profiles.sh`.
> > - You wrote `GUIX_PROFILES=home/gfp/Projekte`, without leading slash.
> >    This makes the shell treat this path as a relative one. You need to
> >    use either `/home/gfp/Projekte` or just '$HOME/Projekte'.
> > - This script assumes manifests to be stored in a completely different
> >    place than they really are in your case.
> > - There's no need to `unset` the loop variables at every iteration. At
> >    least as long as this script is executed and not sourced. I'm
> >    mentioning this although a few extraneous `unset`s are not going to
> >    cause problems. Don't worry too much about this.
> > 
> > I edited the script. Try with this version
> > 
> > ```
> > #!/bin/sh
> > 
> > GUIX_PROFILES=$HOME/Projekte
> > 
> > for dir in $GUIX_PROFILES/*
> > do
> >       name=$(basename "$dir" | tr '[:upper:]' '[:lower:]')
> >       manifest="$dir"/$name.scm
> >       profile=$dir/$name
> >       if [ -r $manifest ]
> >       then
> >           guix package --manifest="$manifest" --profile="$profile"
> >       fi
> > done
> > ```
> > 
> > -- (sig_start)
> > website: https://koszko.org/koszko.html
> > PGP: https://koszko.org/key.gpg
> > fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> > 
> > ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> > ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> > -- (sig_end)
> > 
> > 
> > On Mon, 24 Apr 2023 11:22:46 +0000
> > Gottfried <gottfried@posteo.de> wrote:
> >   
> >> Hi,
> >>
> >> Sorry,
> >> you provided me already with a script for activating all profiles at login,
> >> I don’t know at the moment, why I have mixed it up with other things
> >> and  I didn’t use it.
> >> ------------------------------------------------------------
> >> in the meantime all packages are available at login
> >> through the help of Martin
> >> ------------------------------------------------------------
> >>
> >> so I tried to use your "update-profiles.sh"
> >> I placed it in my home directory: ~/gfp
> >> and changed one sentence, my the place of the profiles:
> >>
> >> update-profiles.sh
> >>
> >> #!/bin/sh
> >>
> >> GUIX_MANIFESTS=$HOME/sys/guix/manifests
> >> GUIX_PROFILES=home/gfp/Projekte
> >>
> >> for dir in $GUIX_PROFILES/*
> >> do
> >>       name=$(basename "$dir")
> >>       manifest=$GUIX_MANIFESTS/$name.scm
> >>       profile=$dir/$name
> >>       if [ -r $manifest ]
> >>       then
> >>           guix package --manifest="$manifest" --profile="$profile"
> >>       fi
> >>       unset profile
> >>       unset manifest
> >>       unset name
> >> done
> >>
> >> -------------------------------------------------
> >>
> >> but running it, it seems not doing anything.
> >>
> >> sometimes it’s difficult for me, to know so little, not knowing what I
> >> have to do, not knowing the basics ...
> >>
> >> Is it connected with the other script to activate the profiles at login?
> >> so that it doesn’t work?
> >> I guess both scripts are independent.
> >>
> >> or is the path to it wrong?
> >> I have the directory
> >> ~/gfp/Projekte
> >>
> >> and in it many directories/which are the different profiles, e.g:
> >> Musescore, Musik, Emacs, Calibre, Gnucash, Icecat, Libreoffice,
> >> Photoflare, Lilypond
> >>
> >> and in each of these directories a scm.file with the same name but in
> >> small letters like: musescore.scm, musik.scm, emacs.scm ...
> >>
> >>
> >>
> >> Kind regards
> >>
> >> Gottfried
> >>  
> >>> I believe I already provided you with the code for updating profiles and
> >>> activating them, but here it is again for reference:
> >>>
> >>> ```update-profiles.sh
> >>> #!/bin/sh
> >>>
> >>> GUIX_MANIFESTS=$HOME/sys/guix/manifests
> >>> GUIX_PROFILES=$HOME/sys/guix/profiles
> >>>
> >>> for dir in $GUIX_PROFILES/*
> >>> do
> >>>      name=$(basename "$dir")
> >>>      manifest=$GUIX_MANIFESTS/$name.scm
> >>>      profile=$dir/$name
> >>>      if [ -r $manifest ]
> >>>      then
> >>>          guix package --manifest="$manifest" --profile="$profile"
> >>>      fi
> >>>      unset profile
> >>>      unset manifest
> >>>      unset name
> >>> done
> >>> ```
> >>>
> >>> ```activate-profiles.sh
> >>> #!/bin/sh
> >>>
> >>> GUIX_PROFILES=$HOME/sys/guix/profiles
> >>>
> >>> for dir in $GUIX_PROFILES/*
> >>> do
> >>>      name=$(basename "$dir")
> >>>      profile=$dir/$name
> >>>      if [ -f "$profile"/etc/profile ]
> >>>      then
> >>>          GUIX_PROFILE="$profile"
> >>>          . "$GUIX_PROFILE"/etc/profile
> >>>          export MANPATH="$GUIX_PROFILE/share/man${MANPATH:+:}$MANPATH"
> >>>          export INFOPATH="$GUIX_PROFILE/share/info${INFOPATH:+:}$INFOPATH"
> >>>      fi
> >>>      unset profile
> >>>      unset name
> >>> done
> >>> ```
> >>>
> >>> These scripts both loop over my manifests or profiles directories,
> >>> running the upgrade or activate commands on each one. If you want to
> >>> exclude a profile from being upgraded with this script, you can just
> >>> take away its manifest's read permissons like so:
> >>>
> >>> ```
> >>> chmod -r $HOME/sys/guix/manifests/my-excluded-manifest.scm
> >>> ```
> >>>
> >>> Good luck,
> >>>    Gary  
> 
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: update-profiles.sh
  2023-04-24 18:11     ` update-profiles.sh Wojtek Kosior via
@ 2023-04-25 15:51       ` Gottfried
  0 siblings, 0 replies; 5+ messages in thread
From: Gottfried @ 2023-04-25 15:51 UTC (permalink / raw)
  To: Wojtek Kosior; +Cc: Gary Johnson, help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 4645 bytes --]

Hi,

thanks for help

no problem, I make constantly mistakes...

> Also, the script I prepared previously probably created some extraneous
>> profiles at the paths it was trying to use. Again, sorry if this
>> happened. You might want to remove the extra profiles you'll find.
>> 

I have e.g. in the directory /home/gfp/Projekte/Emacs/
the directories:
1. emacs (8 elements: bin, etc, include, lib, libexec, sbin, share, 
  manifest),
2. emacs-1-link (8 elements),
3. guix-profil (8 elements: bin, etc, include, lib, libexec, sbin share, 
manifest),
4. guix-profil-2-link (8 elements),
5. guix-profil-3-link (8 elements)
and 6. emacs.scm

Do you mean the directories "emacs" and "guix-profil" because they have 
the same subdirectories/8 elements
are now created, like double
and I have to remove the directory "emacs",
because the directory "guix-profil" should stay?

All the different profiles (I put them in the directory "Projekte
(engl. projects)

have now always like the example above "emacs"
subdirectories: like their "different package names" and also "guix-profil".

I understood you, that now the subdirectories (with the names of the 
profiles) are now according to the update script additionally created.

and I should delete those directories with the name of the profile

I hope I could express myself clearly.

....................................................................



Kind regards

Gottfried


Am 24.04.23 um 20:11 schrieb Wojtek Kosior:
>> Hi,
>> thanks for help
>>
>> I tried this script in the terminal.
>>
>> 1.
>> gfp@Tuxedo ~$ ./update-profiles.sh
>>
>> it said
>> guix package: Error: Profile /home/gfp/Projects/Calibre/calibre is
>> locked by another process
>>
>> I didn’t open calibre, so what could be the problem?
> 
> Oooops, there's probably been a mistake.
> 
> Looking at your emails from an older thread, it seems your profile
> paths were like "/home/gfp/Projects/Calibre/guix-profil" and
> "/home/gfp/Projects/Musik/guix-profil". Is that correct, is there
> "guix-profil" at the end of every profile path? And here, with this
> script, I erroneously assumed profile paths like
> "/home/gfp/Projects/Calibre/calibre" and
> "/home/gfp/Projects/Musik/musik". I apologize :(
> 
> We need to adapt the script to use the correct profile paths. I think
> you could use something like
> 
> ```
> #!/bin/sh
> 
> GUIX_PROFILES=$HOME/Projekte
> 
> for dir in $GUIX_PROFILES/*
> do
>       name="$(basename "$dir" | tr '[:upper:]' '[:lower:]')"
>       manifest="$dir"/"$name".scm
>       profile="$dir"/guix-profil
>       if [ -r $manifest ]
>       then
>           guix package --manifest="$manifest" --profile="$profile"
>       fi
> done
> ```
> 
> Also, the script I prepared previously probably created some extraneous
> profiles at the paths it was trying to use. Again, sorry if this
> happened. You might want to remove the extra profiles you'll find.
> 
> Good luck,
> Wojtek
> 
> -- (sig_start)
> website: https://koszko.org/koszko.html
> PGP: https://koszko.org/key.gpg
> fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
> 
> ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
> ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
> -- (sig_end)
> 
> 
> On Mon, 24 Apr 2023 15:42:38 +0000
> Gottfried <gottfried@posteo.de> wrote:
> 
>> Hi,
>> thanks for help
>>
>> I tried this script in the terminal.
>>
>> 1.
>> gfp@Tuxedo ~$ ./update-profiles.sh
>>
>> it said
>> guix package: Error: Profile /home/gfp/Projects/Calibre/calibre is
>> locked by another process
>>
>> I didn’t open calibre, so what could be the problem?
>>
>>
>> 2. it installed almost all packages from all profiles
>> without icecat, probably because I had it opened.
>>
>> 3. It did not install my "Musik" profile with several packages.
>> is locked by another process
>>
>> I am not sure about that, because I haven't opened any of those packages.
>>
>>
>> So we have success.
>> Thank you very much.
>> You saved me a lot of time and headache.
>>
>>
>> Kind regards
>>
>> Gottfried
>>
>>
>>> #!/bin/sh
>>>>
>>>> GUIX_PROFILES=$HOME/Projekte
>>>>
>>>> for dir in $GUIX_PROFILES/*
>>>> do
>>>>        name=$(basename "$dir" | tr '[:upper:]' '[:lower:]')
>>>>        manifest="$dir"/$name.scm
>>>>        profile=$dir/$name
>>>>        if [ -r $manifest ]
>>>>        then
>>>>            guix package --manifest="$manifest" --profile="$profile"
>>>>        fi
>>>> done
>>


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-25 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-24 11:22 update-profiles.sh Gottfried
2023-04-24 12:05 ` update-profiles.sh Wojtek Kosior via
2023-04-24 15:42   ` update-profiles.sh Gottfried
2023-04-24 18:11     ` update-profiles.sh Wojtek Kosior via
2023-04-25 15:51       ` update-profiles.sh Gottfried

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.