3 # Initial version by Graeme 'XorA' Gregory, Further changes by Koen Kooi
5 # Run this from inside ${DEPLOY_DIR} e.g. tmp/deploy/glibc/
8 REMOTEM
=http
://www.angstrom-distribution.org
10 # Feed dir we want to upload to
11 REMOTED
=feeds
/next
/ipk
/$
(basename $PWD)
14 mkdir
-p upload-queue || true
16 # Find and delete morgue dirs, we don't need them
17 echo "Deleting morgue directories"
18 find ipk
/ -name "morgue" -exec rm -rf \
{\
} \
;
20 # Copy symlink packages to an upload queue
21 echo "Symlink packages to upload queue"
22 find ipk
/ -name "*.ipk" -exec ln -sf ${PWD}/\
{\
} upload-queue
/ \
;
24 # Find file already present on webserver
25 echo "Getting file list from server"
26 wget
$REMOTEM/$REMOTED/unsorted
/files-sorted
-O files-remote
27 ls upload-queue
/ |
grep -v morgue
> files-local
29 # Check for files already present on webserver
30 echo "Checking for duplicates"
31 cat files-remote files-local |
sort |
uniq -u >files-uniq
32 cat files-uniq files-local |
sort |
uniq -d > files-trans
34 rm -f upload-queue
/bigbuck
*
36 # Clean out stale packages
37 if [ -d personal-feed
] ; then
41 mkdir
-p personal-feed
43 # Copy over non-duplicate files
44 echo "Starting rsync..."
45 rsync
-vz --partial --copy-links --progress --files-from=files-trans upload-queue
/ personal-feed
/
47 echo "Generating index for your personal feed..."
48 ( cd personal-feed
; PATH
=$PATH:$
(find ..
/..
/..
/sysroots
/$
(uname
-m)* -name "opkg-make-index" |
sed s
:/opkg-make-index
::g
) opkg-make-index
-p Packages
-m .
>& /dev
/null
)
51 # Clean up temporary files
52 echo "Removing upload queue"
53 rm -rf files-remote files-local files-uniq files-trans upload-queue
55 echo "Your personal feed is now ready at ${PWD}/personal-feed"