X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fdebian%2Fbyhand-di;h=ab01536d7adf4f165c2c1fabd7d30b297ec1e9db;hb=0872b2e0b78670c91fd2bf0bda52e5761e079820;hp=67db55168ae5f16852447413a94ac418314aad2d;hpb=f1ee050ceee00693a9bea2673431291ac480b8b6;p=dak.git diff --git a/scripts/debian/byhand-di b/scripts/debian/byhand-di index 67db5516..ab01536d 100755 --- a/scripts/debian/byhand-di +++ b/scripts/debian/byhand-di @@ -16,8 +16,8 @@ error() { } # Check validity of version number -# Expected are: YYYYMMDD, YYYYMMDD.x, YYYYMMDDx -if ! echo "$VERSION" | grep -Eq "^[0-9]{8}(|(\.|[a-z]+)[0-9]+)$"; then +# Expected are: YYYYMMDD, YYYYMMDD.x, YYYYMMDDx and the +b[0-9] on the end +if ! echo "$VERSION" | grep -Eq "^[0-9]{8}(|(\.|[a-z]+)[0-9]+)(\+b[0-9])?$"; then error "Invalid version: '$VERSION'" fi @@ -37,7 +37,7 @@ case $SUITE in esac # This must end with / -TARGET="/srv/ftp.debian.org/ftp/dists/$SUITE/main/installer-$ARCH/" +TARGET="/srv/ftp-master.debian.org/ftp/dists/$SUITE/main/installer-$ARCH/" # Check validity of the target directory # This could fail, for example for new architectures; doing @@ -50,10 +50,13 @@ if [ -d "$TARGET/$VERSION" ]; then error "Directory already exists: $TARGET/$VERSION" fi +# We know the VERSION is sane by here, we just need to make sure we escape the + in +b1 (if any) +VERSIONREGEXP="$(echo $VERSION | sed 's@+@\\\+@')" + # We know all data to be in ./installer-/; see if there's # anything else in the tarball except that and the 'current' symlink if tar tzf "$TARBALL" | \ - grep -Eqv "^\./(installer-$ARCH/($VERSION/.*|current|)|)$"; then + grep -Eqv "^\./(installer-$ARCH/($VERSIONREGEXP/.*|current|)|)$"; then error "Tarball contains unexpected contents" fi @@ -97,7 +100,7 @@ find "$TARGET/$VERSION" -type f -exec chmod 644 {} + # Make sure nothing symlinks outside of the ftpdir # Shouldnt happen, but better be sure. -symlinks -d -r /srv/ftp.debian.org/ftp +symlinks -d -r /srv/ftp-master.debian.org/ftp trap - EXIT cleanup