You are not logged in.

#1 2014-06-28 01:58:18

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

[solved] Can no longer untar AUR packages with tar xvf /directory/

For about a year now I've used this line of code from my .bash_aliases file to untar files from their source directory to the one I am currently CDed in at that moment: 

alias tarx='tar xvf'		# extracts files from a tarball using tar [e]x[tract] v[erbose] f[orced]

This alias failed to work a few weeks ago for some unknown reason and now spits out this error:

tarx /media/aur/srcpackages/atom-editor.tar.gz ./

tar: .: Not found in archive

tar: Exiting with failure status due to previous errors

Why on earth would this suddenly stop working.  I haven't changed my .bashrc file apart from some small comments but here it is in case I'm totally out of it:

# ~/.bashrc

######################################################################
#								     #
# This file is sourced by all *interactive* bash shells on startup,  #
# including some apparently interactive shells such as scp and rcp   #
# that can't tolerate any output.  So make sure this doesn't display #
# anything or bad things will happen !				     #
#								     #
# If not running interactively, don't do anything		     #
#								     #
######################################################################
[[ $- != *i* ]] && return 

#################################################################################
#										#
# If the connection to the system is a remote connection 'ssh' will be		#						
## appended to the prompt.  Otherwise the prompt will be displayed normally	#
# See:  remote.colourful.prompt_how-to on /media/lynwyn/networking/ssh		#
#										#
# Default prompt from the above-named document:					#
# export PS1='\[\e[0;31m\]\u@\h:\w${text}$\[\e[m\]'				#	#										#		
#################################################################################
if [ -n "$SSH_CLIENT" ]; then text=":ssh:"
fi

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

### [User Prompts] 

### White Yunzi
export PS1='\[\e[0;37m\]: \[\e[1;92m\]\W\[\e[0;37m\] :\[\e[m\] \[\e[0;37m\]'

#### Silver Yunzi
#export PS1='\[\e[0;37m\]: \[\e[1;94m\]\W\[\e[0;37m\] :\[\e[m\] \[\e[0;37m\]'

### Pink Yunzi 
#export PS1='\[\e[0;37m\]: \[\e[1;95m\]\W\[\e[0;37m\] :\[\e[m\] \[\e[1;95m\]'

### [Root Prompts]

###  White Yunzi Root 
#export PS1='\[\e[1;37m\]:\[\e[1;92m\]\u\[\e[1;37m\]:\[\e[1;92m\]\W\[\e[1;37m\]:\[\e[m\] \[\e[0;37m\]'

### Silver Yunzi Root 
#export PS1='\[\e[0;37m\]:\[\e[1;94m\]\u\[\e[0;37m\]:\[\e[1;94m\]\W\[\e[0;37m\]:\[\e[m\]\[\e[0;37m\]'

### Pink Yunzi Root
#export PS1='\[\e[0;37m\]:\[\e[1;95m\]\u\[\e[0;37m\]:\[\e[1;95m\]\W\[\e[0;37m\]:\[\e[m\] \[\e[0;37\]'

### * BASH options * ### 
### Last edited January 2014 by H.L.
# Bash won't get SIGWINCH if another process is in the foreground.
# Enable checkwinsize so that bash will check the terminal size when
# it regains control.
# [check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.]
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
shopt -s checkwinsize

# automatically prepend cd when entering just a path in the shell
shopt -s autocd

# Enable history appending instead of overwriting.
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000
HISTFILESIZE=20000

## erase duplicate entries in your history file 
## and force Bash History to ignorespace 
export HISTCONTROL=erasedups:ignorespace

###

# set variable identifying the chroot you work in (used in the prompt below)
#if [ -z "$arch_chroot" ] && [ -r /etc/arch_chroot ]; then
#    debian_chroot=$(cat /etc/arch_chroot)
#fi

# make "less" more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

### 
# TMUX
# Put this this snippet BEFORE the aliases in .bashrc.
# This code starts TMUX with only one session (unless you start some manually), on login; 
# it will try to attach to a currently running session.
# If there isn't a currently running session then TMUX will create one.
# if which tmux 2>&1 >/dev/null; then
# if not inside a tmux session, and if no session is started start a new session
# test -z "$TMUX" && (tmux attach || tmux new-session)
# fi
###
	
# environment variables using gedit and nano
export EDITOR="$(if [[ -n $DISPLAY ]]; then echo 'gedit'; else echo 'nano'; fi)"	

###

