You are not logged in.
Pages: 1
im trying to do the instructions on arch wiki to recover pacman.
and i dont understad this bit:
Performing the recovery
As a normal user, make temporary directories for the cache, database, and root:
tmp=~/tmp
mkdir -p "${tmp}"
pushd "${tmp}"
dbpath=$(readlink -f ./dbpath)
root=$(readlink -f ./root)
cache=$(readlink -f ./cache)
log=/dev/null
mkdir -p "${dbpath}" "${cache}" "${root}"
popd
recovery-pacman() {
fakeroot pacman "$@" \
--dbpath "${dbpath}" \
--root "${root}" \
--cache "${cache}" \
--log "${log}" \
--noscriptlet \
#
}
Populate the temporary sync database:
$ recovery-pacman -Sy
i take it i have to make a file for script, make it executable with
chmod -x file
./file
so i do that, but then when i try todo recovery-pacman -Sy
i get:
recovery-pacman -Sy
bash: recovery-pacman: command not found
what am i doing wrong?
Offline
When pasting code, please use [ code ] tags https://bbs.archlinux.org/help.php#bbcode
like thisIt makes the code more readable and more convenient to scroll through.
Is your script in $PATH? If not, you need to use the full path
/path/to/recovery-pacman -SyIf the script is in your woking directory, do
./recovery-pacman -SyLast edited by karol (2011-11-06 16:55:38)
Offline
As karol says. Or, if you are in the directory of the script you can simply:
./recovery-pacman -Sy#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.
Offline
thanks for fast reply.
ive tried that as well and i get
[aidas@myhost ~]$ ./recovery-pacman -Sy
bash: ./recovery-pacman: No such file or directoryOffline
Where do you have this file? Go to that directory and try again.
i take it i have to make a file for script, make it executable with
chmod -x file
./file
'recovery-pacman' is the name of the function, what's the filename? You need to use the filename of the script.
Last edited by karol (2011-11-06 17:18:57)
Offline
so say if the file name is script, i should run ./script -Sy?
Offline
so say if the file name is script, i should run ./script -Sy?
As for running the script is concerned, yes.
You can create
#!/bin/bash
echo fooname it 'test1', make executable 'chmod +x test1' and run it with './test1' just to see if you get how to call a script.
Offline
i can run that test1, it creates temporary folders. it just when i run test1 -Sy, i think it ment to populate temporary sync data, witch i think means it has to copy some stuff to them temporary folders that were created, but they all empty. so i presume i'm not getting something.
script in temp1:
tmp=~/tmp
mkdir -p "${tmp}"
pushd "${tmp}"
dbpath=$(readlink -f ./dbpath)
root=$(readlink -f ./root)
cache=$(readlink -f ./cache)
log=/dev/null
mkdir -p "${dbpath}" "${cache}" "${root}"
popd
recovery-pacman() {
fakeroot pacman "$@" \
--dbpath "${dbpath}" \
--root "${root}" \
--cache "${cache}" \
--log "${log}" \
--noscriptlet \
#
} Offline
and i understood how to run that script u posted before
#!/bin/bash
echo fooresult "foo" printed after execution.
Offline
Pages: 1