get-orig-source rule question...
Max Bowsher
maxb at f2s.com
Thu May 28 02:35:04 BST 2009
Ancoron Luciferis wrote:
> Hi there,
>
> I've currently working on fixing the last issue that REVU raises for my
> first package: http://revu.ubuntuwire.com/p/sblim-cmpi-fsvol
>
> I have written a small script to download the latest version of the package:
>
> #!/bin/sh
>
> PKGNAME="sblim-cmpi-fsvol"
>
> echo "Creating temporary directory ..."
> mkdir DL_TMP || exit 1
> cd DL_TMP
> echo "Retrieving versions for package ${PKGNAME} ..."
> wget -qO files.tmp
> "http://sourceforge.net/project/showfiles.php?group_id=128809&package_id=144611"
> || exit 1
> echo "Extracting download URI for latest package version ..."
> sed -e '/downloads\.sourceforge\.net/!d' -e
> "s/.\+\(http.*downloads\.sourceforge\.net[^']\+\).\+/\1/;q" files.tmp >
> filename.tmp || exit 1
> echo "Extracting basename of package ..."
> PKGBASENAME="`sed -e 's/.\+\(sblim.\+\)\.tar\.bz2/\1/' filename.tmp`"
> echo "Extracting version of package ..."
> PKGVERSION="`sed -e 's/.\+fsvol\-\(.\+\)\.tar\.bz2/\1/' filename.tmp`"
> echo "Downloading the latest package ..."
> wget -qO ${PKGBASENAME}.tar.bz2 `cat filename.tmp` || exit 1
> echo "Creating ${PKGNAME}_${PKGVERSION}.orig.tar.gz package ..."
> bunzip2 ${PKGBASENAME}.tar.bz2 || exit 1
> gzip -9 ${PKGBASENAME}.tar || exit 1
> mv ${PKGBASENAME}.tar.gz ../${PKGNAME}_${PKGVERSION}.orig.tar.gz || exit 1
> cd ..
> rm -r DL_TMP
>
>
> ^^ That one first looks into the files page of the package, extracts the
> link for the latest version, downloads it and then builds a orig.tar.gz
> (as the package is provided as a tar.bz2)
>
> A first integration into the rules file looks like this:
>
> get-orig-source:
> echo "Creating temporary directory ..."
> mkdir DL_TMP || exit 1
> cd DL_TMP
> echo "Retrieving versions for package ${PKGNAME} ..."
> wget -qO files.tmp
> "http://sourceforge.net/project/showfiles.php?group_id=128809&package_id=144611"
> || exit 1
> echo "Extracting download URI for latest package version ..."
> sed -e '/downloads\.sourceforge\.net/!d' -e
> "s/.\+\(http.*downloads\.sourceforge\.net[^']\+\).\+/\1/;q" files.tmp >
> filename.tmp || exit 1
> echo "Extracting basename of package ..."
> PKGBASENAME = `sed -e 's/.\+\(sblim.\+\)\.tar\.bz2/\1/' filename.tmp`
> echo "Extracting version of package ..."
> PKGVERSION = `sed -e 's/.\+fsvol\-\(.\+\)\.tar\.bz2/\1/' filename.tmp`
> echo "Downloading the latest package ..."
> wget -qO $(PKGBASENAME).tar.bz2 `cat filename.tmp` || exit 1
> echo "Creating ${PKGNAME}_${PKGVERSION}.orig.tar.gz package ..."
> bunzip2 $(PKGBASENAME).tar.bz2 || exit 1
> gzip -9 $(PKGBASENAME).tar || exit 1
> mv $(PKGBASENAME).tar.gz ../../$(PKGNAME)_$(PKGVERSION).orig.tar.gz ||
> exit 1
> cd ..
> rm -r DL_TMP
Unfortunately, all the above is unnecessary complication.
Actually you just want a debian/watch file containing:
version=3
http://sf.net/sblim/sblim-cmpi-fsvol-(.+)\.tar\.bz2
(Consult "man uscan" for more details)
> The main question I have is:
>
> What happens if the version number changes (e.g. from currently 1.4.4 to
> 1.4.5)? As the debian directory and its files are located inside the
> extracted directory of the package will those be automatically copied
> into the new directory?
>
> E.g. before:
>
> sblim-cmpi-fsvol-1.4.4/debian/rules
>
> ...would become...
>
> sblim-cmpi-fsvol-1.4.5/debian/rules
>
> ...without any other change by the package maintainer?
IIRC the uscan tool will rename the directory appropriately.
Max.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/ubuntu-motu/attachments/20090528/7c3f1b48/attachment.pgp
More information about the Ubuntu-motu
mailing list