### Coloured man pages with explanations of colours in comments
# Note to self:  all of the colour & escape statements work ONLY by using double quote marks, e.g. " ... "
## Coloured man pages with explanations of colours in comments
# 67: Primary colour for program names is Dark Green [old 80's CRT green!]
# 68: Optional arguments and/or separate options for arguments is Bright Green
# 69: Text Reset
# 70: Text Reset
# 71: man page info bottom of page is Dark Red on Black background (net effect is transparent background with red writing)
# 72: Text Reset
# 73: References to other programs (and their respective man page(s)) are Bright Yellow [good neutral yellow]

man() {
    env LESS_TERMCAP_mb=$(printf "\e[1;31m") \
	LESS_TERMCAP_md=$(printf "\e[1;31m") \
	LESS_TERMCAP_me=$(printf "\e[0m") \
	LESS_TERMCAP_se=$(printf "\e[0m") \
	LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
	LESS_TERMCAP_ue=$(printf "\e[0m") \
	LESS_TERMCAP_us=$(printf "\e[1;32m") \
	man "$@"
}

###

## To get a skin of your choice loaded instead of mc's default
## skin, you might consider the following solution:
## Multi-User:  Create an alias for mc in your ~/.bashrc, like:
    if [ $TERM = "screen-256color" ]; then
        if [ $USER = "root" ]; then
            myMCSkin="modarcon16root-defbg"
        else
            myMCSkin="modarcon16-defbg"
        fi
        alias mc='mc --skin $myMCSkin'
        alias mcedit="mcedit --skin $myMCSkin"
        alias mcview="mcview --skin $myMCSkin"
        alias mcdiff="mcdiff --skin $myMCSkin"
    fi
###

Last edited by MoonSwan (2014-07-09 04:31:06)

Offline

#2 2014-06-28 02:14:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

Why do you need the './'?

Offline

#3 2014-06-28 02:30:47

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

I use that only because I try to untar apps while in the directory I want the files to be untarred into.  I thought that ./ was the correct syntax to use to do that.  Am I incorrect or is there a better way to do that?

For example I'll CD to ~/aur/sources and once I'm there I used my "tarx ~/aur/srces/nameofapptountar ./" so that the files would be untarred into the directory I was in at the time.

Offline

#4 2014-06-28 02:48:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

I get the same error as you if I use './' or '.'. tar runs fine if I omit the destination - it seems to default to pwd.

Offline

#5 2014-06-28 03:01:49

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

Read the tar manpage. The second parameter is the file to extract from the archive, not where to extract it.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#6 2014-06-28 03:07:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

ids1024 wrote:

Read the tar manpage.

Arch doesn't ship the man page for tar ;P

Offline

#7 2014-06-28 03:19:21

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

karol wrote:

Arch doesn't ship the man page for tar ;P

Really? Then use "tar --help".
edit: or "info tar"

Last edited by ids1024 (2014-06-28 03:37:17)


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#8 2014-06-28 19:53:27

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

I seem to have a larger problem on my desktop machine.  When I try to untar stuff on that one it creates a .cache directory for some weird reason and populates it with, I think, cached files from my home directory.  It ends up having firefox, mc and other cached files in the new directory and then tar just errors out with:

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now 

Very odd behaviour and I'm assuming some config file somewhere is responsible for this behaviour.  But where else can I look apart from .bashrc? 

@ids1024, I'll do what you've what you suggested on my netbook later today and record the information to post afterward.

[edit] Here are the contents of that .cache directory, if it helps:

 dconf event-sound-cache.tdb.silver_yunzi.x86_64-unknown-linux-gnu  event-sound-cache.tdb.tengen.x86_64-unknown-linux-gnu fontconfig mc dmenu_run 
event-sound-cache.tdb.silveryunzi.x86_64-unknown-linux-gnu event-sound-cache.tdb.white_yunzi.x86_64-unknown-linux-gnu  gstreamer-1.0  mozilla 

Last edited by MoonSwan (2014-06-28 19:57:10)

Offline

#9 2014-06-28 20:05:48

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

I just listed the commands to view the documentation for tar.
What archive are you trying to extract, and exactly what command are you using?


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#10 2014-06-28 20:42:56

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

alias tarx='tar xvf'		# extracts files from a tarball using tar [e]x[tract] v[erbose] f[orced]

That is a wrong description. It means t[ape]ar[chive] [e]x[tract] v[erbose] f[ilename]
Without f, tar would read the archive from stdin.

PS: I mostly use bsdtar to deal with archives, its compression autodetection feels more stable to me and since pacman already depends on libarchive, we have get it for free on arch.

Last edited by progandy (2014-06-28 20:44:48)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#11 2014-07-09 04:29:53

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [solved] Can no longer untar AUR packages with tar xvf /directory/

Thanks for the explanation Progandy.  smile

I'm marking this solved because some update fixed the issue.  I don't know which update specifically but the problem has been mended.

Offline

Board footer

Powered by FluxBB