[neon/backports-jammy/debuerreotype/Neon/unstable] /: 0.2-1 (patches unapplied)
git-ubuntu importer
null at kde.org
Fri Aug 11 03:02:00 BST 2023
Git commit 8959aed125dafff739ee0e1804e0a8b2618bc101 by git-ubuntu importer, on behalf of Tianon Gravi.
Committed on 20/06/2017 at 12:12.
Pushed by carlosdem into branch 'Neon/unstable'.
0.2-1 (patches unapplied)
Imported using git-ubuntu import.
M +10 -2 .travis.sh
M +6 -3 .travis.yml
M +1 -1 README.md
M +1 -1 VERSION
M +23 -27 build-all.sh
M +138 -22 build.sh
M +6 -0 debian/changelog
M +3 -1 scripts/.constants.sh
M +2 -1 scripts/.tar-exclude
M +23 -5 scripts/debuerreotype-gen-sources-list
M +31 -9 scripts/debuerreotype-tar
https://invent.kde.org/neon/backports-jammy/debuerreotype/-/commit/8959aed125dafff739ee0e1804e0a8b2618bc101
diff --git a/.travis.sh b/.travis.sh
index 09ddc92..d7fec7f 100755
--- a/.travis.sh
+++ b/.travis.sh
@@ -4,10 +4,18 @@ set -Eeuo pipefail
epoch="$(TZ=UTC date --date "$TIMESTAMP" +%s)"
serial="$(TZ=UTC date --date "@$epoch" +%Y%m%d)"
+buildArgs=()
+if [ -n "${CODENAME:-}" ]; then
+ buildArgs+=( '--codename-copy' )
+fi
+buildArgs+=( travis "$SUITE" "@$epoch" )
+
+checkFile="travis/$serial/amd64/${CODENAME:-$SUITE}/rootfs.tar.xz"
+
set -x
./scripts/debuerreotype-version
-./build.sh travis "$SUITE" "@$epoch"
+./build.sh "${buildArgs[@]}"
-real="$(sha256sum "travis/$serial/$SUITE-amd64.tar.xz" | cut -d' ' -f1)"
+real="$(sha256sum "$checkFile" | cut -d' ' -f1)"
[ -z "$SHA256" ] || [ "$SHA256" = "$real" ]
diff --git a/.travis.yml b/.travis.yml
index ba18590..de303a0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,9 +2,12 @@ language: bash
services: docker
env:
- - SUITE=jessie TIMESTAMP=2017-01-01T00:00:00Z SHA256=a674379d30cf457e49a909bb0e254ddcb1f72c27f45c68fe930668d6d9399232
- - SUITE=stretch TIMESTAMP=2017-01-01T00:00:00Z SHA256=139ed970d52ef950c223f9ab325657eb93d0a93c7d6e2fc697fe7510e61760fa
- - SUITE=sid TIMESTAMP=2017-01-01T00:00:00Z SHA256=b75b4496deb4d6cee32245e4125e7ef948b09afbeb1ef3b9669e56daf3e822a7
+ - SUITE=jessie CODENAME= TIMESTAMP=2017-01-01T00:00:00Z SHA256=a674379d30cf457e49a909bb0e254ddcb1f72c27f45c68fe930668d6d9399232
+ - SUITE=stable CODENAME=jessie TIMESTAMP=2017-01-01T00:00:00Z SHA256=a674379d30cf457e49a909bb0e254ddcb1f72c27f45c68fe930668d6d9399232
+ - SUITE=stretch CODENAME= TIMESTAMP=2017-01-01T00:00:00Z SHA256=139ed970d52ef950c223f9ab325657eb93d0a93c7d6e2fc697fe7510e61760fa
+ - SUITE=testing CODENAME=stretch TIMESTAMP=2017-01-01T00:00:00Z SHA256=139ed970d52ef950c223f9ab325657eb93d0a93c7d6e2fc697fe7510e61760fa
+ - SUITE=sid CODENAME= TIMESTAMP=2017-01-01T00:00:00Z SHA256=b75b4496deb4d6cee32245e4125e7ef948b09afbeb1ef3b9669e56daf3e822a7
+ - SUITE=unstable CODENAME=sid TIMESTAMP=2017-01-01T00:00:00Z SHA256=b75b4496deb4d6cee32245e4125e7ef948b09afbeb1ef3b9669e56daf3e822a7
script:
- travis_retry ./.travis.sh
diff --git a/README.md b/README.md
index 6caa976..842da0e 100644
--- a/README.md
+++ b/README.md
@@ -112,7 +112,7 @@ Wheezy is a little sad, and will have a delta similar to the following (as seen
│ │ 0000070: 0000 0000 0000 0000 0a00 0000 0000 0000 ................
```
-Presumably this is some sort of timestamp, but that's just a guess. Suggestions for ways of fixing this would be most welcome! (Otherwise, we'll just wait for Wheezy to go EOL and forget this ever happened. :trollface:)
+Presumably this is some sort of timestamp, but that's just a guess. Suggestions for ways of fixing this would be most welcome! (Otherwise, we'll just wait for Wheezy to go EOL and forget this ever happened. :trollface:) See [debuerreotype/debuerreotype#7](https://github.com/debuerreotype/debuerreotype/issues/7) for the current discussion of this issue.
## How much have you verified this?
diff --git a/VERSION b/VERSION
index 49d5957..3b04cfb 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1
+0.2
diff --git a/build-all.sh b/build-all.sh
index 09f2a69..55699b0 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -2,15 +2,14 @@
set -Eeuo pipefail
suites=(
- oldstable
- stable
- testing
unstable
+ testing
+ stable
+ oldstable
+ oldoldstable
- wheezy
- jessie
- stretch
- sid
+ # just in case (will no-op with "not supported on 'arch'" unless it exists)
+ oldoldoldstable
)
thisDir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
@@ -23,17 +22,23 @@ usage() {
EOU
}
eusage() {
- echo >&2 "error: $1"
+ if [ "$#" -gt 0 ]; then
+ echo >&2 "error: $*"
+ fi
usage >&2
exit 1
}
-# a silly flag to skip "docker build" (for giggles/debugging)
+options="$(getopt -n "$self" -o '' --long 'no-build' -- "$@")" || eusage
+eval "set -- $options"
build=1
-if [ "${1:-}" = '--no-build' ]; then
- shift
- build=
-fi
+while true; do
+ flag="$1"; shift
+ case "$flag" in
+ --no-build) build= ;; # for skipping "docker build"
+ --) break ;;
+ esac
+done
outputDir="${1:-}"; shift || eusage 'missing output-dir'
timestamp="${1:-}"; shift || eusage 'missing timestamp'
@@ -41,7 +46,9 @@ timestamp="${1:-}"; shift || eusage 'missing timestamp'
mkdir -p "$outputDir"
outputDir="$(readlink -f "$outputDir")"
-dockerImage='tianon/debuerreotype'
+ver="$("$thisDir/scripts/debuerreotype-version")"
+ver="${ver%% *}"
+dockerImage="debuerreotype/debuerreotype:$ver"
[ -z "$build" ] || docker build -t "$dockerImage" "$thisDir"
mirror="$("$thisDir/scripts/.snapshot-url.sh" "$timestamp")"
@@ -52,21 +59,10 @@ echo
echo "-- BUILDING TARBALLS FOR '$dpkgArch' FROM '$mirror/' --"
echo
-fetch_codename() {
- local suite="$1"; shift
- wget -qO- "$mirror/dists/$suite/Release" \
- | tac|tac \
- | awk -F ': ' 'tolower($1) == "codename" { print $2; exit }'
-}
-declare -A codenames=(
- [testing]="$(fetch_codename 'testing')"
- [unstable]="$(fetch_codename 'unstable')"
-)
-
for suite in "${suites[@]}"; do
testUrl="$secmirror/dists/$suite/updates/main/binary-$dpkgArch/Packages.gz"
case "$suite" in
- testing|unstable|"${codenames[testing]}"|"${codenames[unstable]}")
+ testing|unstable)
testUrl="$mirror/dists/$suite/main/binary-$dpkgArch/Packages.gz"
;;
esac
@@ -76,5 +72,5 @@ for suite in "${suites[@]}"; do
echo >&2
continue
fi
- "$thisDir/build.sh" --no-build "$outputDir" "$suite" "$timestamp"
+ "$thisDir/build.sh" --no-build --codename-copy "$outputDir" "$suite" "$timestamp"
done
diff --git a/build.sh b/build.sh
index 01ce59d..2bcb282 100755
--- a/build.sh
+++ b/build.sh
@@ -8,20 +8,29 @@ usage() {
cat <<-EOU
usage: $self <output-dir> <suite> <timestamp>
ie: $self output stretch 2017-05-08T00:00:00Z
+ $self --codename-copy output stable 2017-05-08T00:00:00Z
EOU
}
eusage() {
- echo >&2 "error: $1"
+ if [ "$#" -gt 0 ]; then
+ echo >&2 "error: $*"
+ fi
usage >&2
exit 1
}
-# a silly flag to skip "docker build" (for "build-all.sh")
+options="$(getopt -n "$self" -o '' --long 'no-build,codename-copy' -- "$@")" || eusage
+eval "set -- $options"
build=1
-if [ "${1:-}" = '--no-build' ]; then
- shift
- build=
-fi
+codenameCopy=
+while true; do
+ flag="$1"; shift
+ case "$flag" in
+ --no-build) build= ;; # for skipping "docker build"
+ --codename-copy) codenameCopy=1 ;; # for copying a "stable.tar.xz" to "stretch.tar.xz" with updated sources.list (saves a lot of extra building work)
+ --) break ;;
+ esac
+done
outputDir="${1:-}"; shift || eusage 'missing output-dir'
suite="${1:-}"; shift || eusage 'missing suite'
@@ -40,7 +49,9 @@ if docker info | grep -q apparmor; then
)
fi
-dockerImage='tianon/debuerreotype'
+ver="$("$thisDir/scripts/debuerreotype-version")"
+ver="${ver%% *}"
+dockerImage="debuerreotype/debuerreotype:$ver"
[ -z "$build" ] || docker build -t "$dockerImage" "$thisDir"
docker run \
@@ -50,6 +61,7 @@ docker run \
-w /tmp \
-e suite="$suite" \
-e timestamp="$timestamp" \
+ -e codenameCopy="$codenameCopy" \
-e TZ='UTC' -e LC_ALL='C' \
"$dockerImage" \
bash -Eeuo pipefail -c '
@@ -57,10 +69,48 @@ docker run \
epoch="$(date --date "$timestamp" +%s)"
serial="$(date --date "@$epoch" +%Y%m%d)"
- exportDir="output"
- outputDir="$exportDir/$serial"
dpkgArch="$(dpkg --print-architecture)"
+ exportDir="output"
+ outputDir="$exportDir/$serial/$dpkgArch/$suite"
+
+ touch_epoch() {
+ while [ "$#" -gt 0 ]; do
+ local f="$1"; shift
+ touch --no-dereference --date="@$epoch" "$f"
+ done
+ }
+
+ debuerreotypeScriptsDir="$(dirname "$(readlink -f "$(which debuerreotype-init)")")"
+
+ for archive in "" security; do
+ snapshotUrl="$("$debuerreotypeScriptsDir/.snapshot-url.sh" "@$epoch" "${archive:+debian-${archive}}")"
+ snapshotUrlFile="$exportDir/$serial/$dpkgArch/snapshot-url${archive:+-${archive}}"
+ mkdir -p "$(dirname "$snapshotUrlFile")"
+ echo "$snapshotUrl" > "$snapshotUrlFile"
+ touch_epoch "$snapshotUrlFile"
+ done
+
+ snapshotUrl="$(< "$exportDir/$serial/$dpkgArch/snapshot-url")"
+ mkdir -p "$outputDir"
+ wget -O "$outputDir/Release.gpg" "$snapshotUrl/dists/$suite/Release.gpg"
+ wget -O "$outputDir/Release" "$snapshotUrl/dists/$suite/Release"
+ gpgv \
+ --keyring /usr/share/keyrings/debian-archive-keyring.gpg \
+ --keyring /usr/share/keyrings/debian-archive-removed-keys.gpg \
+ "$outputDir/Release.gpg" \
+ "$outputDir/Release"
+
+ codename="$(awk -F ": " "\$1 == \"Codename\" { print \$2; exit }" "$outputDir/Release")"
+ if [ -n "$codenameCopy" ] && [ "$codename" = "$suite" ]; then
+ # if codename already is the same as suite, then making a copy does not make any sense
+ codenameCopy=
+ fi
+ if [ -n "$codenameCopy" ] && [ -z "$codename" ]; then
+ echo >&2 "error: --codename-copy specified but we failed to get a Codename for $suite"
+ exit 1
+ fi
+
{
debuerreotype-init rootfs "$suite" "@$epoch"
@@ -68,9 +118,11 @@ docker run \
debuerreotype-apt-get rootfs update -qq
debuerreotype-apt-get rootfs dist-upgrade -yqq
- # make a copy of rootfs so we can have a "slim" output too
- mkdir -p rootfs-slim
- tar -cC rootfs . | tar -xC rootfs-slim
+ # make a couple copies of rootfs so we can create other variants
+ for variant in slim sbuild; do
+ mkdir "rootfs-$variant"
+ tar -cC rootfs . | tar -xC "rootfs-$variant"
+ done
# prefer iproute2 if it exists
iproute=iproute2
@@ -78,24 +130,88 @@ docker run \
# poor wheezy
iproute=iproute
fi
-
debuerreotype-apt-get rootfs install -y --no-install-recommends inetutils-ping $iproute
debuerreotype-slimify rootfs-slim
- du -hs rootfs rootfs-slim
+ # this should match the list added to the "buildd" variant in debootstrap and the list installed by sbuild
+ # https://anonscm.debian.org/cgit/d-i/debootstrap.git/tree/scripts/sid?id=706a45681c5bba5e062a9b02e19f079cacf2a3e8#n26
+ # https://anonscm.debian.org/cgit/buildd-tools/sbuild.git/tree/bin/sbuild-createchroot?id=eace3d3e59e48d26eaf069d9b63a6a4c868640e6#n194
+ debuerreotype-apt-get rootfs-sbuild install -y --no-install-recommends build-essential fakeroot
+
+ create_artifacts() {
+ local targetBase="$1"; shift
+ local rootfs="$1"; shift
+ local suite="$1"; shift
+ local variant="$1"; shift
+
+ # make a copy of the snapshot-facing sources.list file before we overwrite it
+ cp "$rootfs/etc/apt/sources.list" "$targetBase.sources-list-snapshot"
+ touch_epoch "$targetBase.sources-list-snapshot"
+
+ if [ "$variant" != "sbuild" ]; then
+ debuerreotype-gen-sources-list "$rootfs" "$suite" http://deb.debian.org/debian http://security.debian.org
+ debuerreotype-tar "$rootfs" "$targetBase.tar.xz"
+ else
+ # sbuild needs "deb-src" entries
+ debuerreotype-gen-sources-list --deb-src "$rootfs" "$suite" http://deb.debian.org/debian http://security.debian.org
+
+ # schroot is picky about "/dev" (which is excluded by default in "debuerreotype-tar")
+ # see https://github.com/debuerreotype/debuerreotype/pull/8#issuecomment-305855521
+ debuerreotype-tar --include-dev "$rootfs" "$targetBase.tar.xz"
+ fi
+ du -hsx "$targetBase.tar.xz"
+
+ sha256sum "$targetBase.tar.xz" | cut -d" " -f1 > "$targetBase.tar.xz.sha256"
+ touch_epoch "$targetBase.tar.xz.sha256"
+
+ debuerreotype-chroot "$rootfs" dpkg-query -W > "$targetBase.manifest"
+ echo "$epoch" > "$targetBase.debuerreotype-epoch"
+ touch_epoch "$targetBase.manifest" "$targetBase.debuerreotype-epoch"
+
+ for f in debian_version os-release apt/sources.list; do
+ targetFile="$targetBase.$(basename "$f" | sed -r "s/[^a-zA-Z0-9_-]+/-/g")"
+ cp "$rootfs/etc/$f" "$targetFile"
+ touch_epoch "$targetFile"
+ done
+ }
for rootfs in rootfs*/; do
- debuerreotype-gen-sources-list "$rootfs" "$suite" http://deb.debian.org/debian http://security.debian.org
- done
+ rootfs="${rootfs%/}" # "rootfs", "rootfs-slim", ...
+
+ du -hsx "$rootfs"
- mkdir -p "$outputDir"
- for variant in "" -slim; do
- targetBase="$outputDir/$suite$variant-$dpkgArch"
- debuerreotype-tar "rootfs$variant" "$targetBase.tar.xz"
- debuerreotype-chroot "rootfs$variant" dpkg-query -W > "$targetBase.manifest"
- touch --no-dereference --date="@$epoch" "$targetBase.manifest"
+ variant="${rootfs#rootfs}" # "", "-slim", ...
+ variant="${variant#-}" # "", "slim", ...
+
+ variantDir="$outputDir/$variant"
+ mkdir -p "$variantDir"
+
+ targetBase="$variantDir/rootfs"
+
+ create_artifacts "$targetBase" "$rootfs" "$suite" "$variant"
done
+
+ if [ -n "$codenameCopy" ]; then
+ codenameDir="$exportDir/$serial/$dpkgArch/$codename"
+ mkdir -p "$codenameDir"
+ tar -cC "$outputDir" --exclude="**/rootfs.*" . | tar -xC "$codenameDir"
+
+ for rootfs in rootfs*/; do
+ rootfs="${rootfs%/}" # "rootfs", "rootfs-slim", ...
+
+ variant="${rootfs#rootfs}" # "", "-slim", ...
+ variant="${variant#-}" # "", "slim", ...
+
+ variantDir="$codenameDir/$variant"
+ targetBase="$variantDir/rootfs"
+
+ # point sources.list back at snapshot.debian.org temporarily (but this time pointing at $codename instead of $suite)
+ debuerreotype-gen-sources-list "$rootfs" "$codename" "$(< "$exportDir/$serial/$dpkgArch/snapshot-url")" "$(< "$exportDir/$serial/$dpkgArch/snapshot-url-security")"
+
+ create_artifacts "$targetBase" "$rootfs" "$codename" "$variant"
+ done
+ fi
} >&2
tar -cC "$exportDir" .
diff --git a/debian/changelog b/debian/changelog
index 38fe859..5594442 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+debuerreotype (0.2-1) unstable; urgency=medium
+
+ * Update to 0.2 upstream release
+
+ -- Tianon Gravi <tianon at debian.org> Mon, 19 Jun 2017 12:35:00 -0700
+
debuerreotype (0.1-1) unstable; urgency=medium
* Initial release
diff --git a/scripts/.constants.sh b/scripts/.constants.sh
index 85cc0d5..5f669ad 100644
--- a/scripts/.constants.sh
+++ b/scripts/.constants.sh
@@ -32,7 +32,9 @@ usage() {
EOU
}
eusage() {
- echo >&2 "error: $1"
+ if [ "$#" -gt 0 ]; then
+ echo >&2 "error: $*"
+ fi
usage >&2
exit 1
}
diff --git a/scripts/.tar-exclude b/scripts/.tar-exclude
index 26a7041..61d7376 100644
--- a/scripts/.tar-exclude
+++ b/scripts/.tar-exclude
@@ -1,7 +1,8 @@
# the file we store the "epoch" of a given rootfs in
./debuerreotype-epoch
-./dev/**
+# "/dev" is a special case in "debuerreotype-tar"
+#./dev/**
./proc/**
./sys/**
diff --git a/scripts/debuerreotype-gen-sources-list b/scripts/debuerreotype-gen-sources-list
index f56582e..2fbd0b0 100755
--- a/scripts/debuerreotype-gen-sources-list
+++ b/scripts/debuerreotype-gen-sources-list
@@ -3,9 +3,20 @@ set -Eeuo pipefail
thisDir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
source "$thisDir/.constants.sh" \
- '<target-dir> <suite> <mirror> <secmirror>' \
+ '[--deb-src] <target-dir> <suite> <mirror> <secmirror>' \
'rootfs stretch http://deb.debian.org/debian http://security.debian.org'
+options="$(getopt -n "$self" -o '' --long 'deb-src' -- "$@")" || eusage
+eval "set -- $options"
+debSrc=
+while true; do
+ flag="$1"; shift
+ case "$flag" in
+ --deb-src) debSrc=1 ;;
+ --) break ;;
+ esac
+done
+
targetDir="${1:-}"; shift || eusage 'missing target-dir'
suite="${1:-}"; shift || eusage 'missing suite'
mirror="${1:-}"; shift || eusage 'missing mirror'
@@ -14,17 +25,24 @@ secmirror="${1:-}"; shift || eusage 'missing secmirror'
comp='main'
+deb() {
+ echo "deb $*"
+ if [ -n "$debSrc" ]; then
+ echo "deb-src $*"
+ fi
+}
+
# https://github.com/tianon/go-aptsources/blob/e066ed9cd8cd9eef7198765bd00ec99679e6d0be/target.go#L16-L58
{
case "$suite" in
sid|unstable|testing)
- echo "deb $mirror $suite $comp"
+ deb "$mirror" "$suite" "$comp"
;;
*)
- echo "deb $mirror $suite $comp"
- echo "deb $mirror $suite-updates $comp"
- echo "deb $secmirror $suite/updates $comp"
+ deb "$mirror" "$suite" "$comp"
+ deb "$mirror" "$suite-updates" "$comp"
+ deb "$secmirror" "$suite/updates" "$comp"
;;
esac
} > "$targetDir/etc/apt/sources.list"
diff --git a/scripts/debuerreotype-tar b/scripts/debuerreotype-tar
index bfc7fad..667f8c5 100755
--- a/scripts/debuerreotype-tar
+++ b/scripts/debuerreotype-tar
@@ -3,9 +3,20 @@ set -Eeuo pipefail
thisDir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
source "$thisDir/.constants.sh" \
- '<target-dir> <target-tar>' \
+ '[--include-dev] <target-dir> <target-tar>' \
'rootfs rootfs.tar'
+options="$(getopt -n "$self" -o '' --long 'include-dev' -- "$@")" || eusage
+eval "set -- $options"
+includeDev=
+while true; do
+ flag="$1"; shift
+ case "$flag" in
+ --include-dev) includeDev=1 ;;
+ --) break ;;
+ esac
+done
+
targetDir="${1:-}"; shift || eusage 'missing target-dir'
[ -n "$targetDir" ]
targetTar="${1:-}"; shift || eusage 'missing target-tar'
@@ -15,13 +26,24 @@ epoch="$(< "$targetDir/debuerreotype-epoch")"
[ -n "$epoch" ]
"$thisDir/debuerreotype-fixup" "$targetDir"
-tar --create \
- --file "$targetTar" \
- --auto-compress \
- --directory "$targetDir" \
- --exclude-from "$thisDir/.tar-exclude" \
- --numeric-owner \
- --transform 's,^./,,' \
- --sort name \
+
+tarArgs=(
+ --create
+ --file "$targetTar"
+ --auto-compress
+ --directory "$targetDir"
+ --exclude-from "$thisDir/.tar-exclude"
+)
+if [ -z "$includeDev" ]; then
+ tarArgs+=( --exclude './dev/**' )
+fi
+tarArgs+=(
+ --numeric-owner
+ --transform 's,^./,,'
+ --sort name
.
+)
+
+tar "${tarArgs[@]}"
+
touch --no-dereference --date="@$epoch" "$targetTar"
More information about the Neon-commits
mailing list