Skip to content

Commit 01e133c

Browse files
committed
Fixed paths for config files in the Snap
Fixes #121 - Fixed path for ipp-usb.conf - Let ipp-usb use its own quirk files right from the immutable file system and also a user-supplied quirk file in the writable area. - Do not copy over quirk files any more
1 parent 986cfc2 commit 01e133c

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

snap/local/run-ipp-usb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ mkdir -p $SNAP_COMMON/var/lock || :
1010
mkdir -p $SNAP_COMMON/var/dev || :
1111
mkdir -p $SNAP_COMMON/quirks || :
1212

13-
# Put config files in place
13+
# Put config file in place
1414
#
1515
# Do not overwrite files and ignore errors, to not reset user configuration
1616
# when running as root and to not have ugly error messages when running as
1717
# non-root.
18-
yes no | cp -i $SNAP/usr/share/ipp-usb/quirks/* $SNAP_COMMON/quirks >/dev/null 2>&1 || :
1918
if [ ! -f $SNAP_COMMON/etc/ipp-usb.conf ]; then
2019
cp $SNAP/etc/ipp-usb.conf $SNAP_COMMON/etc/ >/dev/null 2>&1 || :
2120
fi

snap/local/run-ipp-usb-server

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ mkdir -p $SNAP_COMMON/var/lock
99
mkdir -p $SNAP_COMMON/var/dev
1010
mkdir -p $SNAP_COMMON/quirks
1111

12-
# Put config files in place
13-
cp $SNAP/usr/share/ipp-usb/quirks/* $SNAP_COMMON/quirks
12+
# Put config file in place
1413
if [ ! -f $SNAP_COMMON/etc/ipp-usb.conf ]; then
1514
cp $SNAP/etc/ipp-usb.conf $SNAP_COMMON/etc/
1615
fi

snap/snapcraft.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ parts:
5858
# Not only the config file ipp-usb.conf will be put into a user-editable
5959
# space but also the quirks file, so that the user can add and debug
6060
# quirks
61-
perl -p -i -e 's:/etc/:/var/snap/ipp-usb/common/etc/:' paths.go
61+
perl -p -i -e 's:/etc/ipp-usb/quirks:/var/snap/ipp-usb/common/quirks:' paths.go
62+
perl -p -i -e 's:/etc/ipp-usb:/var/snap/ipp-usb/common/etc:' paths.go
6263
perl -p -i -e 's:/var/ipp-usb:/var/snap/ipp-usb/common/var:' paths.go
63-
perl -p -i -e 's:/usr/share/ipp-usb/quirks:/var/snap/hplip-printer-app/common/quirks:' paths.go
64+
perl -p -i -e 's:/usr/share/ipp-usb/quirks:/snap/ipp-usb/usr/share/ipp-usb/quirks:' paths.go
6465
perl -p -i -e 's:/var/log/ipp-usb:/var/snap/ipp-usb/common/var/log:' paths.go
6566
# Build the executable
6667
craftctl default

0 commit comments

Comments
 (0)