Package: cvs-buildpackage
Version: 5.19
Severity: wishlist

Hi,

Currently, cvs-buildpackage has a problem to build
"No original source" debian source package with
debian_revision, such as kernel-image.dsc. I'm not clear
if it's policy violation, but I wrote an ad-hoc patch
to handle this case. The attached patch adds an option
'--nos' not to export upstream_version_<...> even though
it has debian_revision.

According to C.3.

  If there is no original source code - for example, if the package is
  specially prepared for Debian or the Debian maintainer is the same
  as the upstream maintainer.

I guess the kernel-image.dsc is the latter case.

Best regards,

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=ja_JP.EUC-JP, LC_CTYPE=ja_JP.EUC-JP (charmap=EUC-JP)

Versions of packages cvs-buildpackage depends on:
ii  cvs                          1:1.12.9-13 Concurrent Versions System
ii  dpkg-dev                     1.10.27     Package building tools for Debian

-- no debconf information
--- /usr/bin/cvs-buildpackage   2005-03-17 17:55:31.000000000 +0900
+++ /home/taru/bin/cvs-buildpackage     2005-04-21 17:38:38.446922440 +0900
@@ -73,6 +73,7 @@
                the full export mechanism.
   -H<script>   A hook script to be called from the checked out dir before 
                calling dpkg-buildpackage
+  --nos        "No original source code" mode. See C.3 of debian-policy.
  The rest are passed to dpkg-buildpackage, though we do pay attention
  to the -r option. These are the options supported:
     -r<gain-root-command>
@@ -118,7 +119,7 @@
 TAGOPT=
 
 # Command line
-TEMP=$(getopt -a -s bash -o 
hC:EAH:G:M:P:R:T:U:V:W:Ff:dcnr:x:Bbp:Dk:a:Sv:m:e:i:I: --long 
ctp,help,tC,sgpg,spgp,us,uc,op,si,sa,sd,ap,sp,su,sk,sr,sA,sP,sU,sK,sR,ss,sn -n 
'cvs-buildpackage' -- "$@")
+TEMP=$(getopt -a -s bash -o 
hC:EAH:G:M:P:R:T:U:V:W:Ff:dcnr:x:Bbp:Dk:a:Sv:m:e:i:I: --long 
nos,ctp,help,tC,sgpg,spgp,us,uc,op,si,sa,sd,ap,sp,su,sk,sr,sA,sP,sU,sK,sR,ss,sn 
-n 'cvs-buildpackage' -- "$@")
 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
 
 # Note the quotes around `$TEMP': they are essential!
@@ -147,6 +148,7 @@
        -x)    opt_prefix="$2"       ; shift 2 ;;
        -E)    opt_fullexport="YES"      ; shift   ;;
         -A)    opt_use_apt="YES"       ; shift ;;
+       --nos)  opt_no_original_source="YES"    ; shift ;;
        -d)    dpkg_options=("[EMAIL PROTECTED]" "$1")   ; shift   ;;
         -B)    dpkg_options=("[EMAIL PROTECTED]" "$1")   ; shift   ;;
         -b)    dpkg_options=("[EMAIL PROTECTED]" "$1")   ; shift   ;;
@@ -556,6 +558,12 @@
 pkgdir="$workdir/$package-$upstream_version"
 oversion="$workdir/${package}_${upstream_version}.orig.tar.gz"
 
+if [ -e "$oversion" -a -n "$opt_no_original_source" ]; then
+    echo >&2 "An original source code exists in No-original-source mode"
+    exit 1
+fi
+
+
 if [ $DEBUG -gt 0 ]; then
     echo >&2 ""
     echo >&2 "============================================================"
@@ -646,12 +654,12 @@
 else
     if [ "x$WORKINGCVS" = "x" ]; then
       $action cvs -q export -d $(basename $pkgdir) -r "$cvstag" "$cvsmodule"
-      if [ "x$debian_version" != "x" -a ! -e "$oversion"  ]; then
+      if [ "x$debian_version" != "x" -a ! -e "$oversion" -a -z 
"$opt_no_original_source" ]; then
        $action cvs -q export -d "$(basename $pkgdir).orig" -r 
"$cvs_upstream_tag" "$cvsmodule"
       fi
     else
       $action cvs -q export -d $package-$upstream_version -r "$cvstag" 
"$cvsmodule"
-      if [ "x$debian_version" != "x"  -a ! -e "$oversion" ]; then
+      if [ "x$debian_version" != "x"  -a ! -e "$oversion" -a -z 
"$opt_no_original_source" ]; then
        $action cvs -q export -d "$package-$upstream_version.orig" -r 
"$cvs_upstream_tag" "$cvsmodule"
       fi
     fi

Reply via email to