You are not logged in.
I have seen numerous posts on the forums asking for an easy way to backup and restore installed software for purposes of backup, migration or simply for convenience. Packup attempts to fill this void. Simply put, Packup is an ncurses wrapper for Pacman which provides a simple backup/restore/migration system for Arch. Don't believe me? Try it for yourself!
Offline
I had to change line 277 (8 -> 9):
awk '{ print $9 }'
and (line 303 - 311)
test=$?
if [ $test -eq 0 ]; then
PKGMAN="pacman --noconfirm --noprogressbar -S "
restore_install
elif [ $test -eq 3 ]; then
PKGMAN="yaourt --noconfirm --noprogressbar -S "
restore_install
else
clear
exit
fi
It is what you make it. Even if you don't know what to make it.
Offline
thanks for the input!
by default it should be $8 not $9... I'd love to know why yours responds differently.
same with the test=$?, that extra variable shouldn't be necessary, but I'd love to know why your setup required it.
please keep testing and let me know!
Offline
by default it should be $8 not $9... I'd love to know why yours responds differently.
┌─[~]
└─╼ ls -Bl packup-*
-rw-r--r-- 1 julia users 2633 2. Jan 18:22 packup-complete-20090102-1821
┌─[~]
└─╼ ls -Bl packup-* | egrep -v '^d' | awk '{ print $8 }'
18:22
Maybe the problem is a different date format (de_DE.utf8).
┌─[~]
└─╼ ls -Bl --time-style=iso packup-* | egrep -v '^d' | awk '{ print $8 }'
packup-complete-20090102-1821
If i select "Run Yaourt" the program exits, i don't know, maybe the exit status of the if condition (if [ $? = 0 ]) overrides the selection?
┌─[~]
└─╼ if [ $? = 1 ]; then echo abcdef; elif [ $? = 1 ]; then echo fedcba; fi
fedcba
Or is it just me?
It is what you make it. Even if you don't know what to make it.
Offline
Ghost1227 wrote:by default it should be $8 not $9... I'd love to know why yours responds differently.
┌─[~] └─╼ ls -Bl packup-* -rw-r--r-- 1 julia users 2633 2. Jan 18:22 packup-complete-20090102-1821 ┌─[~] └─╼ ls -Bl packup-* | egrep -v '^d' | awk '{ print $8 }' 18:22
Maybe the problem is a different date format (de_DE.utf8).
┌─[~] └─╼ ls -Bl --time-style=iso packup-* | egrep -v '^d' | awk '{ print $8 }' packup-complete-20090102-1821
Good point - added --time-style to the script, should fix that problem...
If i select "Run Yaourt" the program exits, i don't know, maybe the exit status of the if condition (if [ $? = 0 ]) overrides the selection?
┌─[~] └─╼ if [ $? = 1 ]; then echo abcdef; elif [ $? = 1 ]; then echo fedcba; fi fedcba
Or is it just me?
I think you miscopied something there...
if [ $? = 1 ]; ... elif [ $? = 1 ]; ...
it's kinda redundant... shouldn't one of those be =0? or =3? i'm not even sure which function you're referencing.
Offline
Try not to hardcode xdg paths.
Eg, to find a packuprc, you should do something like
for config_dir in `echo ${XDG_CONFIG_HOME:-$HOME/.config}:${XDG_CONFIG_DIRS:-/etc/xdg} | sed 's/:/\t/g'`
do
<if you find a config file, source it and break from loop>
done
To find data, use
${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-'/usr/local/share/:/usr/share/'} | sed 's/:/\t/g'
Etc.
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Interesting. A neat feature would be an option which backs up any config file which is marked as backup and has changed since install. You can find this out by looking in /var/lib/pacman/local/*/files.
Just a few bash tips...
* $(find /stuff) instead of backticks `find /stuff `
* Use find or shell expansion instead of ls - ls is unreliable.
* Use bash's inbuilt [[ ]] rather than [ ].
More good bash stuff here: http://wooledge.org:8000/BashGuide and http://wooledge.org:8000/BashFAQ
Cheers!
James
Offline
This is awesome, great job. Cheers!
Offline
Offline