[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

debian-ports and debootstrap : the way of custom mini-repositories



Hi,

We discussed previously on the list ([1]) the possibility of
custom (home-made) mini-repositories : an excerpt of 
the archive at debian-ports with the bare minimum to use an 
unmodified version of debootstrap.

The general opinion was that patching debootstrap for debian-ports
would be better.

Just for completeness, here are updated versions of the scripts
'installable.py' and 'dpo_ad_hoc.sh' that I used as an illustration.
(In the following, there are patches to correct the scripts in [1] :
there are no Packages.bz2 files in the regular debian archive any more)

Some examples :
* A mini-repository for alpha with a SCSI firmware and a bootloader could
be built as :

./installable.py -a alpha -m http://ftp.de.debian.org/debian-ports \
 -w some_scratch -P listep-alpha
./dpo_ad_hoc.sh -w some_scratch -a alpha \
 -M http://ftp.de.debian.org/debian-ports \
 -N http://ftp.de.debian.org/debian \
 -l listep-alpha \
 -p "aboot/1.0~pre20040408-4,aboot-base/1.0~pre20040408-4" \
 -d my_repository -g -r "firmware-qlogic/0.43"

To make a chroot as root :

debootstrap --arch=alpha --components=main,non-free --no-check-gpg \
 --include=debian-ports-archive-keyring,aboot,aboot-base,firmware-qlogic \
 unstable my_chroot file:///$(readlink -f my_repository)

cat > my_chroot/etc/apt/sources.list <<EOF
deb http://ftp.de.debian.org/debian-ports unstable main
deb http://ftp.de.debian.org/debian-ports unreleased main
EOF

* In the m68k archive, aptitude and aptitude-common version numbers do not
match : -  aptitude-common (Version: 0.6.10-1)
-  aptitude (Version: 0.6.8.2-1.2)
(as it stood Wed Jun  4 23:13:38 UTC 2014)

(In this example, package validation requires an old key from debian-ports :
wget http://ftp.debian-ports.org/archive/archive_2013.key
gpg --keyring ./my_keyring.gpg --no-default-keyring --import archive_2013.key
gpg --keyring ./my_keyring.gpg --no-default-keyring --import /usr/share/keyrings/debian-ports-archive-keyring.gpg
)

./installable.py -a m68k -w some_scratch -P listep-m68k \
  --exclude=aptitude,aptitude-common
./dpo_ad_hoc.sh -w some_scratch -a m68k -k ./my_keyring.gpg \
  -l listep-m68k -p "aptitude/0.6.8.2-1.2"  \
  -d my_repository -g -s 20140120T071908Z "aptitude-common/0.6.8.2-1.2"

The last step as root (untested) :
debootstrap --arch=m68k --no-check-gpg --include=debian-ports-archive-keyring \
 unstable my_chroot file:///$(readlink -f my_repository)

cat > my_chroot/etc/apt/sources.list <<EOF
deb http://ftp.debian-ports.org/debian unstable main
deb http://ftp.debian-ports.org/debian unreleased main
EOF

Regards,
JH Chatenet

[1] : http://lists.debian.org/debian-alpha/2013/12/msg00019.html
      http://lists.debian.org/debian-68k/2013/12/msg00126.html

PS : Please CC me, I am not on the list.

PS2: at the present time, '--exclude=aptitude,aptitude-common,wget' is
needed in the m68k example.

PS3 : sorry for this lengthy mail - my preceding tries were rejected with
<debian-68k@lists.debian.org>: host
    bendel.debian.org[2001:41b8:202:deb:216:36ff:fe40:4002] said: 550 5.7.1 No
    attachments allowed (in reply to end of DATA command)

<debian-alpha@lists.debian.org>: host
    bendel.debian.org[2001:41b8:202:deb:216:36ff:fe40:4002] said: 550 5.7.1 No
    attachments allowed (in reply to end of DATA command)
What should be done ?

--- a/installable.py	2013-12-17 08:44:51.199868340 +0200
+++ b/installable.py	2014-06-25 00:07:13.000000000 +0200
@@ -184,6 +184,8 @@
     subfield_parts = subfield.split('(')
     package = subfield_parts[0]
     package = package.strip()
+# ignore multiarch
+    package = package.split(':')[0]
 
     condition = ''
     if len(subfield_parts) > 1:
@@ -875,7 +877,7 @@
     if  os.path.exists(args.workdir):
         print "-----> Using ",args.workdir
     else:
-        print "........Need to create ",workdir
+        print "........Need to create ",args.workdir
         os.mkdir(args.workdir)
 
     suites = ['unstable', 'unreleased']
@@ -884,13 +886,13 @@
         for arch in arches:
             for suite in suites:
                 dlpath=args.mirror+'/dists/'+suite+'/main'+'/binary-'+arch+'/Packages.bz2'
-                dstpath=pkgpath('',suite,arch)
+                dstpath=pkgpath(args.workdir,suite,arch)
                 print "........Download",dlpath
                 if dlpath[0:8]=='file:///':
                     dlpath=dlpath[7:]
                     shutil.copyfile(dlpath,args.workdir+'/'+dstpath)
                 else:
-                    os.system('wget --directory-prefix='+args.workdir+' --output-document='+dstpath+' '+dlpath)
+                    os.system('wget --output-document='+dstpath+' '+dlpath)
 
 # unstable should be sorted through apt-sortpkgs by mini-dak on debian-ports
                 if suite == 'unstable' and args.check_if_sorted == True and os.system('which bunzip2 > /dev/null') == 0 and os.system('which apt-sortpkgs > /dev/null') == 0:
@@ -1105,7 +1107,7 @@
 
 # Will all essential packages be installed ?
             if args.no_check_essential == False:
-                print "-----> Checking essential packages"
+                print "---> Checking essential packages"
                 essential_packages = set(package[0] for package in packages_in_unstable if package[9])
                 essential_packages.update(package[0] for package in packages_in_unreleased if package[9])
                 forgotten_essential_packages = essential_packages.difference(set(required_packages))
@@ -1119,7 +1121,7 @@
 # dependency check
 
             if args.no_dependency_check == False:
-                print "-----> Checking dependencies"
+                print "---> Checking dependencies"
 
                 dependency_problems, breakage_problems, conflict_problems = check_all_dependencies(required_packages, base_packages, packages_in_unstable + packages_in_unreleased)
 
@@ -1157,7 +1159,7 @@
                             print 'base',
                         print ' package '+cproblem[0]+'('+cproblem[1]+') conflicts with ',cproblem[3],' - ',cproblem[4],'will be installed or provided'
 
-                print "=======> Conclusion"
+                print "===> Conclusion"
                 print
                 if precedence == 'no-unreleased' and args.no_resolve_deps == True and len(needed_in_unsorted_in_unstable) > 0:
                     print arch,"....The installation should fail (unsorted entries in Packages files)"
@@ -1165,6 +1167,7 @@
                     print arch,"....The installation should fail (dependency, breakage and/or conflict problems)"
                 else:
                     print arch,"....The installation would succeed"
+                print
 
 # Paths (on the server) of packages to install

--- a/dpo_ad_hoc.sh	2013-12-17 08:49:17.946180686 +0200
+++ b/dpo_ad_hoc.sh	2014-06-10 23:15:22.000000000 +0200
@@ -20,6 +20,22 @@
 
 WORKDIR="."
 
+# ask for confirmation and exit
+# argument : retcode
+ask_exit() {
+    retcode="$1"
+
+# iff stdin is a terminal
+    if [ -t 0 ]; then
+        read -p "Continue anyway (y/N) ?" reply
+        if [ "${reply#Y}" != "$reply" -o "${reply#y}" != "$reply" ]; then
+            return
+        fi
+    fi
+
+    exit "$retcode"
+}
+
 # download one file from mirror to destination
 # arguments : mirror file top
 download_one_package() {
@@ -63,7 +79,7 @@
             wget -x --directory-prefix="$destination" "${mirror}/dists/${suite}/$f"
         done
         for component in $component_list; do
-            for f in Release Packages.bz2; do
+            for f in Release Packages.gz; do
                 wget -x --directory-prefix="$destination" "${mirror}/dists/${suite}/${component}/binary-${architecture}/$f"
             done
         done
@@ -95,20 +111,20 @@
             return $ret
         fi
 
-# Packages.bz2 : check checksum
+# Packages.gz : check checksum
         for component in $component_list; do
-            for packages_file in ${top}/dists/${suite}/${component}/binary-*/Packages.bz2; do
+            for packages_file in ${top}/dists/${suite}/${component}/binary-*/Packages.gz; do
                 subpath="${packages_file#${top}/dists/${suite}/}"
-                bz2md=$(sed -n '/^SHA256:/,/^SHA512:/p' < "$release"| \
+                gzmd=$(sed -n '/^SHA256:/,/^SHA512:/p' < "$release"| \
                     while read a b c; do \
                         if [ "$c" = "$subpath" ]; then echo "$a $b"; fi; \
                     done | head -n 1)
-                if [ -z "$bz2md" ]; then
+                if [ -z "$gzmd" ]; then
                     echo " $packages_file not found in $release"
                     return 1
                 fi
-                expsha256=$(echo "$bz2md" | cut -d ' ' -f 1)
-                expsize=$(echo "$bz2md" | cut -d ' ' -f 2)
+                expsha256=$(echo "$gzmd" | cut -d ' ' -f 1)
+                expsize=$(echo "$gzmd" | cut -d ' ' -f 2)
                 relsha256=$(sha256sum "$packages_file" | cut -d ' ' -f 1)
                 relsize=$(wc -c "$packages_file" | cut -d ' ' -f 1)
                 if [ $relsize -ne $expsize ]; then
@@ -167,8 +183,8 @@
     top="${top%/}"
     for suite in $suite_list; do
         for component in $component_list; do
-            packages_file=${top}/dists/${suite}/${component}/binary-${architecture}/Packages.bz2
-            bzcat "$packages_file" | awk -v package_list="$package_list" \
+            packages_file=${top}/dists/${suite}/${component}/binary-${architecture}/Packages.gz
+            zcat "$packages_file" | awk -v package_list="$package_list" \
                 'BEGIN {split(package_list,A,","); for (p in A) {split(A[p],B,"/");C[B[1]]=B[2]}}
                 /^$/ {if (packagename in C && C[packagename] == version) print filename;
                         packagename=""; version=""}
@@ -202,8 +218,8 @@
         -name '*.deb' -exec sha256sum \{} \; |sed 's/  / /' | tr '\n' ',' | sed 's/,$//')
     for suite in $suite_list; do
         for component in $component_list; do
-            packages_file=${top}/dists/${suite}/${component}/binary-${architecture}/Packages.bz2
-            result=$(bzcat "$packages_file" | awk -v sha256_pool="$sha256_pool" \
+            packages_file=${top}/dists/${suite}/${component}/binary-${architecture}/Packages.gz
+            result=$(zcat "$packages_file" | awk -v sha256_pool="$sha256_pool" \
                'BEGIN {split(sha256_pool,A,","); for (p in A) {split(A[p],B," ");C[B[2]]=B[1]}}
                 /^$/ {if (filename in C) {
                     if (C[filename] != sha256_sum) print "FAILED sha256 verification for " filename;
@@ -263,15 +279,14 @@
             component_list="${component_list:+${component_list} }$component"
         fi
     done
-    if [ -d "${destination}/pool" ]; then
-        for a1 in $ARCHITECTURES; do
-            if [ ! -d "${destination}/pool-${a1}" ]; then
-                mkdir -p "${destination}/pool-${a1}"
-            fi
-            cp -al ${destination}/pool/* "${destination}/pool-${a1}"
-       done
-       rm -rf "${destination}/pool"
+    if [ ! -d "${top}/pool" ]; then
+        mkdir -p "${top}/pool"
     fi
+    for a1 in $architectures; do
+        if [ -d "${top}/pool-${a1}" ]; then
+            cp -al ${top}/pool-${a1}/* "${top}/pool/"
+        fi
+    done
 
     cat > "${top}/apt-ftp-archive-packages.conf" <<EOF
 Dir {
@@ -280,11 +295,11 @@
 } ;
 
 Default {
-    Packages::Compress "bzip2";
+    Packages::Compress "gzip";
 } ;
 
 TreeDefault {
-    Directory "pool-\$(ARCH)/\$(SECTION)";
+    Directory "pool/\$(SECTION)";
 };
 
 Tree "dists/unstable" {
@@ -322,12 +337,12 @@
     if [ -n "$DEBOOTSTRAP_SORT_PKGS" -a -x "$DEBOOTSTRAP_SORT_PKGS" ]; then
         for component in $component_list; do
             for architecture in $architectures; do
-                bunzip2 "dists/unstable/${component}/binary-${architecture}/Packages.bz2"
+                gunzip "dists/unstable/${component}/binary-${architecture}/Packages.gz"
                 "$DEBOOTSTRAP_SORT_PKGS" "dists/unstable/${component}/binary-${architecture}/Packages" \
                   > "dists/unstable/${component}/binary-${architecture}/Packages.new"
                 mv -f "dists/unstable/${component}/binary-${architecture}/Packages.new" \
                      "dists/unstable/${component}/binary-${architecture}/Packages"
-                bzip2 "dists/unstable/${component}/binary-${architecture}/Packages"
+                gzip "dists/unstable/${component}/binary-${architecture}/Packages"
             done
         done
     fi
@@ -351,11 +366,11 @@
     if [ -z "$NO_CHECK_GPG" ]; then
         validate_metadata  "$base" "$KEYRING" "unstable unreleased" "main"
         ret=$?
-        if [ $ret -ne 0 ]; then exit 1; fi
+        if [ $ret -ne 0 ]; then ask_exit 1; fi
         if [ -z "$no_package_validation" ]; then
             validate_packages "$base" "$ARCHITECTURE" "unstable unreleased" "main"
             ret=$?
-            if [ $ret -ne 0 ]; then exit 1; fi
+            if [ $ret -ne 0 ]; then ask_exit 1; fi
         fi
     fi
 
@@ -380,7 +395,7 @@
     if [ -z "$NO_CHECK_GPG" ]; then
         validate_packages "$base" "$architecture" "$suite_list" "$component_list"
         ret=$?
-        if [ $ret -ne 0 ]; then exit 1; fi
+        if [ $ret -ne 0 ]; then ask_exit 1; fi
     fi
 }
 
@@ -405,14 +420,14 @@
         if [ -z "$NO_CHECK_GPG" ]; then
             validate_metadata "$base" "$KEYRING" "unstable unreleased" "main"
             ret=$?
-            if [ $ret -ne 0 ]; then exit 1; fi
+            if [ $ret -ne 0 ]; then ask_exit 1; fi
         fi
 
         add_files "${MIRROR_SNAPSHOT}/debian-ports/${date_snapshot}" "$package_list" "$base" "$ARCHITECTURE" "unstable unreleased" "main"
         if [ -z "$NO_CHECK_GPG" ]; then
             validate_packages "$base" "$ARCHITECTURE" "unstable unreleased" "main"
             ret=$?
-            if [ $ret -ne 0 ]; then exit 1; fi
+            if [ $ret -ne 0 ]; then ask_exit 1; fi
         fi
 
         ARCHIVES_TO_MERGE="${ARCHIVES_TO_MERGE:+${ARCHIVES_TO_MERGE} }$base"
@@ -442,14 +457,14 @@
         if [ -z "$NO_CHECK_GPG" ]; then
             validate_metadata "$base" "$DEBIAN_KEYRING" "$suite" "main contrib non-free"
             ret=$?
-            if [ $ret -ne 0 ]; then exit 1; fi
+            if [ $ret -ne 0 ]; then ask_exit 1; fi
         fi
 
         add_files "${MIRROR_SNAPSHOT}/debian/${date_snapshot}" "$package_list" "$base" "i386" "$suite" "main contrib non-free"
         if [ -z "$NO_CHECK_GPG" ]; then
             validate_packages "$base" "i386" "$suite" "main contrib non-free"
             ret=$?
-            if [ $ret -ne 0 ]; then exit 1; fi
+            if [ $ret -ne 0 ]; then ask_exit 1; fi
         fi
 
         ARCHIVES_TO_MERGE="${ARCHIVES_TO_MERGE:+${ARCHIVES_TO_MERGE} }$base"
@@ -469,14 +484,14 @@
     if [ -z "$NO_CHECK_GPG" ]; then
         validate_metadata "$base" "$DEBIAN_KEYRING" "$DEBIAN_SUITE" "main contrib non-free"
         ret=$?
-        if [ $ret -ne 0 ]; then exit 1; fi
+        if [ $ret -ne 0 ]; then ask_exit 1; fi
     fi
 
     add_files "${MIRROR_DEBIAN}" "$package_list" "$base" "i386" "$DEBIAN_SUITE" "main contrib non-free"
     if [ -z "$NO_CHECK_GPG" ]; then
         validate_packages "$base" "i386" "$DEBIAN_SUITE" "main contrib non-free"
         ret=$?
-        if [ $ret -ne 0 ]; then exit 1; fi
+        if [ $ret -ne 0 ]; then ask_exit 1; fi
     fi
 
     ARCHIVES_TO_MERGE="${ARCHIVES_TO_MERGE:+${ARCHIVES_TO_MERGE} }$base"
@@ -484,7 +499,7 @@
 
 usage() {
     echo "${0##*/} - usage :"
-    echo "${0##*/} [ options ] -l filelist [-p packages]] [-d DESTINATION [-g]]"
+    echo "${0##*/} [ options ] -l filelist [-p packages] [-d DESTINATION -g]"
     echo "${0##*/} [ options ] -b base -s snapshot1 snapshot2 ... snapshotN"
     echo "${0##*/} [ options ] -b base -S snapshot1 snapshot2 ... snapshotN"
     echo "${0##*/} [ options ] -b base [-R suite] -r packages"
@@ -494,7 +509,7 @@
 -w workdir : where to put all files
 -k keyring : a keyring to check packages from debian-ports
 -K keyring : a keyring to check packages from debian
--a architecture : to select package from this architecture (default to alpha)
+-a architecture : to select package from this architecture (defaults to alpha)
 -M mirror : a debian-ports mirror
 -N mirror : a debian mirror
 -n : do not verify gpg signatures
@@ -505,16 +520,16 @@
 -A ARCHITECTURES : architectures to considere when generating metadatas
 -g : generate metadatas of a debian archive (depends on apt-utils)
 -b base : takeover a base directory (it contains a pool directory)
--s snaphot : download packages from a snapshot of debian-ports. snapshot is date packagelist, where date
-is a date directory on snapshot.debian.org/archive/debian-ports/ and filelist is a comma separated
+-s snapshot : download packages from a snapshot of debian-ports. snapshot is date packagelist, where date
+is a date directory on snapshot.debian.org/archive/debian-ports/ and packagelist is a comma separated
 list of package/version to add, e.g. 20130405T202311Z "locales/2.13-38"
 -S snapshot : download packages from a snapshot of debian. snapshot is suite date packagelist, where suite
 is oldstable, stable, testing or unstable, date is a date directory on snapshot.debian.org/archive/debian/
 and packagelist is a comma separated list of package/version to add.
--R suite : suite (oldstable, stable, testing or unstable) for option -r (default to unstable)
+-R suite : suite (oldstable, stable, testing or unstable) for option -r (defaults to unstable)
 -r packages : packages is a comma separated list of package/version to add (from debian),
 e.g. "firmware-qlogic/0.40"
--m dir1 dir2 ... dirN : merge directories dir1 dir2 ... dirN (each contains a pool directory) under DESTINATION
+-m dir1 dir2 ... dirN : merge directories dir1 dir2 ... dirN (each contains a 'pool' or 'pool-\${arch}' directory) under DESTINATION
 EOF
     exit 0
 }
 

README.installable :

	installable.py
	==============

The purpose of this small program is to test the archive at debian-ports
(http://ftp.debian-ports.org) for installability with debootstrap. It
selects the same package set that debootstrap would and looks for
missing dependencies. However, there is no warranty that a working
system would result from the installation.

The user interface surely needs improvement - suggestions are welcome !

It depends on python (and argparse), bzip2 and apt-utils.

Synopsis :
--------

./installable.py [ options ]

Options :
-------

* package selection strategy :

-t, --no-unreleased : consider packages from suite 'unstable' for
installation only. This is debootstrap behaviour unmodified.

-u, --unreleased-precedence : prefer the version from suite 'unreleased'
if a package is found in both suites 'unstable' and 'unreleased'.

-s, --unstable-precedence : prefer the version from suite 'unstable'
if a package is found in both suites 'unstable' and 'unreleased'.

-o, --unreleased-if-newer : select packages from suite 'unstable'. If
there is a more recent version in suite 'unreleased', select it instead. 

-M, --merge-unreleased : merge packages from suites 'unstable' and
'unreleased' in one list and sort it with apt-sortpkgs.

-L, --ascending-versions : merge packages from suites 'unstable' and 
'unreleased' in one list and sort it by ascending version number. It
is believed to be the only correct scheme, and it is default.

* debootstrap variant :

-v, --variant : 'minbase','buildd','fakechroot','-' or nothing (default).
'scratchbox' is unsupported.

* individual package selection :

-e, --exclude : a comma separated list of packages to exclude from the
selection. It is not allowed to exclude required packages.

-i, --include : a comma separated list of packages to include in the
selection. debian-ports-archive-keyring is added to this list.

* what to test :

-n, --no-install : do not select packages. All tests are skipped.

-k, --no-dependency-check : do not look for missing dependencies.

-E, --no-check-essential : do not look for unselected essential packages.

-U, --no-check-unsorted : all version entry of required and important 
packages in Packages file should be consecutive. Skip this test.

-c, --check-unreleased : flag packages with multiple versions in suite
'unreleased' or an outdated version in 'unreleased' (by comparison with 
the one in 'unstable'). Options -M,--merge-unreleased or 
-L,--ascending-versions disable the test.

-O, --no-check-obsolete : do not look if newer versions of selected 
packages exist. Options -c,--check-unreleased or 
-o,--unreleased-if-newer are required for this test to be performed.

-S, --check-if-sorted : the Packages file of suite 'unstable' is sorted
through apt-sortpkgs. This occurs at debian-ports archive update. This
test redo the sorting on the local machine, and compare the outcome with 
the original Packages file.

* program output :

-p, --print-debs : print selected package names.

-P, --package-filenames : a file to store the paths of selected
packages. The paths of .deb files are relative to the root of the
debian-ports archive (as in the 'Filename:' fields of 'Packages' files).

* other options :

-m, --mirror : a mirror of debian-ports (it defaults to 
http://ftp.debian-ports.org/debian)

-r, --no-resolve-deps : do not resolve dependencies while selecting
packages (see the corresponding option of debootstrap).

-w, --workdir : a directory to store downloaded files. It defaults to
the currect working directory, "."

-d, --no-download : do not download Packages files of suites 'unstable'
and 'unreleased' from debian-ports (in case of a previous download).
This option is not useful if options -M,--merge-unreleased or
-L,--ascending-versions were given.

README.dpo_ad_hoc :

	dpo_ad_hoc.sh
	=============

The purpose of this small program is to assemble a mini-repository
with the bare minimum from debian-ports. One may then install with an
unmodified version of debootstrap.

Packages are taken from the debian-ports archive. One may add packages 
from the regular debian archive if needed (say, firmwares) or older
version from snapshot.debian.org.

It depends on apt-utils and bzip2. Package validation may require
debian-ports-archive-keyring and debian-archive-keyring.

Some examples :
-------------

* Make list of package that debootstrap would install on an 
alpha workstation :

./installable.py -a alpha -m http://ftp.de.debian.org/debian-ports \
 -w some_scratch -P listep-alpha

* Package download :

./dpo_ad_hoc.sh -w some_scratch -a alpha \
 -M http://ftp.de.debian.org/debian-ports \
 -l listep-alpha

* Add a bootloader :

./dpo_ad_hoc.sh -a alpha \
 -M http://ftp.de.debian.org/debian-ports \
 -b some_scratch/ftp.de.debian.org/debian-ports \
 -p "aboot/1.0~pre20040408-4,aboot-base/1.0~pre20040408-4"

* Add a disk controller firmware :

./dpo_ad_hoc.sh -w some_scratch -a alpha \
 -N http://ftp.de.debian.org/debian \
 -r "firmware-qlogic/0.43"

* Build the repository :

./dpo_ad_hoc.sh -a alpha -d my_repository -g \
  -m some_scratch/ftp.de.debian.org/debian-ports some_scratch/ftp.de.debian.org/debian

* Everything in one step :

./dpo_ad_hoc.sh -w some_scratch -a alpha \
 -M http://ftp.de.debian.org/debian-ports \
 -N http://ftp.de.debian.org/debian \
 -l listep-alpha \
 -p "aboot/1.0~pre20040408-4,aboot-base/1.0~pre20040408-4" \
 -d my_repository -g -r "firmware-qlogic/0.43"

* Last, install as root :

debootstrap --arch=alpha --components=main,non-free --no-check-gpg \
 --include=debian-ports-archive-keyring,aboot,aboot-base,firmware-qlogic \
 unstable my_chroot file:///$(readlink -f my_repository)

cat > my_chroot/etc/apt/sources.list <<EOF
deb http://ftp.de.debian.org/debian-ports unstable main
deb http://ftp.de.debian.org/debian-ports unreleased main
EOF

Synopses :
--------

Options -s, -S and -m are mutually exclusive. No other option may
follow them on the line.

./dpo_ad_hoc.sh [ options ]
./dpo_ad_hoc.sh [ options ] -s snapshot1 snapshot2 ... snapshotN
./dpo_ad_hoc.sh [ options ] -S snapshot1 snapshot2 ... snapshotN
./dpo_ad_hoc.sh [ options ] -m dir1 dir2 ... dirN

Options :
-------

* packages to include :

-l file_list : file file_list contains the paths of .deb files to
download. The paths are relative to the root of the debian-ports
archive (they begin usually with 'pool' or 'pool-${arch}' where
${arch} is an architecture hosted by debian-ports).
file_list is overwritten. This option is not compatible with -b.

* packages to add :

-p package_list : to download packages from a debian-ports mirror.
package_list is a comma separated list of elements of the form
package_name/version_number, e.g.
"aboot/1.0~pre20040408-4,aboot-base/1.0~pre20040408-4"

-r package_list : to download packages from the regular debian
archive. package_list is as in option -p, e.g.
-r "firmware-qlogic/0.43". See also option -R.

-s snapshot1 snapshot2 ... snapshotN : to download obsolete versions
of packages from 'snapshot.debian.org' (these versions were removed
from debian-ports). snapshotn is 
'date' 'package_list' where 'date' is
a subdirectory of http://snapshot.debian.org/archive/debian-ports/
and package_list is as in option -p, e.g.
20130405T202311Z "locales/2.13-38"
This must be the last option on the command line. It is mutually
exclusive with options -S and -m.

-S snapshot1 snapshot2 ... snapshotN : to download obsolete versions
of packages from 'snapshot.debian.org' (these versions were removed
from the regular debian archive). snapshotn is 
'suite' 'date' 'package_list' 
where 'suite' is oldstable, stable, testing or unstable,
'date' is a subdirectory of http://snapshot.debian.org/archive/debian/
and package_list is as in option -p.
This must be the last option on the command line. It is mutually 
exclusive with options -s and -m.

* build a repository :

-g : generate metadata with apt-ftparchive. Option -d is required.

-d DESTINATION : directory DESTINATION has 'pool' and/or 'pool-${arch}'
subdirectories which contains the .deb files of the repository. Metadatas
(ie Packages and Release files) are generated in DESTINATION.

* architecture choice :

-a arch : download packages for architecture arch. It defaults to alpha.
May be used once by invocation of dpo_ad_hoc.sh.

-A architectures : this is a space separated list of architectures to
consider when generating metadatas, e.g. "alpha m68k". Please note that 
it is not possible to build a multi-architecture repository in one step :
options -m and -g are needed.

* package validation :

-n : do not verify packages.

-k keyring : a keyring to verify packages from debian-ports.
It defaults to '/usr/share/keyrings/debian-ports-archive-keyring.gpg'

-K keyring : a keyring to verify packages from the regular debian archive.
It defaults to '/usr/share/keyrings/debian-archive-keyring.gpg'.

* mirrors :

-M MIRROR : MIRROR is an URI of a debian-ports mirror. It defaults to
'http://ftp.debian-ports.org/debian'

-N MIRROR : MIRROR is an URI of a mirror of the regular debian archive.
It defaults to 'http://ftp.us.debian.org/debian'

(Obsolete versions are always fetched from 'http://snapshot.debian.org/archive'
when handling options -s or -S.)

* other options :

-b base : to append packages to base directory created with option -l in a
previous invocation of dpo_ad_hoc. base is a subdirectory, named according
to the mirror in use, e.g. -b 'ftp.us.debian.org'.
This option is not allowed with option -l.

-m dir1 dir2 ...dirN : merge the content of directories dir1, dir2, ...,
dirN in one directory DESTINATION. Option -d is required to set DESTINATION.
Each directory dir1, dir2, ..., dirN should contain a 'pool' or 'pool-${arch}'
subdirectory.
This must be the last option on the command line. It is mutually
exclusive with options -s and -S.

-R suite : suite is oldstable, stable, testing or unstable. Packages 
downloaded with option -r are chosen in this suite. It defaults to
unstable.

-w workdir : downloaded files are stored in directory workdir. It defaults
to the current working directory, "."


Reply to: