Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 842249 - app-vim/gentoo-syntax-2 error when creating metadata.xml "Undefined variable: git"
Summary: app-vim/gentoo-syntax-2 error when creating metadata.xml "Undefined variable:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-02 23:25 UTC by Gabriel Marcano
Modified: 2022-07-13 05:26 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
My local patch which may solve the issue (fix-undefined-variable-git.patch,532 bytes, patch)
2022-05-03 14:48 UTC, Furude Rika
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Marcano 2022-05-02 23:25:29 UTC
Function GentooGetUser in /usr/share/vim/vimfiles/plugin/gentoo-common.vim tries to test if there is git is installed as an executable. The problem is that the current check has git as a variable, and not as a string. This causes an error by vim:

"metadata.xml" [New]
Error detected while processing BufNewFile Autocommands for "metadata.xml"..function <SNR>28_MakeNewMetadata[18]..GentooGetUser:
line    4:
E121: Undefined variable: git
E116: Invalid arguments for function executable(git)
line   11:
8 lines indented 
Press ENTER or type command to continue

Replacing the offending line:
    if executable(git)
with
    if executable("git")
fixes the problem for me.

Reproducible: Always

Steps to Reproduce:
1. vi metadata.xml
Actual Results:  
"metadata.xml" [New]
Error detected while processing BufNewFile Autocommands for "metadata.xml"..function <SNR>28_MakeNewMetadata[18]..GentooGetUser:
line    4:
E121: Undefined variable: git
E116: Invalid arguments for function executable(git)
line   11:
8 lines indented 
Press ENTER or type command to continue

Expected Results:  
vim opens and populates the metadata.xml with user data based on the git global information.

$ emerge --info gentoo-syntax
Portage 3.0.30 (python 3.9.12-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-11.3.0, glibc-2.35-r4, 5.17.5-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.17.5-gentoo-x86_64-AMD_Ryzen_9_5900X_12-Core_Processor-with-glibc2.35
KiB Mem:    65846024 total,  36261128 free
KiB Swap:   67108544 total,  67108544 free
Timestamp of repository gentoo: Mon, 02 May 2022 19:48:09 +0000
Head commit of repository gentoo: b64e9bf9ddd99f4c0bac69041ed3880f833430f0

sh bash 5.1_p16
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.4::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           3.9.12::gentoo, 3.10.4::gentoo
dev-lang/rust:             1.60.0::gentoo
dev-util/cmake:            3.23.1::gentoo
dev-util/meson:            0.61.4-r2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          250.5-r1::gentoo
sys-devel/autoconf:        2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           14.0.3::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.3::gentoo
sys-devel/llvm:            14.0.3::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.17-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r4::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: yes

crossdev
    location: /var/db/repos/crossdev
    masters: gentoo
    eclass-overrides: gentoo crossdev

local
    location: /var/db/repos/local
    masters: gentoo
    eclass-overrides: gentoo local

guru
    location: /var/lib/layman/guru
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru.git
    masters: gentoo
    priority: 50

Installed sets: @binwalk
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -fomit-frame-pointer -pipe -march=native -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -fomit-frame-pointer -pipe -march=native -flto"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O3 -fomit-frame-pointer -pipe -march=native -flto"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O3 -fomit-frame-pointer -pipe -march=native -flto"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j14"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities alsa amd64 bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr encode exif flac fortran gdbm gif gpm gtk gui iconv icu ipv6 jpeg kde kwallet lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf plasma png policykit ppds pulseaudio qml qt5 readline sdl seccomp semantic-desktop spell split-usr ssl startup-notification svg systemd tiff truetype udev udisks unicode upower usb vorbis widgets wxwidgets x264 xattr xcb xml xv xvid zeroconf zlib" ABI_X86="64" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-US es es-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_SOFTMMU_TARGETS="aarch64 arm avr i386 m68k mips mips64 mips64el mipsel ppc ppc64 riscv32 riscv64 x86_64" QEMU_USER_TARGETS="aarch64 arm avr i386 m68k mips mips64 mips64el mipsel ppc ppc64 riscv32 riscv64 x86_64" RUBY_TARGETS="ruby26 ruby27 ruby30 ruby31" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

app-vim/gentoo-syntax-2::gentoo was built with the following:
USE="-ignore-glep31" ABI_X86="(64)"
Comment 1 Furude Rika 2022-05-03 14:48:42 UTC
Created attachment 776462 [details, diff]
My local patch which may solve the issue
Comment 2 Larry the Git Cow gentoo-dev 2022-07-13 05:26:57 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=78a5911061ca302505f86aaefd94a392f5c958a1

commit 78a5911061ca302505f86aaefd94a392f5c958a1
Author:     Anna Vyalkova <cyber+gentoo@sysrq.in>
AuthorDate: 2022-06-22 14:27:59 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2022-07-13 05:21:49 +0000

    gentoo-common: fix "Undefined variable: git"
    
    Closes: https://bugs.gentoo.org/842249
    Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
    Closes: https://github.com/gentoo/gentoo-syntax/pull/47
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 plugin/gentoo-common.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)