Source installed byobu doesn't start : "...status': Is a directory"

Bug #1025998 reported by Tomi Hukkalainen
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Medium
Dustin Kirkland 

Bug Description

$ tar -xf Downloads/byobu_5.21.orig.tar.gz
$ cd byobu-5.21
$ ./configure --prefix="$HOME/.local/"
$ make
$ make install
$ cd
$ byobu
rm: cannot remove `/home/tpievila/.local/share/byobu/status': Is a directory

$ ls -R .local/share/byobu/
.local/share/byobu/:
ec2/ keybindings/ pixmaps/ profiles/ status/ tests/ windows/

.local/share/byobu/ec2:
rates.ap-northeast-1 rates.ap-southeast-1 rates.eu-west-1 rates.us-east-1 rates.us-west-1 rates.us-west-2

.local/share/byobu/keybindings:
common f-keys f-keys.screen f-keys.screen.disable f-keys.tmux f-keys.tmux.disable none

.local/share/byobu/pixmaps:
byobu.svg

.local/share/byobu/profiles:
byoburc common NONE screenrc tmux tmuxrc

.local/share/byobu/status:
status statusrc

.local/share/byobu/tests:
byobu-time-notifications*

.local/share/byobu/windows:
common*

Revision history for this message
afoglia (afoglia) wrote :

The error is raised by the following in byobu-janitor

    # Affects: Upgrades from <= byobu 4.30
    # Clear out old style status configuration
    if ! grep -qs "^screen_upper_left=" "$BYOBU_CONFIG_DIR/status"; then
            rm -f "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc"
    fi

I'm installing byobu essentially as the user above is (I'm using stow to place it in .local, but otherwise, it's the same), and lib/byobu/include/dirs is determing BYOBU_CONFIG_DIR to be .local/share/byobu.

By explicitly setting BYOBU_CONFIG_DIR to another directory (i.e. ~/.byobu) byobu-janitor runs.

So it's a conflict between the way the files are laid out in ~/.local/share/byobu when installing into .local and when solely using ~/.local/share/byobu for user-specific configuration. I don't know enough about the XDG standard to give a solution.

Revision history for this message
afoglia (afoglia) wrote :

Ah, looking more closely at the XDG base directory spec and other pages about it, I think byobu should be looking for user configuration files under ~/.config (not ~/.local/share).

From the spec, "$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used."

If you consider the stuff in the old ~/.byobu to be closer to data files than configuration files, then looking under ~/.local/share makes sense, but you should check user-specified $XDG_DATA_HOME instead of $XDG_CONFIG_HOME.

Changed in byobu:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Arg. Okay. Everything about XDG drives me bonkers. I'm looking at the spec again now.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Committed revision 2019.

Changed in byobu:
status: In Progress → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
Revision history for this message
Bram Geron (bgeron) wrote :

I stumbled on this error again in 5.123. It seems 'make install' for me is putting files in ~/.local/share/byobu, and then usr/lib/byobu/include/dirs is detecting that as my chosen configuration path.

I have ~/.byobu/ already from an old installation. I have ~/.config but XDG_CONFIG_HOME not set, I don't have ~/.config/byobu, and (because of make install) I have ~/.local/share/byobu so that seems to be what it's picking up on.

Cheers, Bram

Revision history for this message
Garrett Mitchener (garrett-mitchener) wrote :

I just saw this again in 5.129. I did

./configure --prefix=$HOME/.local
make
make install

I worked around it by replacing part of byobu-janitor (at line 53)

# Affects: Upgrades from <= byobu 4.30
# Clear out old style status configuration
if ! grep -qs "^screen_upper_left=" "$BYOBU_CONFIG_DIR/status"; then
        rm -f "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc"
fi

with

# Affects: Upgrades from <= byobu 4.30
# Clear out old style status configuration
# WGM: Added additional check to avoid problem with the fact that
# $BYOBU_CONFIG_DIR/status is a directory these days:
if [ -f "$BYOBU_CONFIG_DIR/status" ]; then
    if ! grep -qs "^screen_upper_left=" "$BYOBU_CONFIG_DIR/status"; then
        rm -f "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc"
    fi
fi

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.