You are not logged in.

#1 2023-01-24 21:07:03

cone_man
Member
Registered: 2022-12-20
Posts: 14

[SOLVED]append_path not found

When trying to install a package from the aur, I get the following error message:

/etc/profile.d/jre.sh: line 3: append_path: command not found
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

The file /etc/profile contains

# /etc/profile

# Set our umask
umask 022

# Append "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
append_path () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="${PATH:+$PATH:}$1"
    esac
}

# Append our default paths
append_path '/usr/local/sbin'
append_path '/usr/local/bin'
append_path '/usr/bin'

# Force PATH to be environment
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	done
	unset profile
fi

# Unload our profile API functions
unset -f append_path

# Source global bash config, when interactive but not posix or sh mode
if test "$BASH" &&\
   test "$PS1" &&\
   test -z "$POSIXLY_CORRECT" &&\
   test "${0#-}" != sh &&\
   test -r /etc/bash.bashrc
then
	. /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

So I'm not sure why is not defined.
Any ideas on how to fix this?

Last edited by cone_man (2023-01-24 23:34:12)

Offline

#2 2023-01-24 21:52:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,477
Website

Re: [SOLVED]append_path not found

In what context did that error appear?  Post the complete command / output.

What package is this?  There are a boatload of jre packages in the AUR, no one here is going to skim all of them looking for the broken PKGBUILD.

It sounds like something is sourcing the jre.sh in the wrong context (outside of /etc/profile) as this would result in the error you quoted.

EDIT: your /etc/profile is also quite outdated.  Take care of your pacnew files.  (edit2: unless of course that was a fairly random excerpt of the file rather than it's complete contents which seems more likely, though also more confusing).

Last edited by Trilby (2023-01-24 21:57:08)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-01-24 22:34:55

cone_man
Member
Registered: 2022-12-20
Posts: 14

Re: [SOLVED]append_path not found

The package I was trying to install is java-service-wrapper

$ yay -S java-service-wrapper
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  java-service-wrapper-3.5.51-1

  1 java-service-wrapper                     (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> n
:: PKGBUILD up to date, Skipping (1/0): java-service-wrapper
  1 java-service-wrapper                     (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> n
:: (1/1) Parsing SRCINFO: java-service-wrapper
==> Making package: java-service-wrapper 3.5.51-1 (Tue 24 Jan 2023 08:58:29 PM WET)
==> Retrieving sources...
  -> Found wrapper_3.5.51_src.tar.gz
==> Validating source files with sha256sums...
    wrapper_3.5.51_src.tar.gz ... Passed
==> Making package: java-service-wrapper 3.5.51-1 (Tue 24 Jan 2023 08:58:31 PM WET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found wrapper_3.5.51_src.tar.gz
==> Validating source files with sha256sums...
    wrapper_3.5.51_src.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting wrapper_3.5.51_src.tar.gz with bsdtar
==> Starting prepare()...
==> Sources are ready.
==> Making package: java-service-wrapper 3.5.51-1 (Tue 24 Jan 2023 08:58:35 PM WET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
/etc/profile.d/jre.sh: line 3: append_path: command not found
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: java-service-wrapper

It was just a portion of the file. (full file now)

Offline

#4 2023-01-24 22:41:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,477
Website

Re: [SOLVED]append_path not found

The PKGBUILD does include a source command as I predicted which is just nonsensical in that context.  Report it to the AUR maintainer.  Just remove that line and see if it builds - if it doesn't, then replace the line with `export PATH="$PATH:/usr/lib/jvm/default/bin"`


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2023-01-24 23:33:57

cone_man
Member
Registered: 2022-12-20
Posts: 14

Re: [SOLVED]append_path not found

Remove the lines on the file allowed the package to build.
Thank you

Offline

Board footer

Powered by FluxBB