Bug#992976: uscan: mode=git refs/heads/ instruction scans for tags instead, and fails

2024-02-23 Thread Gianfranco Costamagna

Hello, change is now committed on git repo.

G.

On Wed, 10 Jan 2024 09:30:18 +0100 Gianfranco Costamagna 
 wrote:

control: tags -1 patch

hello, I'm attaching something that might be considered as a patch, the problem 
was not in the checkout itself, but more in the version log.

--- a/lib/Devscripts/Uscan/git.pm   2023-04-03 01:03:04.0 +0200
+++ b/lib/Devscripts/Uscan/git.pm   2024-01-10 09:25:20.808129993 +0100
@@ -83,18 +83,37 @@ sub git_search {
  } else {
  my $tmp = $ENV{TZ};
  $ENV{TZ} = 'UTC';
-spawn(
-exec => [
-'git',
-"--git-dir=$self->{downloader}->{destdir}/$self->{gitrepo_dir}",
-'log',
-'-1',
-"--date=format-local:$self->{date}",
-"--pretty=$self->{pretty}"
-],
-wait_child => 1,
-to_string  => \$newversion
-);
+$newfile = $self->parse_result->{filepattern}; # HEAD or 
heads/
+if ($self->parse_result->{filepattern} eq 'HEAD') {
+spawn(
+exec => [
+'git',
+"--git-dir=$self->{downloader}->{destdir}/$self->{gitrepo_dir}",
+'log',
+'-1',
+"--date=format-local:$self->{date}",
+"--pretty=$self->{pretty}"
+],
+wait_child => 1,
+to_string  => \$newversion
+);
+   } else {
+$newfile =~ s&^heads/&&;# Set to 
+spawn(
+exec => [
+'git',
+"--git-dir=$self->{downloader}->{destdir}/$self->{gitrepo_dir}",
+'log',
+'-1',
+'-b',
+"$newfile",
+"--date=format-local:$self->{date}",
+"--pretty=$self->{pretty}"
+],
+wait_child => 1,
+to_string  => \$newversion
+);
+   }
  $ENV{TZ} = $tmp;
  chomp($newversion);
  }

On Mon, 19 Jun 2023 17:40:46 +0200 Fab Stz  wrote:
> Hello,
> 


OpenPGP_signature.asc
Description: OpenPGP digital signature


Bug#992976: uscan: mode=git refs/heads/ instruction scans for tags instead, and fails

2024-01-10 Thread Gianfranco Costamagna

control: tags -1 patch

hello, I'm attaching something that might be considered as a patch, the problem 
was not in the checkout itself, but more in the version log.

--- a/lib/Devscripts/Uscan/git.pm   2023-04-03 01:03:04.0 +0200
+++ b/lib/Devscripts/Uscan/git.pm   2024-01-10 09:25:20.808129993 +0100
@@ -83,18 +83,37 @@ sub git_search {
 } else {
 my $tmp = $ENV{TZ};
 $ENV{TZ} = 'UTC';
-spawn(
-exec => [
-'git',
-"--git-dir=$self->{downloader}->{destdir}/$self->{gitrepo_dir}",
-'log',
-'-1',
-"--date=format-local:$self->{date}",
-"--pretty=$self->{pretty}"
-],
-wait_child => 1,
-to_string  => \$newversion
-);
+$newfile = $self->parse_result->{filepattern}; # HEAD or 
heads/
+if ($self->parse_result->{filepattern} eq 'HEAD') {
+spawn(
+exec => [
+'git',
+"--git-dir=$self->{downloader}->{destdir}/$self->{gitrepo_dir}",
+'log',
+'-1',
+"--date=format-local:$self->{date}",
+"--pretty=$self->{pretty}"
+],
+wait_child => 1,
+to_string  => \$newversion
+);
+   } else {
+$newfile =~ s&^heads/&&;# Set to 
+spawn(
+exec => [
+'git',
+"--git-dir=$self->{downloader}->{destdir}/$self->{gitrepo_dir}",
+'log',
+'-1',
+'-b',
+"$newfile",
+"--date=format-local:$self->{date}",
+"--pretty=$self->{pretty}"
+],
+wait_child => 1,
+to_string  => \$newversion
+);
+   }
 $ENV{TZ} = $tmp;
 chomp($newversion);
 }

On Mon, 19 Jun 2023 17:40:46 +0200 Fab Stz  wrote:

