You are not logged in.

#1 2018-10-22 18:03:55

regid
Member
Registered: 2016-06-06
Posts: 201

Source extraction: without --strip-components 1, bsdtar fails

What can I do when the source archive yeilds:

% bsdtar -xf magnifier-3.4.zip
# Omitting all lines but the last 2. The problem is the same: Path contains '..'
../magnifier-3.4/top.bmp: Path contains '..'
bsdtar: Error exit delayed from previous errors.

?
It seems to be only a matter of a missing --strip-components 1:

bsdtar --strip-components 1 -xf magnifier-3.4.zip

Succeeds to extract the archive.
I think the relevant makepkg code is:

% cat -n /usr/share/makepkg/source/file.sh | sed -n 120,132p
   120			*)
   121				# See if bsdtar can recognize the file
   122				if bsdtar -tf "$file" -q '*' &>/dev/null; then
   123					cmd="bsdtar"
   124				else
   125					return 0
   126				fi ;;
   127		esac
   128	
   129		local ret=0
   130		msg2 "$(gettext "Extracting %s with %s")" "$file" "$cmd"
   131		if [[ $cmd = "bsdtar" ]]; then
   132			$cmd -xf "$file" || ret=$?

Last edited by regid (2018-10-22 18:11:09)


powerofforreboot.efi (AUR): Utilities to be used from within a UEFI boot manager or shell.

Offline

#2 2018-10-22 19:24:15

loqs
Member
Registered: 2014-03-06
Posts: 17,323

Re: Source extraction: without --strip-components 1, bsdtar fails

This is somehow related to a PKGBUILD and makepkg?  The contents of the former and the output of the latter you have not included.

Offline

#3 2018-10-22 19:44:08

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Source extraction: without --strip-components 1, bsdtar fails

makepkg cannot handle source archives created by crazy people. makepkg has a feature called "noextract" to go with "source", which does what it sounds like, after which you should handle this yourself in prepare().


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2018-10-22 22:09:37

regid
Member
Registered: 2016-06-06
Posts: 201

Re: Source extraction: without --strip-components 1, bsdtar fails

Message deleted by writer because it conveyed wrong information.

Last edited by regid (2018-10-22 22:32:58)


powerofforreboot.efi (AUR): Utilities to be used from within a UEFI boot manager or shell.

Offline

#5 2018-10-22 22:36:41

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

Re: Source extraction: without --strip-components 1, bsdtar fails

--noextract implies --noprepare. If you use the existing source tree, then makepkg assumes it is already prepared and does not run prepare(). If you use --noprepare, then the source is extracted, but prepare() is not run.

Edit: Related post was removed.

Last edited by progandy (2018-10-22 22:37:43)


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

Offline

Board footer

Powered by FluxBB