pacstall / pacup

Help maintainers update pacscripts (next-gen Perl rewrite)
GNU General Public License v3.0
5 stars 2 forks source link

FR: propose to overwrite remote branch #10

Closed Zahrun closed 2 months ago

Zahrun commented 2 months ago

Describe the bug

When the remote branch already exists, shipping fails

To reproduce

pacup -s ferdium-deb/ferdium-deb.pacscript -c 6.7.3

Expected behavior

pacup could propose to overwrite remote branch

Screenshots

aroun@aroun-tuxedo-x1  23ms  ~  UnixSync  dev  pacstall-programs  packages master ↑17 +0 ~0 -0  pacup -s ferdium-deb/ferdium-deb.pacscript -c 6.7.3
[+] INFO: Parsing .SRCINFO for ferdium-deb.pacscript
    [>] Found pkgname: ferdium-deb
    [>] Found pkgver: 6.7.2
    [>] Found maintainer: Zahrun <Zahrun@github.com>
    [>] Current: 6.7.2 ~> Latest: 6.7.3
Proceed with updating ferdium-deb to 6.7.3? [Y/n] 
    [>] Found source https://github.com/ferdium/ferdium-app/releases/download/v6.7.3/Ferdium-linux-6.7.3-amd64.deb
[+] INFO: Fetching sources for ferdium-deb
[+] INFO: Downloading Ferdium-linux-6.7.3-amd64.deb
100% [===========================================================================================]D 0h00m17s    [>] Calculating sha256sum for source entry
[+] INFO: updating ferdium-deb.pacscript
[+] INFO: Installing from ferdium-deb.pacscript
(ferdium-deb) Do you want to view/edit the pacscript? [y/N] 
[+] INFO: Sourcing pacscript
[+] INFO: Retrieving packages
[+] INFO: Copying local archive Ferdium-linux-6.7.3-amd64.deb
    [>] Checking hash 4397d431[...]
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'ferdium' instead of './Ferdium-linux-6.7.3-amd64.deb'
ferdium is already the newest version (6.7.3).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
[+] INFO: Performing post install operations
    [>] Storing pacscript
    [>] Cleaning up
[+] INFO: Done installing ferdium-deb
[+] INFO: Packaging 
tee: /usr/src/pacstall//DEBIAN/control: No such file or directory
tee: /usr/src/pacstall//DEBIAN/control: No such file or directory
tee: /usr/src/pacstall//DEBIAN/control: No such file or directory
tee: /usr/src/pacstall//DEBIAN/control: No such file or directory
tee: /usr/src/pacstall//DEBIAN/control: No such file or directory
tee: /usr/src/pacstall//DEBIAN/control: No such file or directory
tee: /usr/src/pacstall//DEBIAN/control: No such file or directory
tee: /usr/src/pacstall//DEBIAN/postrm: No such file or directory
tee: /usr/src/pacstall//DEBIAN/control: No such file or directory
tee: /usr/src/pacstall//DEBIAN/changelog: No such file or directory
/usr/share/pacstall/scripts/build-local.sh: line 281: pushd: DEBIAN: No such file or directory
[!] ERROR: Could not create package
[+] INFO: Cleaning up
tee: /var/lib/pacstall/metadata/: Is a directory
[+] INFO: Performing post install operations
    [>] Storing pacscript
cp: cannot stat '/tmp/ferdium-deb.pacscript': No such file or directory
    [>] Cleaning up
[+] INFO: Done installing ferdium-deb
does ferdium-deb work? [y/n] y
Delete existing branch ship-ferdium-deb? [Y/n] 
Deleted branch ship-ferdium-deb (was 7ebd0929).
Switched to a new branch 'ship-ferdium-deb'
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
mixed line ending........................................................Passed
shellcheck...............................................................Passed
shfmt....................................................................Passed
update packagelist file..................................................Passed
update .SRCINFO data.....................................................Passed
[ship-ferdium-deb 9ed804f4] upd(ferdium-deb): `6.7.2` -> `6.7.3`
 2 files changed, 5 insertions(+), 5 deletions(-)
To github.com:Zahrun/pacstall-programs.git
 ! [rejected]          ship-ferdium-deb -> ship-ferdium-deb (non-fast-forward)
error: failed to push some refs to 'github.com:Zahrun/pacstall-programs.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
"git" unexpectedly returned exit value 1 at /usr/bin/pacup line 491.
[+] INFO: Cleaning up
 ERROR aroun@aroun-tuxedo-x1  7m 32s  ~  UnixSync  dev  pacstall-programs  packages ship-ferdium-deb ≡ +0 ~0 -0  git push           
fatal: The current branch ship-ferdium-deb has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin ship-ferdium-deb

 128 aroun@aroun-tuxedo-x1  7ms  ~  UnixSync  dev  pacstall-programs  packages ship-ferdium-deb ≡ +0 ~0 -0  git push --set-upstream origin ship-ferdium-deb
To github.com:Zahrun/pacstall-programs.git
 ! [rejected]          ship-ferdium-deb -> ship-ferdium-deb (non-fast-forward)
error: failed to push some refs to 'github.com:Zahrun/pacstall-programs.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
 ERROR aroun@aroun-tuxedo-x1  3s  ~  UnixSync  dev  pacstall-programs  packages ship-ferdium-deb ≡ +0 ~0 -0  git push --set-upstream origin ship-ferdium-deb -f
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 12 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 655 bytes | 655.00 KiB/s, done.
Total 6 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To github.com:Zahrun/pacstall-programs.git
 + 67ac01d4...9ed804f4 ship-ferdium-deb -> ship-ferdium-deb (forced update)
Branch 'ship-ferdium-deb' set up to track remote branch 'ship-ferdium-deb' from 'origin'.
oklopfer commented 2 months ago

@Zahrun this already exists with -p/--push-force

Zahrun commented 2 months ago

Awesome