Permalink
Browse files

Added Arch Linux package support

  • Loading branch information...
1 parent 0d7e498 commit 53874c8959ca7436398e0eb07f477b3e815a7406 noryb009 committed Mar 3, 2012
View
5 0setup
@@ -38,6 +38,7 @@ do
# decompress the package list
case $package_list_url in
+ *.db.tar.gz) ;; # arch
*.gz)
echo " decompressing"
temp="$(mktemp -u)"
@@ -48,7 +49,7 @@ do
# convert the package list to the common format
echo " converting to the common format"
- $distro/convert_package_list $temp_file | sort > repos/$repository_name
+ $distro/convert_package_list $temp_file $repository_name | sort > repos/$repository_name
if [ 0 -ne $? ]
then
echo "Error: failed to convert the package list."
@@ -60,4 +61,4 @@ do
echo " cleaning up"
rm -f $temp_file
done
-done
+done
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# usage: convert_package_list $package_list $repository_name
+
+. ./conf/distrorc
+
+case $DISTRO_ARCH in
+ x86_64)
+ suffix="x86_64"
+ ;;
+ *)
+ suffix="i686"
+ ;;
+esac
+
+repository="${2#arch-}"
+
+temp_folder="$(mktemp -d)"
+cd "$temp_folder"
+tar xzf "$1"
+
+for folder in *
+do
+ awk -v pkgpath="$repository" -v arch="$suffix" '{
+ if($1 == "%FILENAME%"){getline filename}
+ if($1 == "%NAME%"){getline pkgname}
+ if($1 == "%VERSION%"){getline pkgver; split(pkgver, pkgverarr, "-")}
+ if($1 == "%DESC%"){getline pkgdesc}
+ }END{printf("%s|%s|%s|%s/os/%s/%s|%s|\n", pkgname, pkgverarr[1], pkgverarr[2], pkgpath, arch, filename, pkgdesc)}' "$folder/desc"
+done
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# usage: extract_package $package $dest
+
+# create the output directory
+mkdir -p "$2"
+
+# extract the package
+case "$1" in
+ *.pkg.tar.xz)
+ compression_flag="J"
+ ;;
+ *.pkg.tar.bz2)
+ compression_flag="j"
+ ;;
+ *.pkg.tar.gz)
+ compression_flag="z"
+ ;;
+esac
+
+tar x${compression_flag}f "$1" -C "$2"
+[ 0 -ne $? ] && exit 1
+
+[ -f "$2/.PKGINFO" ] && rm "$2/.PKGINFO"
+[ -f "$2/.INSTALL" ] && rm "$2/.INSTALL"
+[ -f "$2/.CHANGELOG" ] && rm "$2/.CHANGELOG"
+
+exit 0
View
@@ -0,0 +1,25 @@
+# include the distribution information file
+. ./conf/distrorc
+
+case $DISTRO_ARCH in
+ x86_64)
+ suffix="x86_64"
+ ;;
+ *)
+ suffix="i686"
+ ;;
+esac
+
+version="$(cat distro/arch/version)"
+
+# repositories - package list URL|repository name
+repositories="http://mirror.csclub.uwaterloo.ca/archlinux/core/os/$suffix/core.db.tar.gz|arch-core
+ http://mirror.csclub.uwaterloo.ca/archlinux/extra/os/$suffix/extra.db.tar.gz|arch-extra
+ http://mirror.csclub.uwaterloo.ca/archlinux/community/os/$suffix/community.db.tar.gz|arch-community"
+
+# package download mirrors - more at http://www.archlinux.org/mirrors/status/
+mirrors="http://mirror.csclub.uwaterloo.ca/archlinux
+ http://mirror.ece.vt.edu/archlinux/
+ http://mirror.rit.edu/archlinux
+ http://ftp5.gwdg.de/pub/linux/archlinux/
+ http://archlinux.mirrors.ovh.net/archlinux/"
View
@@ -0,0 +1 @@
+rolling-release
@@ -1,6 +1,6 @@
#!/bin/sh
-# usage: convert_package_list $package_list
+# usage: convert_package_list $package_list $repository_name
awk -F ":" '
function trimB(s) {sub(/^ */,"",s); return s} # trim beginning of string
@@ -1,5 +1,5 @@
#!/bin/sh
-# usage: convert_package_list $package_list
+# usage: convert_package_list $package_list $repository_name
-cat "$1"
+cat "$1"

0 comments on commit 53874c8

Please sign in to comment.