[med-svn] [Git][med-team/community/package_template][master] 2 commits: Deal with CRAN packages

Andreas Tille (@tille) gitlab at salsa.debian.org
Sat Feb 21 10:36:52 GMT 2026



Andreas Tille pushed to branch master at Debian Med / community / package_template


Commits:
6156c29c by Andreas Tille at 2026-02-21T11:35:44+01:00
Deal with CRAN packages

- - - - -
ec463c21 by Andreas Tille at 2026-02-21T11:36:24+01:00
Replace Dversionmangle expressions by auto if appropriate

- - - - -


1 changed file:

- convert-watch5


Changes:

=====================================
convert-watch5
=====================================
@@ -1,8 +1,14 @@
 #!/bin/sh
 set -eu
 
+if grep -q '^Version: *5' debian/watch ; then
+  echo "debian/watch seems to be version=5 thus do nothing"
+  exit 0
+fi
+
 # Extract Homepage field from debian/control
 homepage=$(grep -E '^Homepage:' debian/control | awk '{print $2}')
+hasfilesexcluded=$(if grep -q ^Files-Excluded debian/copyright ; then echo 'yes' ; else echo 'no' ; fi)
 
 # Make sure it's a GitHub URL
 case "$homepage" in
@@ -16,6 +22,10 @@ case "$homepage" in
     dist=$(echo "$homepage" | cut -d/ -f5)
     # echo "PyPi project $dist"
     ;;
+  https://cran.r-project.org/*)
+    host=cran
+    package=$(grep ^Package DESCRIPTION | head -n1 | sed 's/^Package:[[:space:]]//')
+    ;;
   *)
     watch=$(grep -o 'https://github.com/[^/]\+/[^[:space:]]*' debian/watch | sed 's/\.git//')
     case "$watch" in
@@ -45,6 +55,13 @@ esac
 dversionmangle=$(grep -i 'dversionmangle[[:space:]]*=' debian/watch | sed 's/^.*dversionmangle[[:space:]]*=[[:space:]]*\([^,]\+\)\(,\|$\).*/Dversion-Mangle: \1/')
 repacksuffix=$(grep -i 'repacksuffix[[:space:]]*=' debian/watch | sed 's/^.*repacksuffix[[:space:]]*=[[:space:]]*\([^,]\+\)\(,\|$\).*/Repack-Suffix: \1/')
 uversionmangle=$(grep -i 'uversionmangle[[:space:]]*=' debian/watch | sed 's/^.*uversionmangle[[:space:]]*=[[:space:]]*\([^,]\+\)\(,\|$\).*/Uversion-Mangle: \1/')
+if [ "$hasfilesexcluded" = "yes" -a "$repacksuffix" = "" ] ; then
+  repacksuffix="+dfsg"
+fi
+if [ "$hasfilesexcluded" = "yes" -a "$dversionmangle" = "" ] ; then
+  repacksuffix="auto"
+fi
+if echo $dversionmangle | grep -q 's/.*dfsg.*//' ; then dversionmangle='Dversion-Mangle: auto' ; fi
 #echo "$dversionmangle"
 #echo "$repacksuffix"
 
@@ -87,6 +104,15 @@ Dist:  $dist
 EOF
 fi
 
+if [ "$host" = "cran" ] ; then
+    cat > debian/watch <<EOF
+Version: 5
+
+Source: https://cloud.r-project.org/src/contrib
+Matching-Pattern: ${package}_ at ANY_VERSION@@ARCHIVE_EXT@
+EOF
+fi
+
 if [ "$host" = "github" ] ; then
   if [ $use_tags -eq 1 ] ; then
     cat >> debian/watch <<EOF



View it on GitLab: https://salsa.debian.org/med-team/community/package_template/-/compare/acd32c1303db2301bb73ad518a9ba89bbe40f779...ec463c2168900ee1339e70e73dbb88726de69011

-- 
View it on GitLab: https://salsa.debian.org/med-team/community/package_template/-/compare/acd32c1303db2301bb73ad518a9ba89bbe40f779...ec463c2168900ee1339e70e73dbb88726de69011
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260221/aefa61b0/attachment-0001.htm>


More information about the debian-med-commit mailing list