Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] xbps-src throws errors on bash
@ 2023-07-25  7:50 Anachron
  2023-07-25  7:52 ` Anachron
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Anachron @ 2023-07-25  7:50 UTC (permalink / raw)
  To: ml

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

New issue by Anachron on void-packages repository

https://github.com/void-linux/void-packages/issues/45239

Description:
### Is this a new report?

Yes

### System Info

Void 6.3.10_1 x86_64 GenuineIntel uptodate rrFFFFFFF

### Package(s) Affected

xbps-src

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

No.

### Expected behaviour

I expect `LANG=C ./xbps-src update-check bsdtar` to throw no errors on bash.

### Actual behaviour

```bash
# LANG=C ./xbps-src update-check bsdtar
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_filew%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_timer_handle%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_welcome_prompt_handle%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_vimw%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_directory_not_found_handle%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_shell_prompt_handle%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_gitw%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_cdw%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_command_not_found_handle%%': not a valid identifier
libarchive-3.6.2 -> libarchive-3.7.0

```

### Steps to reproduce

Run `LANG=C ./xbps-src update-check bsdtar` with shell functions inside bashs env.

Issue is because of https://github.com/void-linux/void-packages/commit/6174bd6afde26fbcdf80437ab1653c6dab34099b

@sgn 

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

* Re: xbps-src throws errors on bash
  2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
@ 2023-07-25  7:52 ` Anachron
  2023-07-25  8:21 ` sgn
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Anachron @ 2023-07-25  7:52 UTC (permalink / raw)
  To: ml

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

New comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/issues/45239#issuecomment-1649312440

Comment:
This is my env:
```sh
...
BASH_FUNC_cdw%%=() {  w=$(which "${1}" 2> /dev/null);
 if test -z "${w}"; then
 printf 'Error: %s could not be found.\n' "${1}" 2>&1;
 return 1;
 fi;
 cd $(dirname "${w}")
}
BASH_FUNC_welcome_prompt_handle%%=() {  clear;
 . ~/etc/sh/colors;
 . /etc/os-release;
 printf "\n  Welcome to ${abl}%s${ars}, ${abl}%s${ars}.\n" "${NAME}" "${USER}"
}
BASH_FUNC_filew%%=() {  w=$(which "${1}" 2> /dev/null);
 if test -z "${w}"; then
 printf 'Error: %s could not be found.\n' "${1}" 2>&1;
 return 1;
 fi;
 file "${w}"
}
...
```

Maybe we should use `compgen -v` here instead.

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

* Re: xbps-src throws errors on bash
  2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
  2023-07-25  7:52 ` Anachron
@ 2023-07-25  8:21 ` sgn
  2023-07-25  8:26 ` Anachron
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2023-07-25  8:21 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/issues/45239#issuecomment-1649354995

Comment:
No idea how I can replicate your problem! Where did you put those declaration, and exportation>

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

* Re: xbps-src throws errors on bash
  2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
  2023-07-25  7:52 ` Anachron
  2023-07-25  8:21 ` sgn
@ 2023-07-25  8:26 ` Anachron
  2023-07-25  8:41 ` Anachron
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Anachron @ 2023-07-25  8:26 UTC (permalink / raw)
  To: ml

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

New comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/issues/45239#issuecomment-1649362253

Comment:
Just export some functions inside your `.bash_profile`.

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

* Re: xbps-src throws errors on bash
  2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
                   ` (2 preceding siblings ...)
  2023-07-25  8:26 ` Anachron
@ 2023-07-25  8:41 ` Anachron
  2023-07-25 18:39 ` Anachron
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Anachron @ 2023-07-25  8:41 UTC (permalink / raw)
  To: ml

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

New comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/issues/45239#issuecomment-1649362253

Comment:
Just export some functions inside your `.bash_profile`.

Example: 

