You are not logged in.
Just been fiddeling around with pacman and came across this: http://wiki.archlinux.org/index.php/Cus … repository, which I find quite brilliant. So I put up a local repo on my computer where I can put all those AUR pkg's to install with pacman -S.
Works brilliantly. However, I would quite like to automate this. I.e. one command that:
1: goes through my build folder and when I makepkg a new AUR package, copies the newly created foo.pkg.tar.xz from folder foo to folder local-repo
2: run
repo-add /path/to/local-repo.db ~/build/local-repo/foo.pkg.tar.xzDoes anyone have any idea as to how to implement this? Because it's dealing with a changing folder structure and variable file names, it's completely beyond my programming skills.
Or is there maybe a script out there that can do this already? I did search but couldn't find anything.
Thanks very much in advance for any form of help.
Last edited by JackH79 (2010-06-30 07:56:53)
Offline
`makerepo` from Xyne perhaps...? I don't have a link handy, sorry...
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
The first part would be easy, IMHO.
The second? I don't know, not until now I've never even thought it was possible to add a localized 'repo'...
*Puts on thinking cap*
If you're reading this; you're awesome.
Offline
something like this if I understand you correctly, it copies the latest pkg.tar.xz file in the makepkg directory into your local repo. You could put in a check to see if makepkg completed succesfully before you do all the copying part of course.
#!/bin/bash
makepkg
cp $( ls -t *pkg.tar.xz | sed -n 1p ) /path/to/local/repo
pushd /path/to/local/repo
rm -f local-repo.db
repo-add local-repo.db *.pkg.tar.xz
popdLast edited by pressh (2010-06-30 06:51:35)
Offline
@fukawi2: thanks for the tip, but it's not quite what I was looking for.
@pressh: Thanks a bunch! Pretty much exactly what I was looking for. Works like a charm. ![]()
One minor thing though: is there a way to add makepkg switches (eg. -s) when giving the command (called it updaur), so that I could just type in like
updaur -s?
Offline
sure, change
makepkgto
makepkg $*this will add all arguments you give to the script to makepkg
[edit]
changed the script to only add the package and not to recreate the whole db, let me know if I made a typo ![]()
#!/bin/bash
makepkg $*
newfile=$( ls -t *pkg.tar.xz | sed -n 1p )
install -m644 ${newfile} /path/to/local/repo/${newfile}
repo-add /path/to/local/repo/local-repo.db /path/to/local/repo/${newfile}Last edited by pressh (2010-06-30 07:57:23)
Offline
Legend!!!
Thanks so much.
EDIT:
[edit]
changed the script to only add the package and not to recreate the whole db, let me know if I made a typo#!/bin/bash makepkg $* newfile=$( ls -t *pkg.tar.xz | sed -n 1p ) install -m644 ${newfile} /path/to/local/repo/${newfile} repo-add /path/to/local/repo/local-repo.db /path/to/local/repo/${newfile}
Sweet! Now it's perfect. What do you want? Tacos? Beer? A hug?
Last edited by JackH79 (2010-06-30 08:23:53)
Offline
Suggestion: use makepkg's PKGDEST variable to move the built package to the local repo, rather than doing it manually. You can either set it in /etc/makepkg.conf or just set it at runtime:
PKGDEST=/path/to/local/repo makepkg "$@"This has the added bonus of not (re)adding a random package to the repo when makepkg fails.
Also, "$@" is preferred over $*, as it will correctly handle any quoted arguments.
Last edited by falconindy (2010-06-30 13:16:28)
Offline
Nifty.
Thanks for the input, falconindy.
Implemented successfully.
Offline