Hello,

I'm facing this too.

```d/watch
version=4
options=uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-z/,\
mode=git,gitmode=full,gitexport=all \
https://github.com/bcit-ci/CodeIgniter \
heads/master
```

Upstream's main branch is "develop". uscan takes this one instead of the 
requested "master" branch


```$ uscan --debug --safe
uscan info: uscan (version 2.23.4) See uscan(1) for help
uscan info: Scan watch files in .
uscan debug: Found ./debian
uscan info: Check debian/watch and debian/changelog in .
uscan info: package="php-codeigniter-framework" 
version="0.0~git20230407.63d037565-1" (as seen in debian/changelog)
uscan info: package="php-codeigniter-framework" 
version="0.0~git20230407.63d037565" (no epoch/revision)
uscan info: ./debian/changelog sets package="php-codeigniter-framework" 
version="0.0~git20230407.63d037565"

uscan info: Process watch file at: debian/watch
package = php-codeigniter-framework
version = 0.0~git20230407.63d037565
pkg_dir = .
uscan debug: parse line options=uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-
z/,mode=git,gitmode=full,gitexport=all https://github.com/bcit-ci/CodeIgniter 
heads/master

uscan info: opts: uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-
z/,mode=git,gitmode=full,gitexport=all
uscan info: line: https://github.com/bcit-ci/CodeIgniter heads/master
uscan info: Parsing uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-z/
uscan info: Parsing mode=git
uscan info: Parsing gitmode=full
uscan info: Parsing gitexport=all
uscan info: line: https://github.com/bcit-ci/CodeIgniter heads/master
uscan debug: $self->{'pgpmode'}=default, $self->{'pgpsigurlmangle'}=undef
uscan info: Last orig.tar.* tarball version (from debian/changelog): 
0.0~git20230407.63d037565
uscan info: Last orig.tar.* tarball version (dversionmangled): 
0.0~git20230407.63d037565

uscan debug: watch file has:
$base= https://github.com/bcit-ci/CodeIgniter
$filepattern = heads/master
$lastversion = 0.0~git20230407.63d037565
$action  = 
mode = git

pgpmode  = default
versionmode  = newer
$site= https://github.com/bcit-ci/CodeIgniter
$basedir = 
uscan debug: line: search()

uscan debug: Execute: git clone --quiet --bare https://github.com/bcit-ci/
CodeIgniter ../php-codeigniter-framework-temporary.2454317.git...
uscan info: Looking at $base = https://github.com/bcit-ci/CodeIgniter with
--- ./lib/Devscripts/Uscan/git.pm   2023-04-03 01:03:04.0 +0200
+++ ./git.pm2024-01-10 09:25:20.808129993 +0100
@@ -83,18 +83,37 @@ sub git_search {
 } else {
 my $tmp = $ENV{TZ};
 $ENV{TZ} = 'UTC';
-spawn(
-exec => [
-'git',
-"--git-dir=$self->{downloader}->{destdir}/$self->{gitrepo_dir}",

Bug#992976: uscan: mode=git refs/heads/ instruction scans for tags instead, and fails

2023-06-19 Thread Fab Stz
Hello,

I'm facing this too.

```d/watch
version=4
options=uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-z/,\
mode=git,gitmode=full,gitexport=all \
https://github.com/bcit-ci/CodeIgniter \
heads/master
```

Upstream's main branch is "develop". uscan takes this one instead of the 
requested "master" branch

```$ uscan --debug --safe
uscan info: uscan (version 2.23.4) See uscan(1) for help
uscan info: Scan watch files in .
uscan debug: Found ./debian
uscan info: Check debian/watch and debian/changelog in .
uscan info: package="php-codeigniter-framework" 
version="0.0~git20230407.63d037565-1" (as seen in debian/changelog)
uscan info: package="php-codeigniter-framework" 
version="0.0~git20230407.63d037565" (no epoch/revision)
uscan info: ./debian/changelog sets package="php-codeigniter-framework" 
version="0.0~git20230407.63d037565"
uscan info: Process watch file at: debian/watch
package = php-codeigniter-framework
version = 0.0~git20230407.63d037565
pkg_dir = .
uscan debug: parse line options=uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-
z/,mode=git,gitmode=full,gitexport=all https://github.com/bcit-ci/CodeIgniter 
heads/master
uscan info: opts: uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-
z/,mode=git,gitmode=full,gitexport=all
uscan info: line: https://github.com/bcit-ci/CodeIgniter heads/master
uscan info: Parsing uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-z/
uscan info: Parsing mode=git
uscan info: Parsing gitmode=full
uscan info: Parsing gitexport=all
uscan info: line: https://github.com/bcit-ci/CodeIgniter heads/master
uscan debug: $self->{'pgpmode'}=default, $self->{'pgpsigurlmangle'}=undef
uscan info: Last orig.tar.* tarball version (from debian/changelog): 
0.0~git20230407.63d037565
uscan info: Last orig.tar.* tarball version (dversionmangled): 
0.0~git20230407.63d037565
uscan debug: watch file has:
$base= https://github.com/bcit-ci/CodeIgniter
$filepattern = heads/master
$lastversion = 0.0~git20230407.63d037565
$action  = 
mode = git
pgpmode  = default
versionmode  = newer
$site= https://github.com/bcit-ci/CodeIgniter
$basedir = 
uscan debug: line: search()
uscan debug: Execute: git clone --quiet --bare https://github.com/bcit-ci/
CodeIgniter ../php-codeigniter-framework-temporary.2454317.git...
uscan info: Looking at $base = https://github.com/bcit-ci/CodeIgniter with
$filepattern = heads/master found
$newfile = heads/master
$newversion  = 0.0~git20230407.63d037565
$lastversion = 0.0~git20230407.63d037565
uscan debug: line: get_upstream_url()
uscan info: Upstream URL(+tag) to download is identified ashttps://
github.com/bcit-ci/CodeIgniter heads/master
uscan debug: line: get_newfile_base()
uscan info: Filename (filenamemangled) for downloaded file: php-codeigniter-
framework-0.0~git20230407.63d037565.tar.xz
uscan debug: line: cmp_versions()
uscan info: Newest version of php-codeigniter-framework on remote site is 
0.0~git20230407.63d037565, local version is 0.0~git20230407.63d037565
uscan info:  => Package is up to date from:
 => https://github.com/bcit-ci/CodeIgniter heads/master
