You are not logged in.

#1 2019-04-19 05:06:34

s7hoang
Member
Registered: 2019-04-19
Posts: 6

Deleting Existing Files

Hey newbie here,

I took over an old package and found that I can't remove any of the files that
are already existing.
I get `error: missing source file <filename>`. What do I do?

### background

I tried creating a package that does the same thing as the one I took over
(abandoned, doesn't build anymore) but I'm using someone else's repo and
different files from the old package..

Offline

#2 2019-04-19 05:16:56

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 27,896
Website

Re: Deleting Existing Files

Post your PKGBUILD, and the full output of `makepkg`.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-04-20 01:48:22

s7hoang
Member
Registered: 2019-04-19
Posts: 6

Re: Deleting Existing Files

Sorry, I should've clarified that the error is with git.

The exact steps I made were:

1. git clone <repo>
2. git rm --cached <file>
3. git commit -m "remove file"
4. git push

the git error is:

remote: error: The following error occurred when parsing commit
remote: error: c2b6e401acf305ae7eaf4990da8d543255a782a3:
remote: error: missing source file: ankiserverctl.py.patch
remote: error: hook declined to update refs/heads/master
PKGBUILD:
# Maintainer: s7hoang <s7hoang at gmail dot com>
pkgname=anki-sync-server
pkgver=r259.7ef3d4f
pkgrel=1
pkgdesc="A sync server for anki using a forked version from github.com/tsudoko (orig:dsnopek)"
arch=('any')
url="https://github.com/tsudoko/anki-sync-server"
license=('GPL')
depends=('python' 'python-pip')
makedepends=('portaudio')
optdepends=('python-pyqt5: dependency of bundled anki client' 
'python-pyqtwebengine: dependency of bundled anki client'
'libvpx>=1.8.0-1: dependency of bundled anki client'
'double-conversion>=3.1.4-1: dependency of bundled anki client'
'qt5-base>=5.12.2-1.1: dependency of bundled anki client'
'qt5ct>=0.38-1: dependency of bundled anki client'
'qt5-svg>=5.12.2-1: dependency of bundled anki client'
'portaudio: dependency of pyaudio which is a dependency of bundled anki'
'mpv: optional dependency of bundled anki client'
)
install=anki-sync-server.install
source=('git+https://github.com/tsudoko/anki-sync-server')
md5sums=('SKIP')

pkgver() {
cd "${pkgname}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
# move plugins and systemd file to src package
mkdir -p "${pkgname}/plugins/anki2.0"
mkdir -p "${pkgname}/plugins/anki2.1/ankisyncd"
mkdir -p "${pkgname}/plugins/systemd"
cp ../anki-sync-server.py "${pkgname}/plugins/anki2.0"
cp ../__init__.py "${pkgname}/plugins/anki2.1/ankisyncd"
cp ../anki-sync-server.service "${pkgname}/plugins/systemd"

cd "${pkgname}"
# set plugins to use current ip address as plugins' target address
sed -i "2s/0\.0\.0\.0/$(ip route get 1.2.3.4 | awk '{print $7}')/" \
plugins/anki2.0/anki-sync-server.py
sed -i "3s/0\.0\.0\.0/$(ip route get 1.2.3.4 | awk '{print $7}')/" \
plugins/anki2.0/anki-sync-server.py
sed -i "3s/0\.0\.0\.0/$(ip route get 1.2.3.4 | awk '{print $7}')/" \
plugins/anki2.1/ankisyncd/__init__.py

# set current ip address as the server's ip address
sed "3s/0\.0\.0\.0/$(ip route get 1.2.3.4 | awk '{print $7}')/" ankisyncd.conf -i

# set user and directory information for systemd service file
# the user is going to be named the same thing as the package name
sed "10s/changeme/${pkgname}/" plugins/systemd/anki-sync-server.service -i
sed "11s/changeme/${pkgname}/" plugins/systemd/anki-sync-server.service -i
sed "12s|changeme|/opt/${pkgname}|" plugins/systemd/anki-sync-server.service -i
}

build() {
cd "${pkgname}"/anki-bundled

#initialize anki-bundled
git submodule update --init

# get anki-bundled working
if [ -z "$(echo 'python-pyqt5 python-pyqtwebengine qt5-base>=5.12.2-1.1 libvpx>=1.8.0-1
double-conversion>=3.1.4-1 qt5ct>=0.38-1 qt5-svg>=5.12.2-1' | xargs pacman -T)" ]; then
echo "found prerequisites to use bundled anki, setting up bundled anki"
pip install --upgrade setuptools --user
pip install -r requirements.txt --user
bash tools/build_ui.sh
fi
}

package() {
cd "${pkgname}"
mkdir "${pkgdir}"/opt
cp -R "${srcdir}/${pkgname}" "${pkgdir}"/opt
}
makepkg output:
==> Making package: anki-sync-server r259.7ef3d4f-1 (Fri 19 Apr 2019 09:32:01 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Cloning anki-sync-server git repo...
Cloning into bare repository '/home/s7hoang/git/aur-anki-sync-server/anki-sync-server'...
==> Validating source files with md5sums...
anki-sync-server ... Skipped
==> Extracting sources...
-> Creating working copy of anki-sync-server git repo...
Cloning into 'anki-sync-server'...
done.
==> Starting prepare()...
==> Starting pkgver()...
==> Starting build()...
Submodule 'anki-bundled' ([url]https://github.com/dae/anki.git[/url]) registered for path './'
Cloning into '/home/s7hoang/git/aur-anki-sync-server/src/anki-sync-server/anki-bundled'...
Submodule path './': checked out 'cca3fcb2418880d0430a5c5c2e6b81ba260065b7'
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
-> Removing libtool files...
-> Purging unwanted files...
-> Removing static library files...
-> Stripping unneeded symbols from binaries and libraries...
-> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "anki-sync-server"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Adding install file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: anki-sync-server r259.7ef3d4f-1 (Fri 19 Apr 2019 09:32:41 PM EDT)

Last edited by s7hoang (2019-04-20 02:24:30)

Offline

#4 2019-04-20 02:11:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 22,029
Website

Re: Deleting Existing Files

First, please edit your post to add [ code ] tags around the commands/output and file content.

It seems you have not yet committed the new PKGBUILD.  While I've never removed files from the aur git repos this way, it looks like the problem may arise from the attempt to remove files that are required my the PKGBUILD/.SRCINFO.  So don't rm then commit, rm, and add the new PKGBUILD/.SRCINFO then commit - or alternatively add the new PKGBUILD/.SRCINFO and commit then follow up with the removal of the no-longer-needed files.

Last edited by Trilby (2019-04-20 02:13:44)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2019-04-20 03:26:28

s7hoang
Member
Registered: 2019-04-19
Posts: 6

Re: Deleting Existing Files

I used the alternative version: update PKGBUILD and .SRCINFO (& push my files), followed by removing the extraneous file

It worked, thanks.

Offline

Board footer

Powered by FluxBB