```sh
#!/bin/sh

cdw() {
  w=$(which "${1}" 2>/dev/null)
  if test -z "${w}"; then
    2>&1 printf 'Error: %s could not be found.\n' "${1}"
    return 1
  fi

  cd $(dirname "${w}")
}

export -f cdw

vimw() {
  w=$(which "${1}" 2>/dev/null)
  if test -z "${w}"; then
    2>&1 printf 'Error: %s could not be found.\n' "${1}"
    return 1
  fi
  vim "${w}"
}

export -f vimw

filew() {
  w=$(which "${1}" 2>/dev/null)
  if test -z "${w}"; then
    2>&1 printf 'Error: %s could not be found.\n' "${1}"
    return 1
  fi
  file "${w}"
}

export -f filew

gitw() {
  w=$(which "${1}" 2>/dev/null); shift
  if test -z "${w}"; then
    2>&1 printf 'Error: %s could not be found.\n' "${1}"
    return 1
  fi
  git --git-dir "$(dirname ${w})/.git" ${@}
}

export -f gitw

```

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

* Re: xbps-src throws errors on bash
  2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
                   ` (3 preceding siblings ...)
  2023-07-25  8:41 ` Anachron
@ 2023-07-25 18:39 ` Anachron
  2023-07-26  1:00 ` sgn
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Anachron @ 2023-07-25 18:39 UTC (permalink / raw)
  To: ml

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

New comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/issues/45239#issuecomment-1650347859

Comment:
@sgn instead of doing all these variable unsetting, why don't we spawn a clean ENV with the exception of the variables that we specify?

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

* Re: xbps-src throws errors on bash
  2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
                   ` (4 preceding siblings ...)
  2023-07-25 18:39 ` Anachron
@ 2023-07-26  1:00 ` sgn
  2023-07-26  1:00 ` [ISSUE] [CLOSED] " sgn
  2023-07-26  6:38 ` Anachron
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2023-07-26  1:00 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/issues/45239#issuecomment-1650808339

Comment:
We do, but this is in case building a package as a dependency of other packages, the environment variables wasn't unset properly.

We should start a new `xbps-src` process in that case. Not sure how to do it.

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

* Re: [ISSUE] [CLOSED] xbps-src throws errors on bash
  2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
                   ` (5 preceding siblings ...)
  2023-07-26  1:00 ` sgn
@ 2023-07-26  1:00 ` sgn
  2023-07-26  6:38 ` Anachron
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2023-07-26  1:00 UTC (permalink / raw)
  To: ml

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

Closed issue by Anachron on void-packages repository

https://github.com/void-linux/void-packages/issues/45239

Description:
### Is this a new report?

Yes

### System Info

Void 6.3.10_1 x86_64 GenuineIntel uptodate rrFFFFFFF

### Package(s) Affected

xbps-src

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

No.

### Expected behaviour

I expect `LANG=C ./xbps-src update-check bsdtar` to throw no errors on bash.

### Actual behaviour

```bash
# LANG=C ./xbps-src update-check bsdtar
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_filew%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_timer_handle%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_welcome_prompt_handle%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_vimw%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_directory_not_found_handle%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_shell_prompt_handle%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_gitw%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_cdw%%': not a valid identifier
/home/lap/var/bldr/gitsrc/common/environment/setup/sourcepkg.sh: line 31: unset: `BASH_FUNC_command_not_found_handle%%': not a valid identifier
libarchive-3.6.2 -> libarchive-3.7.0

```

### Steps to reproduce

Run `LANG=C ./xbps-src update-check bsdtar` with shell functions inside bashs env.

Issue is because of https://github.com/void-linux/void-packages/commit/6174bd6afde26fbcdf80437ab1653c6dab34099b

@sgn 

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

* Re: xbps-src throws errors on bash
  2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
                   ` (6 preceding siblings ...)
  2023-07-26  1:00 ` [ISSUE] [CLOSED] " sgn
@ 2023-07-26  6:38 ` Anachron
  7 siblings, 0 replies; 9+ messages in thread
From: Anachron @ 2023-07-26  6:38 UTC (permalink / raw)
  To: ml

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

New comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/issues/45239#issuecomment-1651068566

Comment:
That works as well,- thanks!

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

end of thread, other threads:[~2023-07-26  6:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25  7:50 [ISSUE] xbps-src throws errors on bash Anachron
2023-07-25  7:52 ` Anachron
2023-07-25  8:21 ` sgn
2023-07-25  8:26 ` Anachron
2023-07-25  8:41 ` Anachron
2023-07-25 18:39 ` Anachron
2023-07-26  1:00 ` sgn
2023-07-26  1:00 ` [ISSUE] [CLOSED] " sgn
2023-07-26  6:38 ` Anachron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).