You are not logged in.

#1 2020-03-31 03:56:15

Tropy
Member
Registered: 2020-03-31
Posts: 3

password protected zip file [SOLVED]

Hello gys,

today got som problems with an aur (easy2boot) i shuld download an zip file,

but i thaught get the link inserted it in the pkgbuild fix the name of the package in the pkgbuild file

and run.

*OH no Error* the zip file was password protected i know the password but how to bypass it to pkgbuild (bsdtar --passphrase)

has someone an answer or is this impossible?

may i solfed it by unzip rezip and saha256sum it and fix all things in pkgbuild ! But shuld be possible to attach the password to pkgbuild!

Last edited by Tropy (2020-04-03 22:42:34)

Offline

#2 2020-03-31 05:06:50

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: password protected zip file [SOLVED]

edit
Ignore this and see the following post.

Hi Tropy,

I do not think there is an option in makepkg to use a passphrase when extracting source files from downloaded archives. The commands are hard-coded in makepkg.

Here is a trick that might work. Create a script named "bsdtar" with the following content (replace "foo" with the password):

#!/bin/bash
/usr/bin/bsdtar --passphrase foo "$@"

Place it in the same directory as makepkg, make it executable, and then run makepkg as follows:

PATH=$PWD:$PATH makepkg

Or just use this script to avoid hard-coding the password:

#!/bin/bash
set -eu

if [[ $# -lt 1 ]]
then
  echo "usage: ${0##*/} <passphrase> [makepkg args]" >&2
  exit 1
fi

passphrase=$1
shift

cat > bsdtar <<BSDTAR
#!/bin/bash
/usr/bin/bsdtar --passphrase ${passphrase@Q} "\$@"
BSDTAR
trap "rm ${PWD@Q}/bsdtar" EXIT
chmod +rx bsdtar

PATH=$PWD:$PATH makepkg "$@"

Save it on your path as "makepkg-passphrase" and make it executable, then run it with

makepkg-passphrase <passphrase> [makepkg args]

Last edited by Xyne (2020-04-01 03:56:27)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2020-04-01 00:43:33

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

Re: password protected zip file [SOLVED]

If the PKGBUILD requires this, then it should be an intrinsic part of the PKGBUILD.

You can use the noextract=() array to prevent makepkg from trying to extract it, then manually extract it yourself in a prepare() function.


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

Offline

#4 2020-04-01 03:55:57

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: password protected zip file [SOLVED]

eschwartz wrote:

You can use the noextract=() array to prevent makepkg from trying to extract it

Yep, that would be the sane solution. Ignore my previous post. I've never used that option so I didn't even think of it.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2020-04-03 22:17:15

Tropy
Member
Registered: 2020-03-31
Posts: 3

Re: password protected zip file [SOLVED]

Thanks for your quick reply !


well explained

Offline

#6 2020-04-03 22:36:10

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,656
Website

Re: password protected zip file [SOLVED]

Please remember to mark your thread as solved by editing your first post and amending the topic title.

https://wiki.archlinux.org/index.php/Co … ow_to_post


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2020-04-03 22:46:12

Tropy
Member
Registered: 2020-03-31
Posts: 3

Re: password protected zip file [SOLVED]

WorMzy wrote:

Please remember to mark your thread as solved .....

Thx don't forgett struggling inet sry

Offline

Board footer

Powered by FluxBB