UPDATE: This question is now out of date. Hackage now uses Haskell version 7.10.2 to build, so the following failure does not occur. The change also appears to have broken some of the scripts mentioned in the answers.मैं अपने हास्केल पैकेज के लिए हैकेज पर दस्तावेज़ कैसे प्राप्त करूं?
मैं अपने हास्केल पैकेज के लिए हैकेज पर दस्तावेज़ कैसे प्राप्त करूं?
मेरे समझ क्या है कि Hackage उन्हें का निर्माण होगा, लेकिन मैं कोई त्रुटि मिलती है
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: MyPackage-0.1.0.2 (user goal)
next goal: base (dependency of MyPackage-0.1.0.2)
rejecting: base-4.7.0.1/installed-e4b... (conflict: MyPackage => base>=4.8 &&
<4.9)
rejecting: base-4.8.1.0, 4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0,
4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1,
4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires
installed instance)
Dependency tree exhaustively searched.
मैं (जो एक स्वत: निर्माण करने के लिए बाधा प्रतीत होता है) अपने पैकेज के लिए आवश्यकताओं को डाउनग्रेड करने में सक्षम नहीं कर रहा हूँ और मैं देखता हूं कि कुछ पैकेज कहते हैं "उपयोगकर्ता द्वारा अपलोड किया गया डॉक्स"। हालांकि निर्माण करने का कोई भी प्रयास विफल रहता है (नीचे देखें।)
मैं अपने हास्केल पैकेज के लिए हैकेज पर दस्तावेज़ कैसे प्राप्त करूं? विशेष रूप से, मुझे खुद को अपलोड करने के लिए मुझे क्या करने की ज़रूरत है?
मैं tried
$ cp -R ./dist/doc/html/MyPackage/ MyPackage-0.1.0.2-docs
$ tar cvzf --format=ustar -f MyPackage-0.1.0.2-docs.tar.gz MyPackage-0.1.0.2-docs
$ curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary '@MyPackage-0.1.0.2-docs.tar.gz' 'https://hackage.haskell.org/package/MyPackage-0.1.0.2/docs' -u 'Rax'
लेकिन मिल
Invalid documentation tarball: File in tar archive is not in the expected directory 'MyPackage-0.1.0.2-docs'
name: MyPackage
version: 0.1.0.2
license: BSD3
license-file: LICENSE
-- copyright:
category: Development
build-type: Simple
-- extra-source-files:
cabal-version: >= 1.22.1.1
library
-- default-extensions: Trustworthy
exposed-modules: MyMod.A,
MyMod.A.B
other-modules: MyMod.C
-- other-extensions:
build-depends: base >= 4.8.1.0 && <4.9,
containers >= 0.5.5.1,
split >= 0.2.2,
MissingH >= 1.3.0.1
-- hs-source-dirs:
default-language: Haskell2010
मैं अपने स्वयं के संस्करण की कोशिश की है की है नीचे लिंक किए गए कई स्क्रिप्ट है, लेकिन का एक ही त्रुटि मिलती है:
#!/bin/bash
cabal haddock --hyperlink-source --html-location='/package/$pkg-$version/docs' --contents-location='/package/$pkg'
S=$?
if [ "${S}" -eq "0" ]; then
cd "dist/doc/html"
DDIR="${1}-${2}-docs"
cp -r "${1}" "${DDIR}" && tar -c -v -z --format=ustar -f "${DDIR}.tar.gz" "${DDIR}"
CS=$?
if [ "${CS}" -eq "0" ]; then
echo "Uploading to Hackage…"
curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary "@${DDIR}.tar.gz" --digest --netrc "https://hackage.haskell.org/package/${1}-${2}/docs"
exit $?
else
echo "Error when packaging the documentation"
exit $CS
fi
else
echo "Error when trying to build the package."
exit $S
fi
जो मैं
myscript MyPackage 0.1.0.2
साथ आह्वान लेकिन एक ही त्रुटि मिलती है।
आपकी। कैबल फ़ाइल क्या है? – ErikR
@ user5402: जोड़ा गया। कैबल फ़ाइल। – orome
आपका 'tar' आदेश 'MyPackage-0.0.1.3-docs' के साथ समाप्त होता है, जो बाकी के संस्करण से मेल नहीं खाता है। क्या आपने शायद गलत टैब को आकस्मिक टैब पूरा करके पैक किया था? –