uscan debug: line: download_file_and_sig()
uscan debug: line: mkorigtargz()
uscan debug: Keep git repo (../php-codeigniter-framework-temporary.
2454317.git)
uscan info: Scan finished
```

Maybe the problem has something to do with this command?
Execute: git clone --quiet --bare https://github.com/bcit-ci/CodeIgniter ../
php-codeigniter-framework-temporary.2454317.git...

Regards
Fab

On Wed, 25 Aug 2021 22:15:42 +0200 Romain Porte  wrote:
> Package: devscripts
> Version: 2.21.3
> Severity: important
> X-Debbugs-Cc: deb...@microjoe.org
> 
> Dear Maintainer,
> 
> While trying to use uscan to scan for upstream commits on a specific
> branch instead of the default on, I tried to use refs/heads/ as
> explained in the uscan man page.
> 
> Here is the content of the d/watch file I am using:
> 
> version=4
> opts="mode=git, gitmode=full, pgpmode=none, pretty=8.994+git%cd.%h, 
repack, compression=xz" \
> https://bitbucket.org/jpcgt/flatcam.git \
> refs/heads/Beta
> 
> However when running uscan, the invocation fails with the following
> message:
> 
> uscan info: uscan (version 2.21.3) See uscan(1) for help
> uscan info: Scan watch files in .
> uscan info: Check debian/watch and debian/changelog in .
> uscan info: package="flatcam" version="8.994+ds-1" (as seen in debian/
changelog)
> uscan info: package="flatcam" version="8.994+ds" (no epoch/revision)
> uscan info: ./debian/changelog sets package="flatcam" version="8.994+ds"
> uscan info: Process watch file at: debian/watch
> package = flatcam
> version = 8.994+ds
> pkg_dir = .
> uscan info: opts: mode=git, gitmode=full, pgpmode=none, 
pretty=8.994+git%cd.%h, repack, compression=xz
> uscan info: line: https://bitbucket.org/jpcgt/flatcam.git refs/heads/
Beta
> uscan info: Parsing 

Bug#992976: uscan: mode=git refs/heads/ instruction scans for tags instead, and fails

2022-06-14 Thread Agathe Porte

Hi uscan maintainers,

Any potential update?

From the tracked bugs this problem is blocking at least two packages 
from moving forward to close their own bugs.


Best regards,

Agathe.



Bug#992976: uscan: mode=git refs/heads/ instruction scans for tags instead, and fails

2021-09-01 Thread Romain Porte
Hi,

On Thu, 26 Aug 2021 16:40:38 +0200 Yadd  wrote:

> could you try using "heads/Beta" instead of "refs/heads/Beta" ?

Here is the output when using `heads/Beta` instead of `refs/heads/Beta`:

> uscan --verbose --no-download --debug
> uscan info: uscan (version 2.21.3) See uscan(1) for help
> uscan info: Scan watch files in .
> uscan info: Check debian/watch and debian/changelog in .
> uscan info: package="flatcam" version="8.994+ds-1" (as seen in
> debian/changelog)
> uscan info: package="flatcam" version="8.994+ds" (no epoch/revision)
> uscan info: ./debian/changelog sets package="flatcam" version="8.994+ds"
> uscan info: Process watch file at: debian/watch
>     package = flatcam
>     version = 8.994+ds
>     pkg_dir = .
> uscan info: opts: mode=git, gitmode=full, pgpmode=none,
> pretty=8.994+git%cd.%h, repack, compression=xz
> uscan info: line: https://bitbucket.org/jpcgt/flatcam.git heads/Beta
> uscan info: Parsing mode=git
> uscan info: Parsing  gitmode=full
> uscan info: Parsing  pgpmode=none
> uscan info: Parsing  pretty=8.994+git%cd.%h
> uscan info: Parsing  repack
> uscan info: Parsing  compression=xz
> uscan info: line: https://bitbucket.org/jpcgt/flatcam.git heads/Beta
> uscan info: Last orig.tar.* tarball version (from debian/changelog):
> 8.994+ds
> uscan info: Last orig.tar.* tarball version (dversionmangled): 8.994+ds
> uscan info: Looking at $base = https://bitbucket.org/jpcgt/flatcam.git
> with
>     $filepattern = heads/Beta found
>     $newfile = heads/Beta
>     $newversion  = 8.994+git20190713.dae9cbb0
>     $lastversion = 8.994+ds
> uscan info: Upstream URL(+tag) to download is identified as   
> https://bitbucket.org/jpcgt/flatcam.git heads/Beta
> uscan info: Filename (filenamemangled) for downloaded file:
> flatcam-8.994+git20190713.dae9cbb0.tar.xz
> uscan: Newest version of flatcam on remote site is
> 8.994+git20190713.dae9cbb0, local version is 8.994+ds
> uscan:  => Newer package available from:
>     => https://bitbucket.org/jpcgt/flatcam.git heads/Beta
> uscan info: Removing git repo (../flatcam-temporary.7926.git)
> uscan info: Scan finished

It seems to pick the last commit in `master` branch instead of the last
commit in the `Beta` branch:

> $ git show master
> commit dae9cbb0471e693b95fd809ddd8bf11ff026ac67 (HEAD -> master,
> origin/master, origin/HEAD)
> Merge: 46454c29 ea48d5b7
> Author: SM 
> Date:   Sat Jul 13 17:41:06 2019 +

> $ git show Beta
> commit d4f941335ca8a8d5351aab23b396f99da06a9029 (origin/Beta, Beta)
> Merge: a64d01b5 e821072d
> Author: Emily Ellis 
> Date:   Thu Aug 26 10:21:28 2021 +

Best regards




OpenPGP_signature
Description: OpenPGP digital signature


Bug#992976: uscan: mode=git refs/heads/ instruction scans for tags instead, and fails

2021-08-26 Thread Yadd
Hi,

could you try using "heads/Beta" instead of "refs/heads/Beta" ?



Bug#992976: uscan: mode=git refs/heads/ instruction scans for tags instead, and fails

2021-08-25 Thread Romain Porte
Package: devscripts
Version: 2.21.3
Severity: important
X-Debbugs-Cc: deb...@microjoe.org

Dear Maintainer,

While trying to use uscan to scan for upstream commits on a specific
branch instead of the default on, I tried to use refs/heads/ as
explained in the uscan man page.

Here is the content of the d/watch file I am using:

version=4
opts="mode=git, gitmode=full, pgpmode=none, pretty=8.994+git%cd.%h, repack, 
compression=xz" \
https://bitbucket.org/jpcgt/flatcam.git \
refs/heads/Beta

However when running uscan, the invocation fails with the following
message:

uscan info: uscan (version 2.21.3) See uscan(1) for help
uscan info: Scan watch files in .
uscan info: Check debian/watch and debian/changelog in .
uscan info: package="flatcam" version="8.994+ds-1" (as seen in 
debian/changelog)
uscan info: package="flatcam" version="8.994+ds" (no epoch/revision)
uscan info: ./debian/changelog sets package="flatcam" version="8.994+ds"
uscan info: Process watch file at: debian/watch
package = flatcam
version = 8.994+ds
pkg_dir = .
uscan info: opts: mode=git, gitmode=full, pgpmode=none, 
pretty=8.994+git%cd.%h, repack, compression=xz
uscan info: line: https://bitbucket.org/jpcgt/flatcam.git refs/heads/Beta
uscan info: Parsing mode=git
uscan info: Parsing  gitmode=full
uscan info: Parsing  pgpmode=none
uscan info: Parsing  pretty=8.994+git%cd.%h
uscan info: Parsing  repack
uscan info: Parsing  compression=xz
uscan info: line: https://bitbucket.org/jpcgt/flatcam.git refs/heads/Beta
uscan warn: Tag pattern missing version delimiters () in debian/watch, 
skipping:
  https://bitbucket.org/jpcgt/flatcam.git refs/heads/Beta
uscan info: Scan finished

The scan fails because *tag pattern* is not found. But I am not looking
for tags but for the last commit of a branch (refs/heads/*).

Quoting the man page:

If matching-pattern is set to refs/heads/branch, uscan
downloads source from the named branch of the git repository.

Expected behavior would be uscan to download the latest commit of the
branch, without any pattern required to be matched.

Thanks.

-- Package-specific info:

--- /etc/devscripts.conf ---
Empty.

--- ~/.devscripts ---
Not present

-- System Information:
Debian Release: 11.0
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-8-amd64 (SMP w/4 CPU threads)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages devscripts depends on:
ii  dpkg-dev  1.20.9
ii  fakeroot  1.25.3-1.1
ii  file  1:5.39-3
ii  gnupg 2.2.27-2
ii  gnupg22.2.27-2
ii  gpgv  2.2.27-2
ii  libc6 2.31-13
ii  libfile-dirlist-perl  0.05-2
ii  libfile-homedir-perl  1.006-1
ii  libfile-touch-perl0.11-1
ii  libfile-which-perl1.23-1
ii  libipc-run-perl   20200505.0-1
ii  libmoo-perl   2.004004-1
ii  libwww-perl   6.52-1
ii  patchutils0.4.2-1
ii  perl  5.32.1-4+deb11u1
ii  python3   3.9.2-3
ii  sensible-utils0.0.14
ii  wdiff 1.2.2-2+b1

Versions of packages devscripts recommends:
ii  apt 2.2.4
ii  curl7.74.0-1.3+b1
ii  dctrl-tools 2.24-3+b1
ii  debian-keyring  2021.07.26
ii  dput-ng [dput]  1.33
ii  equivs  2.3.1
ii  libdistro-info-perl 1.0
ii  libdpkg-perl1.20.9
ii  libencode-locale-perl   1.05-1.1
ii  libgit-wrapper-perl 0.048-1
ii  libgitlab-api-v4-perl   0.26-1
ii  liblist-compare-perl0.55-1
ii  liblwp-protocol-https-perl  6.10-1
ii  libsoap-lite-perl   1.27-1
ii  libstring-shellquote-perl   1.04-1
ii  libtry-tiny-perl0.30-1
ii  liburi-perl 5.08-1
ii  licensecheck3.1.1-2
ii  lintian 2.104.0
ii  man-db  2.9.4-2
ii  patch   2.7.6-7
ii  pristine-tar1.49
ii  python3-apt 2.2.1
ii  python3-debian  0.1.39
ii  python3-magic   2:0.4.20-3
ii  python3-requests2.25.1+dfsg-2
ii  python3-unidiff 0.5.5-2
ii  python3-xdg 0.27-2
ii  strace  5.10-1
ii  unzip   6.0-26
ii  wget1.21-1+b1
ii  xz-utils5.2.5-2

Versions of packages devscripts suggests:
pn  adequate  
ii  at3.1.23-1.1
ii  autopkgtest   5.16
pn  bls-standalone