-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: 'cloudsmith push deb' parse .dsc Files:
section for sources/changes
#56
Comments
A work around for this using DEBTAR=$(dcmd -r --debtar "$DSC")
cloudsmith push deb ${REPO}/any-distro/any-version "$DSC" --sources-file=$(dcmd --orig "$DSC") ${DEBTAR:+--changes-file="${DEBTAR}"} However having |
Another reason it would also be useful if While the additional component sources files and asc signatures files are rare in practise, if the former are present the source package simply cannot be uploaded to CloudSmith, but for later they can be ignored and not uploaded. https://manpages.debian.org/buster/dpkg-dev/dpkg-source.1.en.html#Format:_3.0_(quilt)
|
Workaround, that includes warning/errors for unsupported cases now looks like: $ cat cloudsmith_upload_debian_source_package.sh
#!/bin/bash
UPLOAD_TARGET=$1
DSC=$2
OTHER_ARGS=("${@:3}")
# Determine source file to upload
SOURCES=$(dcmd --orig "$DSC")
for SOURCE in $SOURCES
do
if [[ "${SOURCE}" =~ \.asc$ ]]; then
echo "WARNING: upstream signatures ($SOURCE) not supported by CloudSmith. Ignoring."
elif [[ "${SOURCE}" =~ .*\.orig-[a-zA-Z0-9\-]*\. ]]; then
echo "ERROR: additional upstream component sources ($SOURCE) not supported by CloudSmith"
exit 1
else
# Assume it's the source to upload
UPLOAD_SOURCE="${SOURCE}"
fi
done
if [[ -z "${UPLOAD_SOURCE}" ]]; then
echo "ERROR: Could not determine source file"
exit 2
fi
# Determine optional changes file, only present for 'non-native' packages
DEBTAR=$(dcmd -r --debtar "$DSC")
cloudsmith upload deb "${UPLOAD_TARGET}" "$DSC" \
"--sources-file=${UPLOAD_SOURCE}" \
${DEBTAR:+--changes-file="${DEBTAR}"} \
"${OTHER_ARGS[@]}" |
This is awesome work, thank you @nickbroon! Food for thought for the engineering team over here: In order to support this on the client-side we'd likely need to do a bit of rearchitecting work for the CLI. Right now the package formats are programmatically driven by the API, in the sense that the CLI auto-generates the parameters for However, it means that we can't (or don't) yet do any custom client-side logic per package format. So the CLI would need some form of "extensions" to understand that for "cloudsmith push deb", there's custom logic to apply for some of the parameters. |
What would be even more amazing would be if CloudSmith were to implement the web endpoints needed to use the common native Debian
dput docs here: GitLab Package Registries has experimental support for this (Self hosted only, not Cloud) that might be a useful reference: |
Currently to upload a debian source package:
When scripting the CLI this means detecting/determining the sources/changes files (and they can have various suffix, sources: .orig.tar.gz, .orig.tar.bz2, changes: .debian.tar.xz, .diff.gz , etc).
The files that make up the source package are listed in the 'Files:' section of the .dsc file itself. https://manpages.debian.org/testing/dpkg-dev/dsc.5.en.html
It would be useful if 'cloudsmith push deb' when passed only a .dsc file could parse the 'Files:' to determine the additional sources/changes files it should upload.
If it helps, the https://pypi.org/project/pydpkg/ python library can parse .dsc files:
The text was updated successfully, but these errors were encountered: