Permalink
Browse files

Merged Debian and Ubuntu support changes by noryb009

  • Loading branch information...
1 parent f4b0172 commit 2a6251df2a04159ce88ce45f233b143a20e74274 @dimkr committed Mar 8, 2012
View
19 0setup
@@ -38,15 +38,24 @@ do
# decompress the package list
case $package_list_url in
- *.db.tar.gz) ;; # arch
*.gz)
- echo " decompressing"
- temp="$(mktemp -u)"
- cat $temp_file | gzip -d > $temp
- mv -f $temp $temp_file
+ compression="gzip"
+ ;;
+ *.bz2)
+ compression="bzip2"
+ *)
+ compression=""
;;
esac
+ if [ -n "$compression" ]
+ then
+ echo " decompressing"
+ temp="$(mktemp -u)"
+ cat $temp_file | $compression -d > $temp
+ mv -f $temp $temp_file
+ fi
+
# convert the package list to the common format
echo " converting to the common format"
$distro/convert_package_list $temp_file $repository_name | sort > repos/$repository_name
View
@@ -1,6 +1,7 @@
Authors
-------
- Dima Krasner (dima@dimakrasner.com)
+ - noryb009
Contributors
------------
@@ -18,5 +19,3 @@ development of roar-ng and deserve many kudos:
- Slackware - extremely useful and inspirational build scripts, inspiration
for the creation of hpm
- 2byte - a hpm bug report
- - noryb009 - Arch Linux support and an awk-based Slackware package list
- converter
@@ -26,5 +26,8 @@ do
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"
+ }END{printf("%s|%s|%s|%s/os/%s/%s|%s\n", pkgname, pkgverarr[1], pkgverarr[2], pkgpath, arch, filename, pkgdesc)}' "$folder/desc"
done
+
+cd /
+rm -rf "$temp_folder"
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# usage: convert_package_list $package_list $repository_name
+
+awk -F ": " '
+ function printPkg() {
+ printf("%s|%s|%s|%s|%s\n", pkgname, pkgverarr[1], pkgverarr[2], filename, pkgdesc)
+ pkgname=""; pkgverarr[1]=""; pkgverarr[2]=""; filename=""; pkgdesc="" # clear vars
+ }
+ {
+ if($1 == "Package"){pkgname=$2}
+ if($1 == "Version"){split($2,pkgverarr,"-")}
+ if($1 == "Filename"){filename=$2}
+ if($1 == "Description"){pkgdesc=$2}
+ if($0 == "" && pkgname!=""){printPkg()}
+}END{if(pkgname!=""){printPkg()}}' "$1"
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# usage: extract_package $package $dest
+
+# create the output directory
+mkdir -p "$2"
+
+# extract the package
+dataFile="$(ar t "$1" | grep "data.tar")"
+
+case "$dataFile" in
+ *.tar.xz)
+ compression_flag="-J"
+ ;;
+ *.tar.lzma)
+ compression_flag="--lzma"
+ ;;
+ *.tar.bz2)
+ compression_flag="-j"
+ ;;
+ *.tar.gz)
+ compression_flag="-z"
+ ;;
+ *.tar)
+ compression_flag=""
+ ;;
+esac
+
+ar p "$1" "$dataFile" | tar x ${compression_flag} -C "$2"
+[ 0 -ne $? ] && exit 1
+
+exit 0
View
@@ -0,0 +1,25 @@
+# include the distribution information file
+. ./conf/distrorc
+
+case $DISTRO_ARCH in
+ # possible arches: alpha amd64 arm armel armhf hppa hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 s390x sparc
+ x86_64)
+ suffix="amd64"
+ ;;
+ *)
+ suffix="i386"
+ ;;
+esac
+
+version="$(cat distro/debian/version)"
+
+# repositories - package list URL|repository name
+repositories="http://mirror.csclub.uwaterloo.ca/debian/dists/$version/main/binary-$suffix/Packages.bz2|debian-main
+ http://mirror.csclub.uwaterloo.ca/debian/dists/$version/contrib/binary-$suffix/Packages.bz2|debian-contrib
+ http://mirror.csclub.uwaterloo.ca/debian/dists/$version/non-free/binary-$suffix/Packages.bz2|debian-non-free"
+
+# package download mirrors - more at http://www.debian.org/mirror/list
+mirrors="http://mirror.csclub.uwaterloo.ca/debian
+ http://http.us.debian.org/debian
+ http://debian.lcs.mit.edu/debian
+ http://ftp.iinet.net.au/debian/debian"
View
@@ -0,0 +1 @@
+squeeze
@@ -10,7 +10,7 @@ awk -F ":" '
sub(/\..*/,"",namearr[namelen]); pkgrev=namearr[namelen] # remove ".t(gz/xz/...)" from pkgrev
pkgver=namearr[namelen-2] # get version
for(i=1;i<namelen-2;i++){pkgname=pkgname"-"namearr[i]} sub(/^-/, "", pkgname) # for each remaining field, add to name, then remove beginning "-"
- printf("%s|%s|%s|%s/%s|%s|\n",pkgname,pkgver,pkgrev,pkgpath,filename,pkgdesc) # print
+ printf("%s|%s|%s|%s/%s|%s\n",pkgname,pkgver,pkgrev,pkgpath,filename,pkgdesc) # print
}
pkgname=""; pkgver=""; pkgrev=""; pkgpath=""; filename=""; pkgdesc=""; # clear vars
}
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# usage: convert_package_list $package_list $repository_name
+
+distro/debian/convert_package_list "$1" "$2"
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# usage: extract_package $package $dest
+
+distro/debian/extract_package "$1" "$2"
View
@@ -0,0 +1,26 @@
+# include the distribution information file
+. ./conf/distrorc
+
+case $DISTRO_ARCH in
+ x86_64)
+ suffix="amd64"
+ ;;
+ *)
+ suffix="i386"
+ ;;
+esac
+
+version="$(cat distro/ubuntu/version)"
+
+# repositories - package list URL|repository name
+repositories="http://ubuntu.mirror.tudos.de/ubuntu/dists/$version/main/binary-$suffix/Packages.bz2|ubuntu-main
+ http://ubuntu.mirror.tudos.de/ubuntu/dists/$version/universe/binary-$suffix/Packages.bz2|ubuntu-universe
+ http://ubuntu.mirror.tudos.de/ubuntu/dists/$version/multiverse/binary-$suffix/Packages.bz2|ubuntu-multiverse
+ http://ubuntu.mirror.tudos.de/ubuntu/dists/$version/restricted/binary-$suffix/Packages.bz2|ubuntu-restricted"
+
+# package download mirrors - more at https://launchpad.net/ubuntu/+archivemirrors
+mirrors="http://ubuntu.mirror.tudos.de/ubuntu
+ http://mirror.aarnet.edu.au/pub/ubuntu/archive
+ http://mirror.csclub.uwaterloo.ca/ubuntu
+ http://ubuntu.c3sl.ufpr.br/ubuntu
+ http://ftp.halifax.rwth-aachen.de/ubuntu"
View
@@ -0,0 +1 @@
+oneiric

0 comments on commit 2a6251d

Please sign in to comment.